4

I am a total newbie so this may be a silly question, but I can't find any tutorials on how to query overpass api to display things on own website. Do I install it on my server or is there a code to query it in the script? What I want to achieve is to have a searchbar on one page to search for tags, and that would display one random point with that tag on the other page with a leaflet map. But I am struggling to even display any points on it. Would it be actually better to have a local geojson file with set list of points in one town if I want to limit them to just this town anyway? I will be grateful for any help, it's a first time I am doing something like this and it horribly stresses me out

1
  • Overpass API just returns raw data. In order to show this data you will need Leaflet or OpenLayers or something similar. The Internet has various examples for accessing Overpass API from Leaflet/OpenLayers.
    – scai
    Commented Mar 26, 2020 at 6:41

1 Answer 1

5

You can visually run and try overpass queries using http://overpass-turbo.eu/.

In order to unload the overpass server, it would be a good idea to fetch the data once (and update regularly) and host them on your own server (also pay attention to the terms of use of the specific APIs, they might limit the number of requests per hour or prohibit using the for autocomplete).

To query the server from an application, GET from https://overpass-api.de/api/interpreter?data=, followed by your request (the same you would type into overpass turbo, just without line breaks).

It is also possible to host an overpass instance on your own.

If you need to learn the Overpass Query Syntax first, you can read the docs.

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