A library for parsing the arcgis pbf format into geojson
npm install arcgis-pbf-parserFeatureCollection.By itself it doesn't do much but you can find a more complex example of it's usage is in my mapbox-gl-arcgis-featureserver library.


const arcgisPbfDecode = require('arcgis-pbf-parser')
// or in ES6
import arcgisPbfDecode from' arcgis-pbf-parser'fetch('Some/FeatureServer/0/query?f=pbf&...')
.then(response => response.arrayBuffer())
.then(data => {
const featureCollection = arcgisPbfDecode(new Uint8Array(data)).featureCollection
})
``The decode method returns an object containing the
featureCollection object, and a boolean specifying if there were too many features and so you need to paginate for more features with the same request.
``
{
featureCollection: {
...
},
exceededTransferLimit: true/false
}
``
Status
This was cobbled together fairly quickly based on the minimal documentation available.$3
- Polgon
- Inc MultiPolygon
- Inc Polygon with holes
- LineString
- Inc MultiLineString
- Point
- Attributes
- Features with null geometries$3
- MultiPoint (a sample service would be helpful)
- Improve tests
Acknowledgements
- I used the proto spec file supplied by Esri here
- I used the mapbox pbf library to compile the src/parser/PbfFeatureCollection.js module for parsing rather than the one supplied by Esri
- This results in a slimmer & faster package and the pbf` dependency will be shared/tree-shaken with mapbox-gl.