Skip to content

Instantly share code, notes, and snippets.

View iandees's full-sized avatar
🏠
Working from home

Ian Dees iandees

🏠
Working from home
View GitHub Profile
@iandees
iandees / README.md
Last active February 4, 2019 20:34
A mapping of ZCTA (zipcode-ish) to US counties, with a "percent covered" calculated using the land area.

This CSV uses the census_geo_containment table of CensusReporter's TIGER dumps to show the relationship between zipcodes (represented here as ZCTAs) and counties. It's important to note that ZCTAs are not zipcodes. Further, the ZCTA dataset haven't been updated since 2010, and are out of date. But this is a pretty good place to start and is still useful.

Geographies are represented here using extended Census geoids. If you chop off the first 7 characters of the child_zip values you'll get the zipcode and if you chop off the first 7 characters of the parent_county you'll get the county's FIPS code. For quick debugging, you can pass these geoids into CensusReporter URLs like so: https://censusreporter.org/profiles/<geoid> (e.g. https://censusreporter.org/profiles/05000US72099).

The `percent_cov

@iandees
iandees / README.md
Last active August 22, 2021 21:35
Download and process Bing Buildings into Census tracts.

These are my notes for taking the Microsoft US Building Footprints and splitting them into more manageable chunks based on US Census Tracts.

All of this happened on an m5.xlarge in AWS and used up about ~300GB of EBS over the course of a few hours.

  1. Make a filesystem on the EBS volume and mount it:

    sudo mkfs.xfs /dev/nvme1n1
    mount /dev/nvme1n1 /mnt
    
@iandees
iandees / iam_policy.json
Created April 21, 2018 02:11
Minimum S3 policy required for awscli s3 sync to work.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "s3:ListObjects",
"Resource": "*"
},
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/07_40/07_40_2_2_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/07_41/07_41_1_1_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/07_41/07_41_1_2_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/07_41/07_41_2_1_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/07_41/07_41_2_2_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/07_42/07_42_1_2_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/08_39/08_39_1_2_5m_v2.0.tar
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/08_39/08_39_2_2_5m_v2.0.tar
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/08_40/08_40_1_1_5m_v2.0.tar.gz
http://data.pgc.umn.edu/elev/dem/setsm/ArcticDEM/mosaic/v2.0/08_40/08_40_1_2_5m_v2.0.tar.gz
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import unicodecsv
import argparse
import sys
import simplejson as json
from shapely import wkt
from shapely.geometry import mapping
import shapely.speedups
shapely.speedups.enable()
parser = argparse.ArgumentParser()
Direction Code Expanded Full Text Directional Abbreviation Spanish Translation
11 North N
12 South S
13 East E
14 West W
15 Northeast NE
16 Northwest NW
17 Southeast SE
18 Southwest SW
19 Norte N Y North
@iandees
iandees / ildot_toll_plazas.geojson
Created January 2, 2016 04:40
Illinois Toll Plazas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iandees
iandees / dlib_plus_osm.md
Last active May 30, 2018 19:07
Detecting Road Signs in Mapillary Images with dlib C++

image

I've been interested in computer vision for a long time, but I haven't had any free time to make any progress until this holiday season. Over Christmas and the New Years I experimented with various methodologies in OpenCV to detect road signs and other objects of interest to OpenStreetMap. After some failed experiments with thresholding and feature detection, the excellent /r/computervision suggested using the dlib C++ module because it has more consistently-good documentation and the pre-built tools are faster.

After a day or two figuring out how to compile the examples, I finally made some progress:

Compiling dlib C++ on a Mac with Homebrew

  1. Clone dlib from Github to your local machine: