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?

I could not find any documentation over the Overpass wiki pages that supports the thing I am trying here.

0

Is it possible to give a polygon instead of bounding box as a global parameter in an Overpass query?

As described in the Overpass QL documentation, the only supported version is (poly:"50.7 7.1 50.7 7.2 50.75 7.15"). All other versions you mentioned don't exist at all, in particular there's no way to specify a global polygon.

Your attempt area["50.7 7.1 50.7 7.2 50.75 7.15"]; would actually look for a area with key "50.7 7.1 50.7 7.2 50.75 7.15", so this also doesn't work.

Try opening a feature request on https://github.com/drolbr/Overpass-API/issues and describe a solid use case why you think this feature is required, i.e. which issue this solves.

  • Also, avoid posting the same question on multiple sites at all costs. It's really a waste of time for everyone: help.openstreetmap.org/questions/66988/… – mmd Nov 30 '18 at 15:34
  • I had no choice but to post it here, as none of the questions get any response over the help.osm.org. Had to do this to reach more people, hoping someone would respond. Thanks for suggestion I will try raise a git issue. – akzhere Dec 3 '18 at 7:20

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.