OverpassAPI calls - marleo/AppDev_FoodFindAR GitHub Wiki

The OverpassAPI allows to directly retrieve a JSON object, containing all information, that gets requested by a URL-Query.


Example:

http://overpass-api.de/api/interpreter?data=[out:json];(node["amenity"~"restaurant"](46.616062,14.265438,46.626062,14.275438);way["amenity"~"restaurant"](46.616062,14.265438,46.626062,14.275438);relation["amenity"~"restaurant"](46.616062,14.265438,46.626062,14.275438););out body;>;out skel;

  • ["amenity"~"restaurant"] - specifies which type of node we want to retrieve. In our app we want to get restaurants.
  • (46.616062,14.265438,46.626062,14.275438) - This is the boundingbox. It consists of: latitude of the top right point, longitude bottom left, latitude top right and longitude bottom right. This gives us a rectangle area, in which the nodes specified with ["amenity"~"restaurant"] are retrieved.
  • out skel - This specifies what information we want to have. There are many different types of return JSON's we could retrieve, but we only need the basic information about the coordinates, the name and the street, that's why skel is enough for us.

All the queries were tested on Overpass Turbo, a GUI that displays the query results on a map. That way you know what you will receive, using your query.

https://overpass-turbo.eu/

further information about OverpassAPI:

https://wiki.openstreetmap.org/wiki/Overpass_API