Skip to content

Instantly share code, notes, and snippets.

@flibbertigibbet
flibbertigibbet / query_places.py
Created December 14, 2013 06:03
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)