London Transport (uk.transport.london) Discussion of all forms of transport in London.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #21   Report Post  
Old November 1st 07, 04:26 PM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Jul 2003
Posts: 856
Default Rail deserts

In article . com, Mr
Thant writes
I loaded all the station locations into a MySQL database, then wrote a
PHP script to generate an SVG file. I didn't bother calculating
distances - it just does separate passes to make the quarter mile
discs appear on top of the half mile discs, which achieves a similar
effect.


Oo, crafty. Let existing graphics software do all the heavy work.

--
Clive D.W. Feather | Home:
Tel: +44 20 8495 6138 (work) | Web: http://www.davros.org
Fax: +44 870 051 9937 | Work:
Please reply to the Reply-To address, which is:

  #22   Report Post  
Old November 1st 07, 04:26 PM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Jul 2003
Posts: 856
Default Rail deserts

In article , Jarle H Knudsen
writes
1 for each grid cell
2 best := infinity
3 for each station on the list
4 d := (distance from station to cell) squared
5 if d best then best := d
6 cell value := sqrt (best)


Why does the distance need to be squared in line 4?


What is the formula for distance between two points on a Cartesian grid?

--
Clive D.W. Feather | Home:
Tel: +44 20 8495 6138 (work) | Web: http://www.davros.org
Fax: +44 870 051 9937 | Work:
Please reply to the Reply-To address, which is:
  #23   Report Post  
Old November 1st 07, 11:45 PM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Jul 2003
Posts: 403
Default Rail deserts

Clive Feather:
When you've finished, the grid holds the distance to the nearest
station. Convert it to a GIF and fiddle with the colour map and, for
example, you can have a map where places within 1km of a station are
green, within 2km are yellow, and more than 2km are red.


With suitable travel-time assumptions, you can make an "isochronic map"
like this one, which I occasionally use as a screen background:

http://www.mysociety.org/2006/travel...big-1177px.png

Delete the last component of the URL to see other examples by the same
people, and discussion. Google on "isochronic map" to see examples by
other people.
--
Mark Brader, Toronto | I am a mathematician, sir. I never permit myself
| to think. --Stuart Mills (Carr: The Three Coffins)
  #25   Report Post  
Old November 2nd 07, 08:22 AM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Aug 2007
Posts: 3
Default Rail deserts

On 2 Nov, 00:45, (Mark Brader) wrote:
Clive Feather:

When you've finished, the grid holds the distance to the nearest
station. Convert it to a GIF and fiddle with the colour map and, for
example, you can have a map where places within 1km of a station are
green, within 2km are yellow, and more than 2km are red.


With suitable travel-time assumptions, you can make an "isochronic map"
like this one, which I occasionally use as a screen background:

http://www.mysociety.org/2006/travel...al-london-big-...

Delete the last component of the URL to see other examples by the same
people, and discussion. Google on "isochronic map" to see examples by
other people.


According to your link Surbiton Station is nowhere near a station.



  #26   Report Post  
Old November 2nd 07, 11:24 PM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Feb 2006
Posts: 168
Default Rail deserts

On Thu, 1 Nov 2007 17:26:38 +0000, Clive D. W. Feather wrote:

In article , Jarle H Knudsen
writes
1 for each grid cell
2 best := infinity
3 for each station on the list
4 d := (distance from station to cell) squared
5 if d best then best := d
6 cell value := sqrt (best)


Why does the distance need to be squared in line 4?


What is the formula for distance between two points on a Cartesian grid?


d = sqrt((x2 - x1)^2 + (y2 - y1)^2).

But that does not explain (to me) why you do d^2 in line 4.

--
jhk
  #27   Report Post  
Old November 3rd 07, 05:44 AM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Aug 2006
Posts: 112
Default Rail deserts

On Sat, 3 Nov 2007 01:24:15 +0100,
Jarle H Knudsen wrote:
On Thu, 1 Nov 2007 17:26:38 +0000, Clive D. W. Feather wrote:

In article , Jarle H Knudsen
writes
1 for each grid cell
2 best := infinity
3 for each station on the list
4 d := (distance from station to cell) squared
5 if d best then best := d
6 cell value := sqrt (best)

Why does the distance need to be squared in line 4?


What is the formula for distance between two points on a Cartesian grid?


d = sqrt((x2 - x1)^2 + (y2 - y1)^2).

But that does not explain (to me) why you do d^2 in line 4.

It's an optimization. You only have to calculate a square root once per
cell.

Tim.

--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

http://tjw.hn.org/ http://www.locofungus.btinternet.co.uk/
  #28   Report Post  
Old November 3rd 07, 05:56 AM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Aug 2006
Posts: 112
Default Rail deserts

On Mon, 29 Oct 2007 11:04:56 +0000,
Clive D. W. Feather wrote:
In article , Tom
Anderson writes
I'm trying to figure out how to program a computer to find these
automatically.


The approach I've taken in the past is very simple. Start with a grid
representing the entire area (to make it easy, say 1000 x 1000 with one
unit on the grid being 100 metres). Set up a list of locations of all
the stations. Then:
for each grid cell
best := infinity
for each station on the list
d := (distance from station to cell) squared
if d best then best := d
cell value := sqrt (best)

You can optimize things slightly by using a lookup table for the square
roots rather than calculating them each time.

I'd have thought a more useful optimization would be:
If D(x,y) = x^2 + y^2

then D(x+1, y) = D(x, y) + 2x + 1
D(x, y+1) = D(x, y) + 2y + 1
D(x-1, y) = D(x, y) - 2x + 1
D(x, y-1) = D(x, y) - 2y + 1

But optimizing without profiling is generally a complete disaster and
you've done this before but I haven't. ;-)


Tim.



--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

http://tjw.hn.org/ http://www.locofungus.btinternet.co.uk/
  #29   Report Post  
Old November 3rd 07, 05:14 PM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Jul 2003
Posts: 842
Default Rail deserts

In message , Mark Brader
writes
Clive Feather:
When you've finished, the grid holds the distance to the nearest
station. Convert it to a GIF and fiddle with the colour map and, for
example, you can have a map where places within 1km of a station are
green, within 2km are yellow, and more than 2km are red.


With suitable travel-time assumptions, you can make an "isochronic map"
like this one, which I occasionally use as a screen background:


http://www.mysociety.org/2006/travel...london-big-117
7px.png


That, Mark, is seriously excellent!

(And could also get you at the very least a shortlisting for the Turner
Prize!)

In all seriousness, a *very* interesting exercise.
--
Ian Jelf, MITG
Birmingham, UK

Registered Blue Badge Tourist Guide for London and the Heart of England
http://www.bluebadge.demon.co.uk
  #30   Report Post  
Old November 4th 07, 01:35 PM posted to uk.transport.london
external usenet poster
 
First recorded activity at LondonBanter: Oct 2003
Posts: 3,188
Default Rail deserts

On Sat, 3 Nov 2007, Ian Jelf wrote:

In message , Mark Brader
writes

With suitable travel-time assumptions, you can make an "isochronic map"
like this one, which I occasionally use as a screen background:

http://www.mysociety.org/2006/travel...big-1177px.png


That, Mark, is seriously excellent!

(And could also get you at the very least a shortlisting for the Turner
Prize!)


Or rather, for Tom Steinberg and, posthumously, Chris Lightfoot, who i
believe did the map.

tom

--
Science which is distinguishable from magic is insufficiently advanced


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:09 AM.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 London Banter.
The comments are property of their posters.
 

About Us

"It's about London Transport"

 

Copyright © 2017