3

Anyone able to convert ESRI PBF into anything "human readable"? For example GeoJSON?

The ArcGIS dev doc is not very concrete here:

The PBF format is binary and is thus smaller and faster for clients to parse than JSON. It is used by newer versions of some Esri APIs and applications to improve efficiency. The PBF format is supported by some feature service operations in ArcGIS Enterprise 10.7 as well as hosted feature layers in ArcGIS Online.

From the esri Community discussion it seems the format is based on MapBox specification but nothing concrete here. Just a promise they'll work on documenting (since late 2019).

This is an example file: https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/NYC_Footprints_fgdb/FeatureServer/0/query?f=pbf...

Tried various tools but without success.


EDIT: sure there is an option to use f=geojson, f=json or f=pjson but the question is about dealing with pbf format, not the ArcGIS query.

4

2 Answers 2

3

For example, arcgis REST api, you can use http URL like

          '...?f=pbf' 

instead of

          '...?f=json', 

you will get a single piece of response from .xhr,

you can use mapbox pbf to unzip pbf back to json.

Here is a tool to convert ESRI pbf format into json

https://github.com/rowanwins/arcgis-pbf-parser

Here is ESRI pbf format

https://github.com/Esri/arcgis-pbf/tree/main/proto/FeatureCollection

Here is a library for retrieving features from an ArcGIS FeatureServer or MapServer. This library makes tiled requests rather than simply requesting every feature.

https://github.com/rowanwins/mapbox-gl-arcgis-featureserver

2

As noted in the comments f=geojson +(1=1)

https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYC_Footprints_fgdb/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pgeojson&token=

returns

{
  "type" : "FeatureCollection", 
  "properties" : {
    "exceededTransferLimit" : true
  }, 
  "features" : [
    {
      "type" : "Feature", 
      "geometry" : 
      {
        "type" : "Polygon", 
        "coordinates" : 
        [
          [
            [-73.7425151210838, 40.599094240213], 
            [-73.7425911041967, 40.5990861769151], 
            [-73.7425917093092, 40.5990894913071], 
            [-73.7426532694704, 40.5990829589762], 
            [-73.7426757075901, 40.5992058022994], 
            [-73.7425381640606, 40.5992203988559], 
            [-73.7425151210838, 40.599094240213]
          ]
        ]
      }, 
      "properties" : null
    }, 
    {
      "type" : "Feature", 
      "geometry" : 
      {
        "type" : "Polygon", 
        "coordinates" : 
        [
          [
            [-73.9209083358819, 40.5583775802595], 
            [-73.9209259088365, 40.5583233221446], 
            [-73.9210125653364, 40.5583396497789], 
            [-73.9210200191982, 40.5583166365532], 
            [-73.92109231559, 40.5583302571756], 
            [-73.9210672877374, 40.5584075285442], 
            [-73.9209083358819, 40.5583775802595]
          ]
        ]
      }, 
      "properties" : null
    }, 
    {
      "type" : "Feature", 
      "geometry" : 
      {
        "type" : "Polygon", 
        "coordinates" : 
        [
          [
            [-73.7982895588688, 40.5981746348479], 
            [-73.7983689818667, 40.5981711261968], 
            [-73.7983727816124, 40.5982211011943], 
            [-73.798293358555, 40.598224609848], 
            [-73.7982895588688, 40.5981746348479]
          ]
        ]
      } ]

You can use the wizard here to build the query. https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYC_Footprints_fgdb/FeatureServer/0/query

1
  • Thanks for the answer but that's exactly what is not possible on the server I'm dealing with. Jan 29, 2021 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.