How to get point of interest near my point using overpass-api?
Asked Answered
C

1

8

I am using Overpass API.

I have an issue to find some points of interest (cafes, hospitals, schools) near (around in 100-200 miles) my point. I have only latitude and longitude.

Overpass API gives opportunity to get POIs using your place name. But I don't have it. I have only coordinates.

How can I do that ?

Chalfant answered 8/5, 2013 at 13:58 Comment(0)
K
11

Use the around statement!

<query type="node">
  <around lat="..." lon="..." radius="..."/>
  <has-kv k="amenity" v="cafe" />
</query>
<print />

Try this example on overpass turbo!

Kali answered 8/5, 2013 at 16:28 Comment(2)
Can you please help with one more issue. How to set several keys & values. For example I need amenity cafe and bank. And also "historic" keys with value f.e. "battlefield" ? So in the result I need cafes, banks and battlefields. ThanksChalfant
Logic or for a particular key is best done with a little trick: use a regular expression like <has-kv k="amenity" regv="cafe|bank"/>. Logic or for different keys has to be done by <union>ing multiple <query>s. Like in this example.Kali

© 2022 - 2024 — McMap. All rights reserved.