Skip to content

Instantly share code, notes, and snippets.

View jescott's full-sized avatar

Jim Scott jescott

  • West Lake Hills, Texas
View GitHub Profile
@wboykinm
wboykinm / compile_zillow_neighborhoods.sh
Last active July 9, 2020 18:40
Quickly compile all of Zillow's neighborhood geodata into a single national file
# Data courtesy of Zillow, attribution required: https://www.zillow.com/howto/api/neighborhood-boundaries.htm
# Requires GDAL/OGR: http://www.gdal.org/
STATES=("AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DC" "DE" "FL" "GA" "HI" "ID" "IL" "IN" "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT" "VT" "VA" "WA" "WV" "WI")
rm -rf zillow_neighborhoods.*
for s in "${STATES[@]}"; do
echo "Processing $s"
wget -c https://www.zillowstatic.com/static/shp/ZillowNeighborhoods-$s.zip -O $s.zip
unzip $s.zip
@pramsey
pramsey / p2h_distance.sql
Last active January 15, 2016 15:13
Parcel Distance to Hydrant
-- An example of a lateral join driving a nearest-neighbor
-- distance calculation
SELECT
parcels.*,
-- keep the hydrant id around, might be useful later
hydrants.cartodb_id as hydrant_cartodb_id,
-- calculate distance over the spheroid using geography distance
ST_Distance(geography(hydrants.the_geom), geography(parcels.the_geom)) as distance
FROM
-- for this data, removing the duplicate parcel geometries and
@pramsey
pramsey / ccog-readinglist.md
Last active September 3, 2021 00:30
Canadian Council on Geomatics Reading List
@ismyrnow
ismyrnow / geojson-to-cartodb.js
Created July 13, 2015 15:42
Stream GeoJSON into CartoDB
/**
* Streams a geojson file to an existing cartodb dataset.
* This requires that the dataset is created in CartoDB
* initially using a subset (1st record) of geojson data.
*/
var fs = require('fs');
var through2 = require('through2');
var geojsonStream = require('geojson-stream');
var cartodbTools = require('cartodb-tools');
@benbalter
benbalter / geojson-conversion.sh
Last active April 23, 2024 13:16
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}