-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# http://www.naturalearthdata.com/downloads/ | ||
# SCALES: 10m 50m 110m | ||
BIN = ../node_modules/.bin | ||
NATURAL_EARTH_CDN = http://naciscdn.org/naturalearth | ||
|
||
all: topo/world-110m.json csv/world-countries.csv | ||
|
||
.SECONDARY: | ||
|
||
gz/ne_10m_%.zip: | ||
mkdir -p $(dir $@) | ||
curl "$(NATURAL_EARTH_CDN)/10m/cultural/ne_10m_$*.zip" -o $@.download | ||
mv $@.download $@ | ||
|
||
gz/ne_50m_%.zip: | ||
mkdir -p $(dir $@) | ||
curl "$(NATURAL_EARTH_CDN)/50m/cultural/ne_50m_$*.zip" -o $@.download | ||
mv $@.download $@ | ||
|
||
gz/ne_110m_%.zip: | ||
mkdir -p $(dir $@) | ||
curl "$(NATURAL_EARTH_CDN)/110m/cultural/ne_110m_$*.zip" -o $@.download | ||
mv $@.download $@ | ||
|
||
# Admin 0 – countries (5.08M) | ||
shp/ne_%_admin_0_countries.shp: gz/ne_%_admin_0_countries.zip | ||
mkdir -p $(dir $@) | ||
unzip -d shp $< | ||
touch $@ | ||
|
||
# created w/ basic props, countries & land collection | ||
topo/world-%.json: shp/ne_%_admin_0_countries.shp | ||
mkdir -p $(dir $@) | ||
$(BIN)/topojson \ | ||
--quantization 1e5 \ | ||
--properties name,type,abbrev,postal,pop_est,continent \ | ||
--id-property=+iso_n3 \ | ||
-- countries=shp/ne_$*_admin_0_countries.shp \ | ||
| $(BIN)/topojson-merge \ | ||
-o $@ \ | ||
--io=countries \ | ||
--oo=land \ | ||
--no-key | ||
|
||
csv/world-countries.csv: shp/ne_110m_admin_0_countries.shp | ||
mkdir -p $(dir $@) | ||
rm -f $@ | ||
ogr2ogr -f 'CSV' -progress $@ $< | ||
|
||
clean-all: clean/shp clean/topo clean/csv | ||
|
||
clean/%: | ||
rm -rf $(notdir $@) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# World-Countries | ||
|
||
Builds Shape, TopoJson & CSV files for all countries. | ||
|
||
Data files are built from [Small](http://www.naturalearthdata.com/downloads/10m-cultural-vectors/), [Medium](http://www.naturalearthdata.com/downloads/50m-cultural-vectors/) & [Large](http://www.naturalearthdata.com/downloads/110m-cultural-vectors/) scale Cultural vectors from [Natural Earth](http://naturalearthdata.com/) | ||
|
||
|
||
### Medium scale (1:50m) | ||
`$ make topo/world-50m.json` | ||
![50m-world](https://cloud.githubusercontent.com/assets/425966/18637913/12d2d6d6-7e5c-11e6-93a3-7f3d392c836f.png) | ||
|
||
### Zoomed, showing data | ||
![50m-world-zoomed](https://cloud.githubusercontent.com/assets/425966/18637669/2d8d6abe-7e5b-11e6-98c2-ab357fd405ef.png) |