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

polygon as global area for overpass query

0

I have been trying to provide a polygon with an array of coordinates as a global parameter for my overpass query. But the query is through syntax error.

[bbox:poly:"50.7 7.1 50.7 7.2 50.75 7.15"];
node[amenity=cafe];
out;

Error: line 1: parse error: ',' or ']' expected - ':' found. Error: line 1: static error: A bounding box needs four comma-separated values. Error: line 1: static error: A bounding box needs four comma-separated values. Error: line 1: static error: A bounding box needs four comma-separated values. Error: line 1: parse error: ';' expected - ']' found.

Providing a bounding box instead works as expected.

[bbox:50.7,7.1,50.75,7.25];
node[amenity=cafe];
out;

It also works when the polygon is given in-line,

node[amenity=cafe](poly:"50.7 7.1 50.7 7.2 50.75 7.15");
out;

(as suggested in this tutorial)

As final attemp when below query was tried no error was given but also the result was blank.

area["50.7 7.1 50.7 7.2 50.75 7.15"];
node[amenity=cafe](area);
out;

Is it possible to give a polygon instead of bounding box as a globle parameter in an Overpass query. Could not find any documentation over the Overpass wiki pages that supports the thing I am trying here.

asked 29 Nov '18, 13:37

user1894's gravatar image

user1894
11446
accept rate: 0%

Source code available on GitHub .