Created
August 9, 2016 21:03
-
-
Save mappingvermont/cf553795e2d6531765dd61fc1c4379d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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