I have a csv file of bounding boxes, that I loaded using pandas in python. The dataframe is df and the column name is coord. Does anyone know how I could create a loop to pass the list to my overpass api query?
I tried this:
import time
import overpass
api = overpass.API(timeout=900)
coords = [df['coord'][0:10]]
for coord in coords:
results =[]
params =[]
params = 'node["power"="generator"]'+coord+';out skel;'
results = api.Get(params, responseformat="json")
time.sleep(5.0)
However, I got a multiple requests error.
I also tried:
x={}
x = (api.Get(param) for param in params)
But that returned a python object ( <generator object <genexpr> at 0x11755c0f8>
) and I need the data as json.
Any help would be much appreciated!