NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am trying to get all place=* nodes lying within boundary=administrative area and matching by name but it always times out even for very small bbox. Is there a problem in my query?

[out:xml][bbox:{{bbox}}][timeout:120]; ( area({{bbox}})["boundary"="administrative"][name]; )->.admins; ( node({{bbox}})[place][name]; )->.places; foreach.admins->.admin( node.places(area.admin)(if: t["name"]==admin.t["name"]); (._;>;); out; );

asked 13 Jan '23, 16:32

star_Martin_star's gravatar image

star_Martin_...
16113
accept rate: 0%


Not 100% sure, but I think area on;y works on specifically named objects so I've searched for relations & then converted them to areas. Unsure what area your searching so I've added an admin_level to restrict the output.

https://overpass-turbo.eu/s/1q7p

[bbox:{{bbox}}];
rel[boundary=administrative][admin_level=6][name];
map_to_area;
for(t["name"]) {
node(area)[place][name](if:t["name"] == _.val);
out meta center;
};
permanent link

answered 13 Jan '23, 19:03

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483

question asked: 13 Jan '23, 16:32

question was seen: 789 times

last updated: 13 Jan '23, 19:03

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum