├── .npmignore ├── img ├── land.png └── countries.png ├── .gitignore ├── LICENSE ├── package.json ├── prepublish ├── README.md └── yarn.lock /.npmignore: -------------------------------------------------------------------------------- 1 | *.sublime-* 2 | build/ 3 | test/ 4 | -------------------------------------------------------------------------------- /img/land.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/topojson/world-atlas/HEAD/img/land.png -------------------------------------------------------------------------------- /img/countries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/topojson/world-atlas/HEAD/img/countries.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sublime-workspace 2 | .DS_Store 3 | build/ 4 | node_modules 5 | npm-debug.log 6 | *-10m.json 7 | *-50m.json 8 | *-110m.json 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013-2019 Michael Bostock 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose 4 | with or without fee is hereby granted, provided that the above copyright notice 5 | and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13 | THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world-atlas", 3 | "version": "2.0.2", 4 | "description": "Pre-built TopoJSON from Natural Earth.", 5 | "license": "ISC", 6 | "keywords": [ 7 | "topojson", 8 | "geojson", 9 | "shapefile" 10 | ], 11 | "author": { 12 | "name": "Mike Bostock", 13 | "url": "https://bost.ocks.org/mike" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/topojson/world-atlas.git" 18 | }, 19 | "files": [ 20 | "*-10m.json", 21 | "*-50m.json", 22 | "*-110m.json" 23 | ], 24 | "scripts": { 25 | "prepublishOnly": "bash prepublish", 26 | "postpublish": "git push && git push --tags" 27 | }, 28 | "devDependencies": { 29 | "d3-geo-projection": "^2.0.1", 30 | "ndjson-cli": "^0.3.0", 31 | "shapefile": "^0.6.1", 32 | "topojson-client": "^3.0.0", 33 | "topojson-server": "^3.0.0", 34 | "topojson-simplify": "^3.0.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /prepublish: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rvf *-10m.json *-50m.json *-110m.json 4 | mkdir -p build 5 | 6 | countries_shp() { 7 | if [ ! -f build/ne_$1_admin_0_countries.shp ]; then 8 | curl -o build/ne_$1_admin_0_countries.zip https://naciscdn.org/naturalearth/$1/cultural/ne_$1_admin_0_countries.zip 9 | unzip -od build build/ne_$1_admin_0_countries.zip 10 | chmod a-x build/ne_$1_admin_0_countries.* 11 | fi 12 | } 13 | 14 | land_shp() { 15 | if [ ! -f build/ne_$1_land.shp ]; then 16 | curl -o build/ne_$1_land.zip https://naciscdn.org/naturalearth/$1/physical/ne_$1_land.zip 17 | unzip -od build build/ne_$1_land.zip 18 | chmod a-x build/ne_$1_land.* 19 | fi 20 | } 21 | 22 | countries() { 23 | countries_shp $1 24 | geo2topo -q 1e5 -n countries=<( \ 25 | shp2json --encoding utf8 -n build/ne_$1_admin_0_countries.shp \ 26 | | ndjson-map 'i = d.properties.ISO_N3, d.id = i === "-99" ? (d.properties.SOV_A3 === "NOR" ? "578" : undefined) : i, d.properties = {name: d.properties.NAME}, d' \ 27 | | geostitch -n) \ 28 | | topomerge land=countries \ 29 | > countries-$1.json 30 | } 31 | 32 | land() { 33 | land_shp $1 34 | geo2topo -q 1e5 -n land=<( \ 35 | shp2json --encoding utf8 -n build/ne_$1_land.shp \ 36 | | ndjson-map 'delete d.properties, d' \ 37 | | geostitch -n) \ 38 | | topomerge land=land \ 39 | > land-$1.json 40 | } 41 | 42 | countries 10m 43 | countries 50m 44 | countries 110m 45 | 46 | land 10m 47 | land 50m 48 | land 110m 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # World Atlas TopoJSON 2 | 3 | This repository provides a convenient redistribution of [Natural Earth](http://www.naturalearthdata.com/)’s [vector data](http://www.naturalearthdata.com/downloads/), version 4.1.0 as TopoJSON. For earlier editions, see [past releases](https://github.com/topojson/world-atlas). 4 | 5 | ### Usage 6 | 7 | In a browser, using [d3-geo](https://github.com/d3/d3-geo) and Canvas:
8 | https://observablehq.com/@d3/world-map 9 | 10 | In a browser, using [d3-geo](https://github.com/d3/d3-geo) and SVG:
11 | https://observablehq.com/@d3/world-map-svg 12 | 13 | In Node, using [d3-geo](https://github.com/d3/d3-geo) and [node-canvas](https://github.com/Automattic/node-canvas):
14 | https://bl.ocks.org/mbostock/885fffe88d72b2a25c090e0bbbef382f 15 | 16 | ## File Reference 17 | 18 | # countries-110m.json · [Download](https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json "Source") 19 | 20 | A [TopoJSON file](https://github.com/topojson/topojson-specification/blob/master/README.md#21-topology-objects) containing the geometry collections countries and land. The geometry is quantized, but not projected; it is in spherical coordinates, decimal degrees. This topology is derived from the Natural Earth’s [Admin 0 country boundaries](http://www.naturalearthdata.com/downloads/110m-cultural-vectors/), 1:110m small scale. The land boundary is computed by [merging](https://github.com/topojson/topojson-client/blob/master/README.md#merge) countries, ensuring a consistent topology. 21 | 22 | # countries-50m.json · [Download](https://cdn.jsdelivr.net/npm/world-atlas@2/countries-50m.json "Source") 23 | 24 | A [TopoJSON file](https://github.com/topojson/topojson-specification/blob/master/README.md#21-topology-objects) containing the geometry collections countries and land. The geometry is quantized, but not projected; it is in spherical coordinates, decimal degrees. This topology is derived from the Natural Earth’s [Admin 0 country boundaries](http://www.naturalearthdata.com/downloads/50m-cultural-vectors/), 1:50m medium scale. The land boundary is computed by [merging](https://github.com/topojson/topojson-client/blob/master/README.md#merge) countries, ensuring a consistent topology. 25 | 26 | # countries-10m.json · [Download](https://cdn.jsdelivr.net/npm/world-atlas@2/countries-10m.json "Source") 27 | 28 | A [TopoJSON file](https://github.com/topojson/topojson-specification/blob/master/README.md#21-topology-objects) containing the geometry collections countries and land. The geometry is quantized, but not projected; it is in spherical coordinates, decimal degrees. This topology is derived from the Natural Earth’s [Admin 0 country boundaries](http://www.naturalearthdata.com/downloads/10m-cultural-vectors/), 1:10m large scale. The land boundary is computed by [merging](https://github.com/topojson/topojson-client/blob/master/README.md#merge) countries, ensuring a consistent topology. 29 | 30 | # land-110m.json · [Download](https://cdn.jsdelivr.net/npm/world-atlas@2/land-110m.json "Source") 31 | 32 | A [TopoJSON file](https://github.com/topojson/topojson-specification/blob/master/README.md#21-topology-objects) containing the geometry collection land. The geometry is quantized, but not projected; it is in spherical coordinates, decimal degrees. This topology is derived from the Natural Earth’s [land boundaries](http://www.naturalearthdata.com/downloads/110m-physical-vectors/), 1:110m small scale. 33 | 34 | # land-50m.json · [Download](https://cdn.jsdelivr.net/npm/world-atlas@2/land-50m.json "Source") 35 | 36 | A [TopoJSON file](https://github.com/topojson/topojson-specification/blob/master/README.md#21-topology-objects) containing the geometry collection land. The geometry is quantized, but not projected; it is in spherical coordinates, decimal degrees. This topology is derived from the Natural Earth’s [land boundaries](http://www.naturalearthdata.com/downloads/50m-physical-vectors/), 1:50m medium scale. 37 | 38 | # land-10m.json · [Download](https://cdn.jsdelivr.net/npm/world-atlas@2/land-10m.json "Source") 39 | 40 | A [TopoJSON file](https://github.com/topojson/topojson-specification/blob/master/README.md#21-topology-objects) containing the geometry collection land. The geometry is quantized, but not projected; it is in spherical coordinates, decimal degrees. This topology is derived from the Natural Earth’s [land boundaries](http://www.naturalearthdata.com/downloads/10m-physical-vectors/), 1:10m large scale. 41 | 42 | # *world*.objects.countries 43 | 44 | 45 | 46 | Each country has two fields: 47 | 48 | * *country*.id - the three-digit [ISO 3166-1 numeric country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric), such as `"528"` 49 | * *country*.properties.name - the country name, such as `"Netherlands"` 50 | 51 | # *world*.objects.land 52 | 53 | 54 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | acorn@^5.1.1: 6 | version "5.7.3" 7 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" 8 | integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== 9 | 10 | array-source@0.0: 11 | version "0.0.4" 12 | resolved "https://registry.yarnpkg.com/array-source/-/array-source-0.0.4.tgz#a525df4a84b1376d27c677cd426a97c3882f8aca" 13 | integrity sha512-frNdc+zBn80vipY+GdcJkLEbMWj3xmzArYApmUGxoiV8uAu/ygcs9icPdsGdA26h0MkHUMW6EN2piIvVx+M5Mw== 14 | 15 | commander@2, commander@^2.11.0: 16 | version "2.20.0" 17 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" 18 | integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== 19 | 20 | d3-array@1: 21 | version "1.2.4" 22 | resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f" 23 | integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw== 24 | 25 | d3-geo-projection@^2.0.1: 26 | version "2.7.0" 27 | resolved "https://registry.yarnpkg.com/d3-geo-projection/-/d3-geo-projection-2.7.0.tgz#a881871004a892f51424ca649b09977b1dbd5ee6" 28 | integrity sha512-G8C/8gvUQVwuLloW88d/NGbyh5CLONowQzU6gB7cczfGbSjMrQHFbaCqipWUqUWaBdqpyfTlLE3GPGy0RMpKYw== 29 | dependencies: 30 | commander "2" 31 | d3-array "1" 32 | d3-geo "^1.10.0" 33 | resolve "^1.1.10" 34 | 35 | d3-geo@^1.10.0: 36 | version "1.11.6" 37 | resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-1.11.6.tgz#134f2ef035ff75a448075fafdea92702a2e0e0cf" 38 | integrity sha512-z0J8InXR9e9wcgNtmVnPTj0TU8nhYT6lD/ak9may2PdKqXIeHUr8UbFLoCtrPYNsjv6YaLvSDQVl578k6nm7GA== 39 | dependencies: 40 | d3-array "1" 41 | 42 | file-source@0.6: 43 | version "0.6.1" 44 | resolved "https://registry.yarnpkg.com/file-source/-/file-source-0.6.1.tgz#ae189d4993766b865a77f83adcf9b9a504cd37dc" 45 | integrity sha1-rhidSZN2a4Zad/g63Pm5pQTNN9w= 46 | dependencies: 47 | stream-source "0.3" 48 | 49 | ndjson-cli@^0.3.0: 50 | version "0.3.1" 51 | resolved "https://registry.yarnpkg.com/ndjson-cli/-/ndjson-cli-0.3.1.tgz#aa98e1a1cc98e524ca37a7bdc03a2ae26f88e140" 52 | integrity sha512-WMt3oFipPwmVvuFY2IwSNx+IeeRxZkc3OZEKTugk/FTmBRWcapH9PjtxU3Wap4CPcZ94a3nCnjEX8Ny/SrlZtA== 53 | dependencies: 54 | acorn "^5.1.1" 55 | commander "^2.11.0" 56 | resolve "^1.3.3" 57 | 58 | path-parse@^1.0.6: 59 | version "1.0.6" 60 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" 61 | integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== 62 | 63 | path-source@0.1: 64 | version "0.1.3" 65 | resolved "https://registry.yarnpkg.com/path-source/-/path-source-0.1.3.tgz#03907c595480aa2596a15a901c44f745736e7a73" 66 | integrity sha512-dWRHm5mIw5kw0cs3QZLNmpUWty48f5+5v9nWD2dw3Y0Hf+s01Ag8iJEWV0Sm0kocE8kK27DrIowha03e1YR+Qw== 67 | dependencies: 68 | array-source "0.0" 69 | file-source "0.6" 70 | 71 | resolve@^1.1.10, resolve@^1.3.3: 72 | version "1.12.0" 73 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" 74 | integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== 75 | dependencies: 76 | path-parse "^1.0.6" 77 | 78 | shapefile@^0.6.1: 79 | version "0.6.6" 80 | resolved "https://registry.yarnpkg.com/shapefile/-/shapefile-0.6.6.tgz#6fee152b9fb2b1c85f690285b692fb68c95a5f4f" 81 | integrity sha512-rLGSWeK2ufzCVx05wYd+xrWnOOdSV7xNUW5/XFgx3Bc02hBkpMlrd2F1dDII7/jhWzv0MSyBFh5uJIy9hLdfuw== 82 | dependencies: 83 | array-source "0.0" 84 | commander "2" 85 | path-source "0.1" 86 | slice-source "0.4" 87 | stream-source "0.3" 88 | text-encoding "^0.6.4" 89 | 90 | slice-source@0.4: 91 | version "0.4.1" 92 | resolved "https://registry.yarnpkg.com/slice-source/-/slice-source-0.4.1.tgz#40a57ac03c6668b5da200e05378e000bf2a61d79" 93 | integrity sha1-QKV6wDxmaLXaIA4FN44AC/KmHXk= 94 | 95 | stream-source@0.3: 96 | version "0.3.5" 97 | resolved "https://registry.yarnpkg.com/stream-source/-/stream-source-0.3.5.tgz#b97f52d0f8ea566db071db679b985403a31e0340" 98 | integrity sha512-ZuEDP9sgjiAwUVoDModftG0JtYiLUV8K4ljYD1VyUMRWtbVf92474o4kuuul43iZ8t/hRuiDAx1dIJSvirrK/g== 99 | 100 | text-encoding@^0.6.4: 101 | version "0.6.4" 102 | resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" 103 | integrity sha1-45mpgiV6J22uQou5KEXLcb3CbRk= 104 | 105 | topojson-client@3, topojson-client@^3.0.0: 106 | version "3.0.1" 107 | resolved "https://registry.yarnpkg.com/topojson-client/-/topojson-client-3.0.1.tgz#774c0343b44fc4ec29c3a2274d7a1a9c3b213cd9" 108 | integrity sha512-rfGGzyqefpxOaxvV9OTF9t+1g+WhjGEbAIuCcmKYrQkxr0nttjMMyzZsK+NhLW4cTl2g1bz2jQczPUtEshpbVQ== 109 | dependencies: 110 | commander "2" 111 | 112 | topojson-server@^3.0.0: 113 | version "3.0.1" 114 | resolved "https://registry.yarnpkg.com/topojson-server/-/topojson-server-3.0.1.tgz#d2b3ec095b6732299be76a48406111b3201a34f5" 115 | integrity sha512-/VS9j/ffKr2XAOjlZ9CgyyeLmgJ9dMwq6Y0YEON8O7p/tGGk+dCWnrE03zEdu7i4L7YsFZLEPZPzCvcB7lEEXw== 116 | dependencies: 117 | commander "2" 118 | 119 | topojson-simplify@^3.0.0: 120 | version "3.0.3" 121 | resolved "https://registry.yarnpkg.com/topojson-simplify/-/topojson-simplify-3.0.3.tgz#668de0ca7ab36797002087190c2222f938af2ab2" 122 | integrity sha512-V+pBjLVzSQ3+hSOxBiV01OVXgFiCmMO8ia3huxKEyIMTC1ApQHBcdXdOqcQ6U2JJJD31TZduwY6KyF15R8sUgg== 123 | dependencies: 124 | commander "2" 125 | topojson-client "3" 126 | --------------------------------------------------------------------------------