query for locations with overpass api

时间:2015-09-14 15:27:00

标签: openstreetmap overpass-api

Hi I'm trying to do a query for locations (City, Street, etc.) with suggestions, just like the search boxes at google maps, openstreetmap.org or the search box on the http://overpass-turbo.eu/ site.

Can anyone help me out?

What I did so far, was this query, but I think it's the wrong approach because it's very slow and the results are bad...

[out:json];
node
  ["name"~"Berlin"]
  ["place"~"city|village|town"];
out body;

1 个答案:

答案 0 :(得分:2)

openstreetmap.org and search box at overpass turbo use Nominatim. See the wiki entry http://wiki.openstreetmap.org/wiki/Nominatim

The following is the JS script used by overpass turbo to query Nominatim: https://github.com/tyrasd/overpass-turbo/blob/master/js/nominatim.js