Skip to content

Instantly share code, notes, and snippets.

@mappingvermont
Created August 9, 2016 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mappingvermont/cf553795e2d6531765dd61fc1c4379d8 to your computer and use it in GitHub Desktop.
Save mappingvermont/cf553795e2d6531765dd61fc1c4379d8 to your computer and use it in GitHub Desktop.
import overpass
import csv
import sys
api = overpass.API(timeout=900)
coords = []
with open('bbox.csv') as theFile:
csvReader = csv.reader(theFile)
csvReader.next()
for row in csvReader:
coords.append(row[2])
for coord in coords:
api_calls = []
params = 'node["power"="generator"]'+coord+';out skel;'
try:
response = api.Get(params)
#print response
api_calls.append(response)
print 'This succeeded: {0}'.format(coord)
except:
print '--------------------------------'
print 'This failed: {0}'.format(params)
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment