This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

nodes order to have a correct map

0

i've import some osm data in my db with bulkDB.pl When i do a query i find a relation, then i find the ways in the relation and then i find nodes in the ways. For each nodes i get coordinates and with mapbox i try to make a map. It seems that the order of my nodes is incorrect. Which is the correct order of the nodes to have a layer with a correct line?

Thank you

asked 29 Nov '17, 15:24

Maurizio%20Proietti's gravatar image

Maurizio Pro...
11112
accept rate: 0%


One Answer:

1

I am not familiar with bulkDB.pl - Are you talking about this collection of scripts? https://wiki.openstreetmap.org/wiki/OsmDB.pm

If so, it looks like there is a table named waynodes which maps nodes to ways. The second column in this table (named "s" which is not very descriptive) indicates the order of the nodes in the way, starting at 0. So whatever query you are using to get the nodes out of the database needs to somehow include a sort by s clause in it.

answered 29 Nov '17, 16:01

ToeBee's gravatar image

ToeBee
976920
accept rate: 27%

Source code available on GitHub .