Makefile modeled after the U.S. Atlas project.
-
-
Save dholstius/db17b68902437d0e3279 to your computer and use it in GitHub Desktop.
California census tracts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
build | |
node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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,$^) |
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