[OSM-dev] Interpreting segments of a way

Andreas Brauchli linux at elementarea.net
Tue Oct 24 19:09:58 BST 2006


On Tue, 2006-10-24 at 07:52 +0200, lars wrote:
> Few things can cause so much confusion as the word "ordered", and 
> just reiterating or emphasizing the word doesn't clarify anything.
> The key is the "who" question: ordered by whom?

by the api is the layer where it makes sense.. writing a DB-procedure to
do it would maybe be possible but inadequate (and less simple) in my
opinion, as everything that goes in, goes through the api, am i right?

in my osm2mp.php script i've written a function that creates ordered
lists of ways (sort of, it just returns the start of those way-pieces),
if the way splits the function returns multiple starting points. that's
function find_way_starts()
the other function ( next_seg() )then just follows the
from-to-from-to-path of the segments until it breaks (no more segments
in this way-piece) and then does the same for any following way-pieces
(there's also a protection against loopings ( function set_used() )

code on http://wiki.openstreetmap.org/index.php/Talk:OSM_Map_On_Garmin






More information about the dev mailing list