0

I have just learned about the overpass turbo service and its ability for querying data. I have tried the following query and it works fine:

[out:json][timeout:25];
(
node["highway"]({{bbox}});
);
out body;

But when I replace the bbox with a name of city which according to the wiki page of overpass it should be like below, the code gives an error. Would be glad to know what is the problem with the second code?

[out:json][timeout:25];
(
node["highway"]({{geocodeId: Vienna}});
);
out body;

error message:

An error occured during the execution of the overpass query! This is what overpass API returned: Error: line 3: parse error: Unknown query clause Error: line 3: parse error: ')' expected - 'node' found. Error: line 4: parse error: Unknown type ")" Error: line 4: parse error: An empty query is not allowed Error: line 4: parse error: Unknown type ";" Error: line 5: parse error: An empty query is not allowed

1 Answer 1

2

As you want to query nodes in a certain area, you need to use the following syntax for overpass turbo:

[out:json][timeout:25];

{{geocodeArea:Vienna}}->.searchArea;
node["highway"](area.searchArea);
out body;
3
  • Thanks. It works. How about if we want to query based on the lat, lon input? for example we can define a bbox based on lat and long and use that bbox in the query? any help or link to guidlines about this would be highly appreciated.
    – James Mc
    Commented May 17, 2016 at 13:38
  • Take a look around on stackoverflow or GIS stackexchange: gis.stackexchange.com/questions/19760/…
    – mmd
    Commented May 18, 2016 at 16:41
  • @mmd if i like to use cordinates like this [bbox:25.2670,51.5039,25.2906,51.5441] rather than VIENNA for example should i puth the cordinates inside the {geocodeArea:bbox}
    – noob
    Commented Dec 18, 2020 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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