Skip to content

Instantly share code, notes, and snippets.

@danhammer
Last active August 29, 2015 14:26
Show Gist options
  • Save danhammer/947fd40bf9ae9637e47a to your computer and use it in GitHub Desktop.
Save danhammer/947fd40bf9ae9637e47a to your computer and use it in GitHub Desktop.
# 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