Skip to content

Instantly share code, notes, and snippets.

View DannyAziz's full-sized avatar
🤔
Working hard or hardly working?

Danny Aziz DannyAziz

🤔
Working hard or hardly working?
View GitHub Profile
@DannyAziz
DannyAziz / query_places.py
Created November 19, 2015 19:06 — forked from flibbertigibbet/query_places.py
Finds the centroids of 50km hexagons to tile a bounding box and writes the coordinates to a file. Then, creates a bash script to query Google Places for each point and write the responses to files. (There's some overlap between the queried areas, but it should be minimal.) Here, it's searching for grocery stores in New Jersey.
#!/usr/bin/env python
import csv
from math import cos, pi
# API key for Google Places
api_key= 'YOUR_KEY_GOES_HERE'
outf = open('njpoints.csv','w')
w = csv.writer(outf)