-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
37 lines (32 loc) · 1018 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
build/gz_2010_us_050_00_20m.zip:
mkdir -p $(dir $@)
curl -o $@ http://www2.census.gov/geo/tiger/GENZ2010/$(notdir $@)
build/gz_2010_us_050_00_20m.shp: build/gz_2010_us_050_00_20m.zip
unzip -od $(dir $@) $<
touch $@
build/counties.json: build/gz_2010_us_050_00_20m.shp ACS_12_5YR_B01003_with_ann.csv
node_modules/.bin/topojson \
-o $@ \
--id-property='STATE+COUNTY,Id2' \
--external-properties=ACS_12_5YR_B01003_with_ann.csv \
--properties='name=Geography' \
--properties='population=+d.properties["Estimate; Total"]' \
--projection='width = 960, height = 600, d3.geo.albersUsa() \
.scale(1280) \
.translate([width / 2, height / 2])' \
--simplify=.5 \
--filter=none \
-- counties=$<
build/states.json: build/counties.json
node_modules/.bin/topojson-merge \
-o $@ \
--in-object=counties \
--out-object=states \
--key='d.id.substring(0, 2)' \
-- $<
us.json: build/states.json
node_modules/.bin/topojson-merge \
-o $@ \
--in-object=states \
--out-object=nation \
-- $<