Hey, is it possible to add a polygon (for example the shape of a city) in overpass turbo, so that the output only contains data from the city (inside of the polygon)? Can I drag and drop or open a shapefile in overpass turbo for that? Or is there a way to draw one? Thanks for your help!

asked 07 Jun, 11:00

milo22948392's gravatar image

milo22948392
11335
accept rate: 0%


Edit: You can't import data into overpass & it doesn't really understand true polygons, just closed ways, but you can use existing OSM data.

There's quite a few ways to achieve this depending on what data you have for the area to be searched:

{{geocodeArea:Greater London}};
rel(pivot)->.Bound; //change to way to render
way(r.Bound)->.Bound;
.Bound out geom;
nwr[amenity=police](area);
out center;

These three lines are only to display the search area's boundary & can be removed if desired:

rel(pivot)->.Bound; //change to way to render
way(r.Bound)->.Bound;
.Bound out geom;

The boundary's ID:

rel(175342); map_to_area;
nwr[amenity=police](area);
out center;

The IDs for relations start at 3600000000 so by adding the id value to it allows

area(3600175342);
nwr[amenity=police](area);
out center;

Note the different brackets used:

area[name='Greater London'];
nwr[amenity=police](area);
out center;
permanent link

answered 07 Jun, 14:32

DaveF's gravatar image

DaveF
3.0k7693127
accept rate: 14%

edited 07 Jun, 15:52

Your answer
toggle preview

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:

×463
×89
×84

question asked: 07 Jun, 11:00

question was seen: 365 times

last updated: 07 Jun, 15:52

powered by OSQA