sane-topojson
Advanced tools
Comparing version 1.2.0 to 1.2.2
102
config.json
@@ -6,53 +6,2 @@ { | ||
], | ||
"vectors": [ | ||
{ | ||
"type": "physical", | ||
"src": "coastline", | ||
"name": "coastlines", | ||
"ids": false, | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "land", | ||
"name": "land", | ||
"ids": false, | ||
"scopeWith": "src" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "ocean", | ||
"name": "ocean", | ||
"ids": false, | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "lakes", | ||
"name": "lakes", | ||
"ids": false, | ||
"scopeWith": "src" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "rivers_lake_centerlines", | ||
"name": "rivers", | ||
"ids": false, | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "cultural", | ||
"src": "admin_0_countries", | ||
"name": "countries", | ||
"ids": "iso_a3", | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "cultural", | ||
"src": "admin_1_states_provinces", | ||
"name": "subunits", | ||
"ids": "postal", | ||
"scopeWith": "src" | ||
} | ||
], | ||
"scopes": [ | ||
@@ -117,3 +66,54 @@ { | ||
} | ||
], | ||
"vectors": [ | ||
{ | ||
"type": "physical", | ||
"src": "coastline", | ||
"name": "coastlines", | ||
"ids": false, | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "land", | ||
"name": "land", | ||
"ids": false, | ||
"scopeWith": "src" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "ocean", | ||
"name": "ocean", | ||
"ids": false, | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "lakes", | ||
"name": "lakes", | ||
"ids": false, | ||
"scopeWith": "src" | ||
}, | ||
{ | ||
"type": "physical", | ||
"src": "rivers_lake_centerlines", | ||
"name": "rivers", | ||
"ids": false, | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "cultural", | ||
"src": "admin_0_countries", | ||
"name": "countries", | ||
"ids": "iso_a3", | ||
"scopeWith": "bounds" | ||
}, | ||
{ | ||
"type": "cultural", | ||
"src": "admin_1_states_provinces", | ||
"name": "subunits", | ||
"ids": "postal", | ||
"scopeWith": "src" | ||
} | ||
] | ||
} |
{ | ||
"name": "sane-topojson", | ||
"version": "1.2.0", | ||
"version": "1.2.2", | ||
"description": "Ready-to-use multi-layer topojson files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# sane-topojson | ||
Ready-to-use multi-layer topojson files | ||
Ready-to-use multi-layer topojson files. | ||
This repo encompasses the three step require to turn | ||
[Natural Earth Data](http://www.naturalearthdata.com/) into topojson files. | ||
These are: | ||
- `npm run wget`: download to Natural Earth shapefiles and unzips them | ||
- `npm run shp2geo`: clips and convert shapefiles into geojson files | ||
- `npm run geo2topo` add properties and convert the geojson files into topojson | ||
files | ||
### Configuration | ||
In `./config.json`: | ||
- `resolutions`: array of resolutions to output | ||
- `scopes`: array of scopes to output | ||
sane-topojson will output `resolution.length` times `scopes.length` topojson | ||
files. | ||
- `vectors`: array of layers making up each topojson file | ||
### Output | ||
A topojson with the `objects` field: | ||
```js | ||
{ | ||
coastlines: { | ||
type: '', | ||
geometries: [] | ||
}, | ||
countries: { | ||
type: '', | ||
geometries: [ | ||
{type: '', id: '', arcs: [], properties: {ct: [lon, lat]}}, | ||
// ... | ||
] | ||
}, | ||
lakes: { | ||
type: '', | ||
geometries: [] | ||
}, | ||
land: { | ||
type: '', | ||
geometries: [] | ||
}, | ||
ocean: { | ||
type: '', | ||
geometries: [] | ||
} | ||
rivers: { | ||
type: '', | ||
geometries: [] | ||
} | ||
subunits: { | ||
type: '', | ||
geometries: [ | ||
{type: '', id: '', arcs: [], properties: {ct: [lon, lat]}}, | ||
// ... | ||
] | ||
} | ||
} | ||
``` | ||
### Install | ||
``` | ||
npm install sane-topojson | ||
``` |
4134226
75