I have read some posts on this subject but none of them solved my problem. I have a file Olszon.osm which opens well in JOSM, has one long way of about 7000 nodes. It starts with <osm version="0.6" generator="osmfilter 1.2S"> <node id="137350351" lat="53.0048676" lon="106.9679891" version="8" timestamp="2013-01-23T00:04:12Z" changeset="14752406" uid="214969" user="AndrewBuck"/> <node id="137350353" lat="53.0111087" lon="106.9858454" version="8" timestamp="2013-01-23T00:04:12Z" changeset="14752406" uid="214969" user="AndrewBuck"/> ....then in the middle start references: <nd ref="2125463617"/> <nd ref="2125463613"/> <nd ref="2125463612"/> <nd ref="2125463611"/> ... I tried to convert it to .csv file by typing: osmconvert Olszon.osm --all-to-nodes --csv="@id @lat @lon" --csv=headline > Olszon.csv but wat I get is Olszon.csv file that contains nodes but they are not in good order. The first node in .csv file has id = 137350351 but the first node on the way should have id = 2125463613. How to solve the problem? Writing a script in VBA? asked 30 May '14, 21:26 miko679 |
Converting an OSM file to CSV is a task that can be done in different ways; however, since OSM files can normally contain multiple ways that sometimes share the same nodes, it is not generally possible to convert OSM to CSV so that "nodes are in the right order" - there might be any number of "right orders", even though in your specific case there's only one. Writing a small program that does the conversion you want will probably be the easiest way - on Unix with Perl installed, this could be as simple as
answered 30 May '14, 22:10 Frederik Ramm ♦ |