Skip to content

Instantly share code, notes, and snippets.

View caseycrites's full-sized avatar

Casey W Crites caseycrites

  • San Francisco, CA
View GitHub Profile
$ git clone https://github.com/simplegeo/java-simplegeo.git
#!/bin/bash
regions="ak al ar az ca co ct dc de fl ga hi ia id il in ks ky la ma md me mi mn mo ms mt nc nd ne nh nj nm nv ny oh ok or pa ri sc sd tn tx ut va vt wa wi wv wy australia austria belgium canada denmark france germany india italy netherlands new_zealand spain switzerland turkey united_kingdom"
for region in $regions; do
echo $region
psql -U postgres -d geocodesource -c "delete from ${region}_clean where (latitude, longitude) in (select distinct latitude, longitude from ${region}_full where replace(upper(address), ' ', '') like '%P.O.BOX%' or replace(upper(address), ' ', '') like '%POBOX%' or address is null)"
done
[
{
"abbr": "",
"bounds": [
-123.17382499999999,
37.639829999999996,
-122.28178,
37.929823999999996
],
"id": "County:San_Francisco:9q8yvv",
client.getContains(37.776549, -122.406406, callBack);
{
"geometry": {
"coordinates": [
[
[
-122.446336,
37.745460000000001
],
[
-122.446428,
client.getBoundary("Census_Tract:06075021600:9q8ytz", callBack);
function displayData(err, data) {
if (err) {
console.error(err);
} else {
console.log(JSON.stringify(data));
}
}
[
{
"abbr": "",
"bounds": [
-122.431477,
37.741833,
-122.421328,
37.748123999999997
],
"id": "Census_Tract:06075021500:9q8ywp",
client.getOverlaps(37.747296999999996, -122.43409, 37.751841999999996, -122.424768, {'limit': 2}, callBack);
client.getDensity(37.765850, -122.437094, 'mon', 4, callBack);