sane-topojson

WebJar for sane-topojson

License

License

MIT
Categories

Categories

JSON Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

sane-topojson
Last Version

Last Version

4.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

sane-topojson
WebJar for sane-topojson
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/etpinard/sane-topojson

Download sane-topojson

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/sane-topojson/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>sane-topojson</artifactId>
    <version>4.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/sane-topojson/
implementation 'org.webjars.npm:sane-topojson:4.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/sane-topojson/
implementation ("org.webjars.npm:sane-topojson:4.0.0")
'org.webjars.npm:sane-topojson:jar:4.0.0'
<dependency org="org.webjars.npm" name="sane-topojson" rev="4.0.0">
  <artifact name="sane-topojson" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='sane-topojson', version='4.0.0')
)
libraryDependencies += "org.webjars.npm" % "sane-topojson" % "4.0.0"
[org.webjars.npm/sane-topojson "4.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

sane-topojson

npm version

Build Status Dependency Status devDependency Status

Ready-to-use multi-layer topojson files.

--> Go to Natural Earth CHANGELOG

This project encompasses the three step required to turn Natural Earth Data into topojson files.

These are:

  • npm run wget: download to Natural Earth shapefiles and unzips them
  • npm run shp2geo: clip and convert shapefiles into geojson files
  • npm run geo2topo add properties and convert the geojson files into topojson files

Usage

npm install sane-topojson

and import/require the index.js or the one of the dist/ files.

Layers

A topojson with the objects field:

{
    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], gu: 'ISO-3'}},
            // ...
        ]
    }
}

where id is the ISO-3 code for the countries layer and two-letter postal code for the subunits layer. In properties, ct is the longitude and latitude coordinates (in degrees East and degrees North respectively) of the centroid of the geometry's largest polygon in area and gu stands for the "governing unit" for subunits features (i.e. the country where the subunit is).

Development dependencies

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

Credits

2019 Étienne Tétreault-Pinard. MIT License

JavaScript Style Guide

Versions

Version
4.0.0
3.0.1
2.0.0
1.2.3