Skip to content

A Node module to assist with pulling data out of an ESRI ArcGIS REST server into GeoJSON.

License

Notifications You must be signed in to change notification settings

openaddresses/esri-dump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 5, 2024
3908f5a · Aug 5, 2024
Apr 18, 2024
Aug 5, 2024
Apr 18, 2024
Mar 20, 2023
Apr 19, 2023
Mar 17, 2023
Aug 5, 2024
Mar 19, 2014
Sep 6, 2023
Oct 11, 2023
Apr 18, 2024
Nov 8, 2023
Aug 5, 2024
Aug 5, 2024
Apr 18, 2024
Jul 20, 2023

Repository files navigation

esri-dump

A Node module to assist with pulling data out of an ESRI ArcGIS REST server into GeoJSON or ImageryURLs

Based On PyEsriDump by @iandees

Install

npm install -g esri-dump

API

exposes a function, which if you give it a url, will return a stream of the geojson features.

import EsriDump from 'esri-dump';
const esri = new EsriDump(url);

const  featureCollection = {
  type: 'FeatureCollection',
  features: []
}

esri.fetch();

esri.on('type', (type) => {
    //Emitted before any data events
    //emits one of
    // - `MapServer'
    // - `FeatureServer'
});

esri.on('feature', (feature) => {
    featureCollection.features.push(feature);
});

esri.on('done', () => {
    doSomething(null, featureCollection)
});

esri.on('error', (err) => {
    doSomething(err);
});

Command Line

Streams a geojson feature collection to stdout

esri-dump fetch http://services2.bhamaps.com/arcgis/rest/services/AGS_jackson_co_il_taxmap/MapServer/0 > output.geojson

Data Output

FeatureServer and MapServer

Output from an ESRI FeatureServer or an ESRI MapServer is returned as GeoJSON as in the example below.

{
    "type": "Feature",
    "properties": {
        "objectid": 1
    },
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    -65.6231319,
                    31.7127058
                ],
                [
                    -65.6144566,
                    31.7020286
                ],
                [
                    -65.6231319,
                    31.698692
                ],
                [
                    -65.6231319,
                    31.7127058
                ]
            ]
        ]
    }
}

Development

esri-dump is written in TypeScript. To compile it locally, run:

npx tsc

See /dist for the compiled code.

About

A Node module to assist with pulling data out of an ESRI ArcGIS REST server into GeoJSON.

Resources

License

Stars

Watchers

Forks

Packages

No packages published