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

How to use geocodeArea: instead of bbox in an overpass-turbo query ?

0

Hi,

I'd like to run this query

way[building]({{bbox}})->.a; foreach .a ( way.a(around:400); way._(if:count(ways) == 1); out center; );

I found here but using {{geocodeArea:"Burlats"}} or {{geocodeArea:"Boissezon"}} or {{geocodeArea:"Noailhac"}} instead of the {{bbox}}parameter....It seems I'm doing something wrong because

way[building]({{geocodeArea:"Boissezon"}})->.a; foreach .a ( way.a(around:400); way._(if:count(ways) == 1); out center; ); just get me a syntax error message :)

Thanks

asked 30 Nov '17, 20:56

Serpico's gravatar image

Serpico
4112
accept rate: 0%


One Answer:

5

The Overpass Turbo shortcut replaces the geocodeArea with an area query, which is not valid syntax for specifying the area in the way query.

The fix is to save the area result to a set first:

{{geocodeArea:"Boissezon"}}->.searchArea;
way[building](area.searchArea)->.a;
foreach .a (
  way.a(around:400);
  way._(if:count(ways) == 1);
  out center;
);

An easy way to recall the structure of such queries is to put something like amenity=* in Toledo into the Wizard.

answered 01 Dec '17, 11:42

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Source code available on GitHub .