Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Henrick clhenrick

View GitHub Profile
@IanColdwater
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: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@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 / 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).

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

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 \
--output=/data/yourtiles.mbtiles
@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
@JesseCrocker
JesseCrocker / nlcd_to_cog.md
Created Mar 21, 2018
Convert NLCD to Cloud Optimized GeoTiff
View nlcd_to_cog.md

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
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 diary.md

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

Diary

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 http://download.geofabrik.de/north-america/us/california-latest.osm.pbf
[output abbreviated]
jesse:projects/ $ cd ~/projects
@vijithassar
vijithassar / README.md
Last active Oct 2, 2019
Selective Force Positioning
View README.md

Overview

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.

Implementation

Setup

You can’t perform that action at this time.