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

(overpass) How to get children relations of each relation?

0
[out:csv(::type, ::id, name, admin_level, parent_id)];

rel(295480)->.c;
.c map_to_area;
rel(area)[admin_level=4];

foreach(
  convert rel ::id = id(), ::=::, parent_id=set(id()); // save as parent_id
  // how to now get each set of children of the admin_level bellow?.
  out;  
);

// the goal is to have:
// child 1 ... parent 1
// child 2 ... parent 1
// child 3 ... parent 1
// child 1 ... parent 2
// child 2 ... parent 2
// ...

asked 30 Jul '18, 19:49

andrefrsilva's gravatar image

andrefrsilva
11335
accept rate: 0%

Source code available on GitHub .