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

how to get parent ways of some way

0

hi

i wanna take parent ways of some way three times, its possible with this method

https://www.openstreetmap.org/api/0.6/way/id.json

https://www.openstreetmap.org/api/0.6/node/ways.json

but i must send request 6 time to get my desire result

can i make it one request with overpass api ?

btw , if would be awesome if add nearest highway to result :D

[out:json];
way(325887398);
way(around:200)[highway~"residential|secondary"];
out;

thx for helping

asked 08 Jul '20, 09:05

ryzexsp's gravatar image

ryzexsp
11113
accept rate: 0%

edited 08 Jul '20, 09:51

2

Could you expand/clarity. Post the overpass routines. What's in id.json & ways.json? What does "three times" mean?

(08 Jul '20, 09:36) DaveF

https://www.openstreetmap.org/api/0.6/way/325887398.json

its an way id , through this way i take first parent node

https://www.openstreetmap.org/api/0.6/node/3325093995/ways.json

through this i take first parent way

i do this three times to get parent ways

"three times" i want take parent of way1 which is for example way2, and take parent of way2 which is way3 , and take parent of way3 which is way4

and nearest secondary way and end

(08 Jul '20, 09:58) ryzexsp
2

There are neither parent ways not parent nodes in the OSM data model.

Ways -do- have member nodes (which carry the geometry), and a specific node can be a member of multiple ways, typically, but not always, are junctions and connections between ways (where the the end node of a way will be an end node of another way).

(08 Jul '20, 13:49) SimonPoole ♦

Source code available on GitHub .