monilus98
monilus98

Reputation: 63

How to use overpass api?

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

Upvotes: 5

Views: 8127

Answers (1)

Örom Loidl
Örom Loidl

Reputation: 386

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.

Upvotes: 5

Related Questions