ags-stream
Stream features from an ArcGIS Server instance
Last updated a year ago by jcsanford .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ags-stream 
SYNC missed versions from official npm registry.

ags-stream

ags-stream creates a readable stream of GeoJSON Features from an ArcGIS Server instance. This can be useful for scraping records from any ArcGIS Server or any other ETL process.

ags-stream is currently used in fulcrum-ags-import to import ArcGIS Server records into Fulcrum and ags-shapefile to export shapefiles from ArcGIS Server instances.

Installation

npm install ags-stream

Usage

var AgsStream = require('ags-stream');
var agsStream = new AgsStream(<service_url>, <options>?)

agsStream.on('data', function (data) {
  // data is an array of GeoJSON features
  data.forEach(function (feature) {
    doWhatever(feature); // Add the feature to you database, write to file, whatever
  });
});

agsStream.on('error', function (error) {
  console.log('Oh boy, this happened: ', error);
});

agsStream.on('end', function () {
  console.log('All done.'); // There is no more data to read.
});

The service_url parameter represents a single layer in an ArcGIS Server map service. It should look something like http://gis-web.co.union.nc.us/arcgis/rest/services/PWGIS_Web/Operational_Layers/MapServer/5.

options is optional and accepts the following:

Option Description Default
chunkSize The number of features to fetch per request to the AGS instance 50
where The where clause for querying the service layer '1=1' (all features)
outSR The srid for the returned geometry 4326 (lat, lng)
qs An object of query strings to append to the url. These will be url encoded automatically. null

Current Tags

  • 2.1.0                                ...           latest (a year ago)

3 Versions

  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |