1.0.5 • Published 1 year ago

@fuzzysaj/nat-earth-geojson-cache v1.0.5

Weekly downloads
10
License
GPL-3.0
Repository
github
Last release
1 year ago

@fuzzysaj/nat-earth-geojson-cache

npm (scoped) Build Status dependencies Status code coverage

This package stores a copy of Admin 1 - States, Provices shapefile, but converted to GeoJSON for easy of use. The data comes from Natural Earth and is distributed as public domain. Source shapefile is version 4.1.0, last updated 2018-05-21.

This module also includes source code for automatically updating the JSON file by downloading the latest shapefile from Natural Earth and converting to GeoJSON via the (shp2json)https://github.com/substack/shp2json package. However, as of April 2020, this package depends on gdal which can only be compiled with Node 10.x. Therefore, we do not include shp2json in package.json and do not compile or test this code at this time.

Install

$ npm install @fuzzysaj/nat-earth-geojson-cache

Usage

import { getAdmin1GeoJson } from '@fuzzysaj/nat-earth-geojson-cache'

(async ()=> {
  const admin1Geo = await getAdmin1GeoJson();
  /* ->
  {
    type: 'FeatureCollection',
    features: [
      {
        type: 'Feature',
        geometry: {
          type: 'Polygon',
          coordinates: [ [ [ 47.668128703000029, 28.533504944000022 ],
                         [ 47.659808797000032, 28.560040792000031 ],
                         ...
                        ] ]
        },
        properties: { name: 'Arizona', iso_a2 : 'US', postal: 'AZ', ... }
      }, ...
    ]
  }
  */
})();
1.0.5

1 year ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago