forked from topojson/world-atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (62 loc) · 2.47 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
TOPOJSON = node_modules/.bin/topojson
TOPOMERGE = node_modules/.bin/topojson-merge
all:
.SECONDARY:
zip/ne_10m_land.zip:
mkdir -p $(dir $@)
curl "http://www.nacis.org/naturalearth/10m/physical/ne_10m_land.zip" -o [email protected]
mv [email protected] $@
zip/ne_10m_%.zip:
mkdir -p $(dir $@)
curl "http://www.nacis.org/naturalearth/10m/cultural/ne_10m_$*.zip" -o [email protected]
mv [email protected] $@
zip/ne_50m_land.zip:
mkdir -p $(dir $@)
curl "http://www.nacis.org/naturalearth/50m/physical/ne_50m_land.zip" -o [email protected]
mv [email protected] $@
zip/ne_50m_%.zip:
mkdir -p $(dir $@)
curl "http://www.nacis.org/naturalearth/50m/cultural/ne_50m_$*.zip" -o [email protected]
mv [email protected] $@
zip/ne_110m_land.zip:
mkdir -p $(dir $@)
curl "http://www.nacis.org/naturalearth/110m/physical/ne_110m_land.zip" -o [email protected]
mv [email protected] $@
zip/ne_110m_%.zip:
mkdir -p $(dir $@)
curl "http://www.nacis.org/naturalearth/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_%_land.shp shp/ne_%_admin_0_countries.shp
mkdir -p $(dir $@)
$(TOPOJSON) -o [email protected] -q 1e4 --id-property=iso_a2,ISO3136 --properties=centroidLat=+LAT,centroidLng=+LONG -e country_centroids_all.tsv --no-stitch-poles -- land=shp/ne_$*_land.shp countries=shp/ne_$*_admin_0_countries.shp
$(TOPOMERGE) -o $@ --io=land --oo=land --no-key -- [email protected]
rm -f -- [email protected]