arcgis-x
Node.js library for converting ArcGIS REST Service data to GeoJSON or CSV-KML (Google Earth, Google Fusion Tables)
Installation
NPM:
$ npm install --save arcgis-x
Example Usage
Import
import arcgisX from "arcgis-x";
let sample = {
spatialReference: {
wkid: 4326
},
features: [
{
attributes: {
borough: "Brooklyn"
},
geometry: {
rings: [
[
[-73.9760507905698, 40.6312841471042],
[-73.9770549623761, 40.6215407613162],
[-73.9751732026353, 40.6147324241179],
[-74.0055663474715, 40.6330914171937],
[-73.985096633962, 40.6425812992004],
[-73.9760507905698, 40.6312841471042]
]
]
}
}
]
};
toGeoJson()
let geojson = arcgisX.toGeoJson(sample);
toKml()
let kml = arcgisX.toKml(
sample,
{
stroke: "#666666",
"stroke-width": 2,
fill: "#ff0000",
"fill-opacity": 0.5
},
{ simplestyle: true }
);
toCsvKml()
let csvKml = arcgisX.toCsvKml(sample);
Roadmap (Tentative)
- Directly upload CSV-KML output to Google Fusion Table.
- Read input from files. Write output to files.
License
MIT