Skip to content

Instantly share code, notes, and snippets.

@dholstius
Forked from mbostock/.block
Last active Aug 29, 2015
Embed
What would you like to do?
California census tracts
.DS_Store
build
node_modules
GENERATED_FILES = \
ca.json
all: $(GENERATED_FILES)
.PHONY: clean all
clean:
rm -rf -- $(GENERATED_FILES) build
build/tl_2012_%_tract.zip:
mkdir build
curl -o $@ 'http://www2.census.gov/geo/tiger/TIGER2012/TRACT/$(notdir $@)'
build/tracts.shp: build/tl_2012_06_tract.zip
rm -rf $(basename $@)
mkdir -p $(basename $@)
unzip -d $(basename $@) $<
for file in $(basename $@)/*; do chmod 644 $$file; mv $$file $(basename $@).$${file##*.}; done
rmdir $(basename $@)
touch $@
ca.json: build/tracts.shp
node_modules/.bin/topojson -o $@ --q0=0 --simplify=1 --projection='d3.geo.mercator().center([-122.4183, 37.7750]).scale(2700).translate([300, 300]).precision(0)' --id-property=TRACTCE -- $(filter %.shp,$^)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment