Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Henrick clhenrick

View GitHub Profile
@clhenrick
clhenrick / README.md
Last active Sep 23, 2020
PostgreSQL & PostGIS cheatsheet (a work in progress)
View README.md
@clhenrick
clhenrick / README.md
Last active Aug 5, 2020
Data URI SVG icons with Leaflet
View README.md
@clhenrick
clhenrick / README.md
Last active Jul 29, 2020
Aligning GeoJSON data with us-atlas TopoJSON
View README.md

This is a demonstartion of how to align arbitrary GeoJSON data to the us-atlas topojson data.

It's important to note that the TopoJSON from us-atlas has it's map projection, (d3.geoAlbersUsa), built into it. In other words, it is considered "projected" geographic data.

This is an important distinction from GeoJSON data which is most typically stored in the unprojected Coordinate Reference System WGS84, also commonly referred to as "lat, lon" (though coordinates are most often stored in the order longitude, latitude).

@clhenrick
clhenrick / .block
Last active Jul 23, 2020
Custom tiles in Google Maps
View .block
license: apache-2.0
@clhenrick
clhenrick / .block
Last active Feb 18, 2020
D3 Canvas color transition II
View .block
license: mit
@clhenrick
clhenrick / nyc_421a.sql
Last active Dec 26, 2019
Create table statement for NYC properties with 421a tax exemption status, using data from https://github.com/toolness/nyc-421a-xls
View nyc_421a.sql
DROP TABLE IF EXISTS nyc_421a;
CREATE TABLE nyc_421a (
years numeric,
borough_name varchar,
borough numeric,
neighborhood varchar,
building_class_category varchar,
tax_class_at_present varchar,
block numeric,
@clhenrick
clhenrick / get_assembly_districts.sh
Created Dec 3, 2019
California Assembly Districts GeoJSON using ogr2ogr
View get_assembly_districts.sh
#!/usr/bin/env bash
URI="https://services1.arcgis.com/sTaVXkn06Nqew9yU/ArcGIS/rest/services/Political_Boundaries_Feb2016/FeatureServer/1/query?&outfields=*&f=geojson&where=objectid%20is%20not%20null"
ogr2ogr -f GeoJSON ca_assembly_districts.json $URI OGRGeoJSON
@clhenrick
clhenrick / .gitignore
Last active Sep 12, 2019
Node.JS script to aggregate NYC vehicle collision data into a hexagonal grid and compute the ck means for each cell using Turf.JS and Simple Statistics.JS
View .gitignore
node_modules/
.DS_Store
@clhenrick
clhenrick / python_cheat_sheet.py
Last active Jun 21, 2019
cheat sheet to help me learn python
View python_cheat_sheet.py
"""
Python Command and Character list From Learn Python the Hardway by Zed Shaw (expanded from Lesson 22)
"""
### Character / Command What it's called What it does example example2 ###
pydoc <something> #pydoc gives you the manual page for something you want to know about in python pydoc sys
help() #help function use when running python to find help on an object
print() #print function prints to the console whatever is next print(“Hello World!”) print(1 + 2)
" " # double quotes starts and ends a string print(“Hello World!”)
' ' # single quotes starts and ends a string print('Hello World!')
@clhenrick
clhenrick / .block
Last active May 15, 2019
San Francisco Tidal Predictions
View .block
license: mit
You can’t perform that action at this time.