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

Overpass Turbo to extract trees in a relation

0
1

I am trying to extract all "natural=tree in Bergenhus", but there are two relation called Bergenhus nested inside each other (this is how it is suposed to be). The question is how I can get data from within this multipolygon https://www.openstreetmap.org/relation/114938 and not this multipolygon https://www.openstreetmap.org/relation/6492161 with overpass turbo.

asked 21 Mar '17, 21:31

FredrikLindseth's gravatar image

FredrikLindseth
815132435
accept rate: 13%

edited 29 Mar '17, 22:00


One Answer:

3

The simplest thing is probably to set the search area directly to the relation like area(3600114938)->.searchArea;.

Working example here: http://overpass-turbo.eu/s/nGY

There's some information in the Overpass documentation about how OSM ids are mapped to Overpass area ids.

Overpass Turbo uses the public nominatim service to fill in queries like in Bergenhus, so another possibility would be to craft a search there that returned the correct place as the first result. This might be the way to go if you have other similar nested areas to deal with, though I didn't find such a phrase with a few simple tries.

answered 22 Mar '17, 13:33

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

A comment for future viewers: find the ID of the relation (114938 in this case) and add 3600000000 to get to the overpass area ID of 3600114938

(23 Sep '17, 18:27) FredrikLindseth

Source code available on GitHub .