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

Overpass API: Is it possible to select polygon and get geographical data?

Thanks in advance!

I want to select polygon and get geographical data of polygon's edges, like polyline.

asked 15 Aug '13, 14:59

AnkaAnica's gravatar image

AnkaAnica
31113
accept rate: 0%

edited 15 Aug '13, 15:44


Do you mean you want to download all data inside a non-rectangular polygon? That is explained on http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Select_Region_by_Polygon .

(
  node(poly:"50.7 7.1 50.7 7.12 50.71 7.11");
  <;
);
out meta;

Note that you need some kind of recurse magic to also get ways and relations.

To get bounding box coordinates by selecting from a map use http://osm.duschmarke.de/bbox.html (german; you need to hold down ctrl and then click and drag the bbox, the coordinates will be displayed in the bottom text fields).

permanent link

answered 15 Aug '13, 15:08

gormo's gravatar image

gormo
2.9k32660
accept rate: 13%

edited 15 Aug '13, 15:53

2

To download by country, use area[name="Belgium"];( node(area); <;);out meta;. The precise name can be tricky, but you can open [the popup UI][1], click somewhere in your country and search on the last pages of the popup for an entry with "Country Boundary". That gives you the OSM name of your country to use in the above query.

[1] http://overpass.apis.dev.openstreetmap.org

(16 Aug '13, 07:13) Roland Olbricht

Thank you very much! Just one question more...can I select or entry name of provice?

(16 Aug '13, 12:34) AnkaAnica
permanent link

answered 15 Aug '13, 17:15

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Can I do it by selecting name of country and how?

(15 Aug '13, 17:24) AnkaAnica
3

If you are looking for country outlines, go to www.naturalearthdata.com and download their "admin0" data set.

(15 Aug '13, 18:25) Frederik Ramm ♦

If you want to do the mentioned query via overpassapi limited by the outline of a country, go to http://nominatim.openstreetmap.org and enter the countries name ... examine the results carefully and find the right relation within the raw OSM data.

Then you can decide to use the relation ID number that you can use by adding the mentioned offset, or type the name of the "area" that you have found.

But be sure to use the right name, and that the name is unique in the OSM database.

(19 Aug '13, 16:49) stephan75

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:

×85

question asked: 15 Aug '13, 14:59

question was seen: 8,050 times

last updated: 19 Aug '13, 16:49

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