Skip to content

Instantly share code, notes, and snippets.


Chris Henrick clhenrick

View GitHub Profile
IanColdwater / twittermute.txt
Last active Jan 13, 2021
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here:
clhenrick /
Created Dec 3, 2019
California Assembly Districts GeoJSON using ogr2ogr
#!/usr/bin/env bash
ogr2ogr -f GeoJSON ca_assembly_districts.json $URI OGRGeoJSON
clhenrick /
Last active Jul 29, 2020
Aligning GeoJSON data with us-atlas TopoJSON

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).

johnniehard / MBTiles: Pipe GeoJSON from PostGIS to
Last active Apr 11, 2020
MBTiles: Pipe GeoJSON from PostGIS to Tippecanoe
View MBTiles: Pipe GeoJSON from PostGIS to

I had a large dataset in postgis and wanted to avoid the hassle of first exporting it to a several GB geojson file before tiling it with Tippecanoe.

ogr2ogr -f GeoJSON /dev/stdout \                                                                            
PG:"host=localhost dbname=postgres user=postgres password=thepassword" \
-sql "select * from a, roi where a.geom && roi.geom" \
| docker run -i -v ${PWD}:/data tippecanoe:latest tippecanoe \
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
JesseCrocker /
Created Mar 21, 2018
Convert NLCD to Cloud Optimized GeoTiff

NLCD data is published in 3x3 degree chunks, as tiff files inside a zip file. For processing this data it's far more convienent if the files are available directly as tiff files without having to unzip.

s3cmd get --skip-existing -r s3://prd-tnm/StagedProducts/NLCD/data/2011/landcover/3x3/
for i in *.zip; do unzip $i '*.tif'; done

mkdir tmp
mkdir clouded

for i in *.tif; do
perrygeo / Dockerfile
Last active Jan 7, 2021
Minimal debian image with Python 3.6 and geo python tools
View Dockerfile
FROM python:3.6-slim-stretch
ADD requirements.txt /tmp/requirements.txt
RUN apt-get update && \
apt-get install -y \
build-essential \
make \
gcc \
locales \
View arbolVerde.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View valhalla

Ultimate Goal: valhalla running on AWS ECS, behind a load balancer, in multiple regions, with auto scaling, with data updating once a week.


First goal: Build with docker, then cut tiles from a small extract and get server to run locally.

jesse:projects/ $ mkdir ~/valhalla-data
jesse:projects/ $ cd ~/valhalla-data
jesse:projects/ $ wget
[output abbreviated]
jesse:projects/ $ cd ~/projects
vijithassar /
Last active Oct 2, 2019
Selective Force Positioning


Force-directed positioning based on a physics simulation can help with graph readability because it minimizes node occlusion, but it comes at the expense of precision, because both the X axis and the Y axis are compromised in favor of the simulation. As an alternative, we can position the points in some other fashion, then selectively apply force positioning to declutter the layout in specific regions when the user shifts attention toward them, such as with a mouseover.

This project is written in a heavily annotated style called literate programming. The code blocks from this Markdown document are being executed as JavaScript by lit-web.



You can’t perform that action at this time.