Hello, I try to use Overpass QL to get all ways in a given area in CSV. I want to have all coordinates of all nodes of each street. For example:
I tried several approaches but none worked. I can get all nodes and all ways but I found no way to have an explicit association between nodes and ways. I do not manage to add the way information to each node, and the node list does not appear for each way in the CSV output. Any help would be appreciated. Thanks. asked 12 Sep '15, 18:28 haltux |
At this time, it's not possible to have details originating from several OSM objects in one single line. In your case, that's the node id + details, as well as the corresponding way id. I suggest to take advantage of the It will first output the way id, followed by a list of its nodes with their respective node id and lat/lon details.
Try it in overpass turbo: http://overpass-turbo.eu/s/bpj In a post processing step, you'll have to transform this output to whatever format you need. Caveat: CSV output does NOT preserve the sequence of nodes per OSM way. Depending on your requirements, the results may therefore be completely useless to you! CSV output was primarily designed to return tags for relations/way/nodes,.... Returning geometry information for ways was not a main focus. Maybe you want to check JSON/XML output with answered 12 Sep '15, 19:25 mmd OK, thank you. However, if nodes are not ordered, it is actually totally useless for me. Thanks for having pointed that out. I really have to rethink all that, probably start from JSON and generate my own CSV.
(12 Sep '15, 19:54)
haltux
By the way, my actual goal was to generate all pairs of nodes (X,Y) such that X and Y are two consecutive points in a way. I guess there is no direct way to do that, but if you have any idea, I would be very interested in it.
(12 Sep '15, 20:00)
haltux
Right, I don't see an option to have pairs of consecutive points as an Overpass result. You'll have to implement this in your favorite language based on the JSON/XML output returned by the API.
(12 Sep '15, 20:28)
mmd
|