mvexel / overpass-api-python-wrapper

Python bindings for the OpenStreetMap Overpass API
Apache License 2.0
359 stars 89 forks source link

Amenities in radius of coordinates using overpassturbo /OSM #121

Closed ulan123 closed 2 years ago

ulan123 commented 4 years ago

Hi All, I have data with columns latitude and longitude (data.xlsx).it has 17K observations. I want to search for amenities around 1000 meters for each address in my dataset. Later I want to calculate difference from this address to each of the obtained amenities per address and create new column with their average value.
I am quite new to request codes in Python, so I know how to do it for one address (lat, lon), but could someone help how to do it for all 17K?

import requests import json overpass_url = "http://overpass-api.de/api/interpreter" overpass_query = """ [out:json]; ( node(around:900.0,52.2438559,20.91043506290992)["amenity"~"^(cafe|restaurant|bar)$"]; ); out body; """

response = requests.get(overpass_url, params={'data': overpass_query}) response.json()

mvexel commented 2 years ago

This is more of a general Overpass API question. Best to try OSM communications channels.