Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esri-to-geojson

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esri-to-geojson

Convert Esri JSON/CSV to GeoJSON

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54
decreased by-18.18%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

GeoJSON

Converts Esri JSON and CSV to GeoJSON format

Install

EsriToGeojson should be installed as a dependency in a Node.js project like so:

npm install esritogeojson --save

Example: Convert Esri JSON to GeoJSON

const GeoJSON = require('geojson')
const CSV = require('csv')
const input = '"y","x"\n"-180","90"\n"30","-60"'

const options = [{
        name: 'NAME',
        type: 'esriFieldTypeSmallInteger',
        alias: 'NAME',
        domain: {
            type: 'codedValue',
            name: 'NAME',
            codedValues: [
                {
                    name: 'Name0',
                    code: 0
                },
                {
                    name: 'Name1',
                    code: 1
                }
            ]
        }
    }]
    const esriJSON = {
        features: [{
            attributes: {
                NAME: 0
            }
        }, {
            attributes: {
                NAME: 1
            }
        }]
    }

const geojson = GeoJSON.fromEsri(esriJSON, options)

console.log(geojson)

csv.parse(input, (err, output) => {
    const csvGeoJSON = GeoJSON.fromCSV(output)
    console.log(csvGeoJSON)
})

FAQs

Package last updated on 13 Apr 2016

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