Hi,

[email protected] wrote:
I suppose the way to do it would be to break the OSM highways down in
unique ways which link junctions, so that each could be given a length
(following node to node) and then use the dijkstra to calculate distance
to each 'end' node.

I happen to have a Perl script that does something like this, you give it a starting point and a .osm file and how far you're willing to travel and it creates a picture like the one that is hopefully attached (where grey = out of range, light red = half range, dark red = full range).

The script creates an in-memory structure of all nodes with their neighbours and then uses a Dijkstra-like algorithm to flood-fill them with the best distance found. With some tweaking one can also switch to sketching travel times instead of pure distances, dependent on the highway type.

Oh heck I'll just attach it here even though this is talk not dev. Public Domain, and no warranties ;-)

Bye
Frederik

--
Frederik Ramm  ##  eMail [email protected]  ##  N49°00'09" E008°23'33"

<<inline: output.png>>

Attachment: distance.pl
Description: Perl program

_______________________________________________
talk mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk

Reply via email to