Last active
August 29, 2015 14:26
-
-
Save danhammer/947fd40bf9ae9637e47a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Sample code to identify buildings withing a supplied bounding box. | |
import requests | |
def grabber(bbox, residential=True): | |
BASE = "http://wolak.enviro-service.appspot.com/buildings" | |
payload = bbox | |
payload['residential'] = residential | |
res = requests.get(BASE, params=payload).json() | |
return res | |
bbox = dict(xmax=-121.75, xmin=-122, ymax=38, ymin=37) | |
response = grabber(bbox) | |
print response['results'][0] | |
# >>> {u'lat': 37.39955362, u'lon': -121.91971865} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment