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

output tag element

0

I currently have a query that is outputting shops (nodes & ways) and the area ids they belong in. I also have a list of the areas details in the second step. Since some of the areas have the same ids, I also need to output the admin_level in each for each of the areas in the first query, so that I can tie them up to the areas in the second query. Does anyone know what I need to add to

out ids;

to get the admin level?

[out:json][timeout:3000];

{{geocodeArea:Poland}}->.searchArea;

(node[shop="alcohol"](area.searchArea);
 way[shop="alcohol"](area.searchArea);)->.posts;

foreach.posts(
  out center;
  (._;>;);
  is_in;
  area._[admin_level~"[467]"];
  out ids;
);

// collect area details in 2nd step
(.posts;>;);
is_in;
area._[admin_level~"[467]"];
out;

asked 15 Sep '16, 14:49

scass's gravatar image

scass
21337
accept rate: 0%

Source code available on GitHub .