Skip to content

Instantly share code, notes, and snippets.

@cmaes
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmaes/8a34bf9a9c6138e50083 to your computer and use it in GitHub Desktop.
Save cmaes/8a34bf9a9c6138e50083 to your computer and use it in GitHub Desktop.
capecod

This is an attempt to make a population map of Cape Cod

GENERATED_FILES = \
capecod.json
all: $(GENERATED_FILES)
.PHONY: clean all
clean:
rm -rf -- $(GENERATED_FILES) build
build/tracts.zip:
mkdir build
curl -o $@ 'http://wsgw.mass.gov/data/gispub/shape/census2010/CENSUS2010_BLK_BG_TRCT_SHP.zip'
build/tracts-unfiltered.shp: build/tracts.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 $@
build/tracts.shp: build/CENSUS2010BLOCKGROUPS_POLY.shp
ogr2ogr -f "ESRI Shapefile" -where "COUNTYFP10 = '001'" -t_srs EPSG:4269 $@ $<
capecod.json: build/tracts.shp
ogr2ogr -f GeoJSON $@ $<
# node_modules/.bin/topojson \
# -o $@ \
# -p population=+POP100_RE \
# --id-property=TRACTCE10 \
# --force-clockwise \
# --simplify=1e-9 \
# -- $(filter %.shp, $^)
# ny.json: build/tracts.shp
# node_modules/.bin/topojson \
# -o $@ \
# -e ACS_12_5YR_B01003_with_ann.csv \
# --id-property=GEO.id2,GEOID \
# -p population=+HD01_VD01,area=+ALAND \
# --projection 'width = 960, height = 700, d3.geo.mercator() \
# .center([-75.819, 42.795]) \
# .scale(6.5 * width) \
# .translate([width / 2, height / 2])' \
# --simplify=.5 \
# -- $(filter %.shp,$^)
Display the source blob
Display the rendered blob
Raw
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