I try to get the geocodes coordinates from the location(nominatim) into the Overpass query.
Is there an easy way to do this?
import json
import requests
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="your_app_name")
location = geolocator.geocode("Hufnerstraße 1, Hamburg")
lat = location.latitude
lng = location.longitude
print(lat, lng)
overpass_url = "http://overpass-api.de/api/interpreter"
overpass_query = """
[out:json];
(node["shop"](around:500,53.59057989074252,10.05931163368573);
);out;
"""
response = requests.get(overpass_url, params={'data': overpass_query})
data = response.json()
print(response.json())