forked from topojson/world-atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (70 loc) · 2.37 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
TOPOJSON = node_modules/.bin/topojson
TOPOMERGE = node_modules/.bin/topojson-merge
# http://www.naturalearthdata.com/downloads/
NATURAL_EARTH_CDN = http://naciscdn.org/naturalearth
all:
.SECONDARY:
zip/ne_10m_land.zip:
mkdir -p $(dir $@)
curl "$(NATURAL_EARTH_CDN)/10m/physical/ne_10m_land.zip" -o [email protected]
mv [email protected] $@
zip/ne_10m_%.zip:
mkdir -p $(dir $@)
curl "$(NATURAL_EARTH_CDN)/10m/cultural/ne_10m_$*.zip" -o [email protected]
mv [email protected] $@
zip/ne_50m_land.zip:
mkdir -p $(dir $@)
curl "$(NATURAL_EARTH_CDN)/50m/physical/ne_50m_land.zip" -o [email protected]
mv [email protected] $@
zip/ne_50m_%.zip:
mkdir -p $(dir $@)
curl "$(NATURAL_EARTH_CDN)/50m/cultural/ne_50m_$*.zip" -o [email protected]
mv [email protected] $@
zip/ne_110m_land.zip:
mkdir -p $(dir $@)
curl "$(NATURAL_EARTH_CDN)/110m/physical/ne_110m_land.zip" -o [email protected]
mv [email protected] $@
zip/ne_110m_%.zip:
mkdir -p $(dir $@)
curl "$(NATURAL_EARTH_CDN)/110m/cultural/ne_110m_$*.zip" -o [email protected]
mv [email protected] $@
# Admin 0 – land (3.17M)
shp/ne_%_land.shp: zip/ne_%_land.zip
mkdir -p $(dir $@)
unzip -d shp $<
touch $@
# Admin 0 – countries (5.08M)
shp/ne_%_admin_0_countries.shp: zip/ne_%_admin_0_countries.zip
mkdir -p $(dir $@)
unzip -d shp $<
touch $@
# Admin 0 – countries without boundary lakes (5.26M)
shp/ne_%_admin_0_countries_lakes.shp: zip/ne_%_admin_0_countries_lakes.zip
mkdir -p $(dir $@)
unzip -d shp $<
touch $@
# Admin 1 - states, provinces (13.97M)
# - removes the redundant _shp suffix for consistency
shp/ne_%_admin_1_states_provinces.shp: zip/ne_%_admin_1_states_provinces_shp.zip
mkdir -p $(dir $@)
unzip -d shp $<
for file in shp/ne_$*_admin_1_states_provinces_shp.*; do mv $$file shp/ne_$*_admin_1_states_provinces"$${file#*_shp}"; done
touch $@
# Admin 1 - states, provinces without large lakes (14.11M)
# - removes the redundant _shp suffix for consistency
shp/ne_%_admin_1_states_provinces_lakes.shp: zip/ne_%_admin_1_states_provinces_lakes_shp.zip
mkdir -p $(dir $@)
unzip -d shp $<
for file in shp/ne_$*_admin_1_states_provinces_lakes_shp.*; do mv $$file shp/ne_$*_admin_1_states_provinces_lakes"$${file#*_shp}"; done
touch $@
topo/world-%.json: shp/ne_%_admin_0_countries.shp
mkdir -p $(dir $@)
$(TOPOJSON) \
--quantization 1e5 \
--id-property=+iso_n3 \
-- countries=shp/ne_$*_admin_0_countries.shp \
| $(TOPOMERGE) \
-o $@ \
--io=countries \
--oo=land \
--no-key