New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sane-topojson

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sane-topojson

Ready-to-use multi-layer topojson files

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by10.46%
Maintainers
1
Weekly downloads
 
Created
Source

sane-topojson

Ready-to-use multi-layer topojson files.

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

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:

{
    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]}},
            // ...
        ]
    }
}

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.

Install

npm install sane-topojson

Keywords

FAQs

Package last updated on 18 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc