Skip to content

Instantly share code, notes, and snippets.

@youweit
Created August 1, 2013 14:26
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 youweit/6131865 to your computer and use it in GitHub Desktop.
Save youweit/6131865 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import urllib2
import json
import pygmaps
url = 'http://60.199.253.136/api/action/datastore_search?resource_id=d7a1b4c2-cad0-44f2-958a-a9d7a9330c95&limit=10000'
def main():
content = urllib2.urlopen(url).read()
datas = json.loads(content)['result']['records']
mymap = pygmaps.maps(datas[0]['LAT'], datas[0]['LNG'], 16)
for item in datas:
name = item['HOTSPOT_NAME']
try:
lat = float(item['LAT'])
lng = float(item['LNG'])
except ValueError:
continue
print name, lat, lng
mymap.addpoint(lat, lng, '#0000FF')
mymap.draw('./wifly.html')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment