FeatureServer example

https://transparentgov.net/json2tree/esri/server/folder.html?url=https%3A%2F%2Fservices2.arcgis.com%2FCcI36Pduqd0OR4W9%2FArcGIS%2Frest%2Fservices&org=Kentucky+FeatureServer+&_center_lat=37.8393&_center_long=-84.27&_center_zoom=17&select_folder=100&select_layer=0

 

For example, arcgis REST api, FeatureServer only,  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

 

 

All sample use ESRI arcgis server v10.71  or  v10.81,

However, f=pbf only works with FeatureServer, not MapServer. 

Open your postman app, try sample:

 

v10.81 MapServer, not work, f=pbf, just same as f=json.

https://gis.la-quinta.org/arcgis/rest/services/BaseMap/Parcel/MapServer/1/query?&resultOffset=0&resultRecordCount=500&returnGeometry=true&outSR=4326&f=pbf&outFields=*&geometryType=esriGeometryEnvelope&geometry=%7B%22spatialReference%22:%7B%22wkid%22:4326%7D,%20%22xmin%22%20:%20-116.35682061358298,%20%22ymin%22%20:%2033.57736122980378,%20%22xmax%22%20:%20-116.11014321490134,%20%22ymax%22%20:%2033.76479660485203%7D&callback=jQuery33106041300323957812_1649260209456&_=1649260209480

 

 

 

FeatureServer Only, Then Why use pbf

 

FeatureServer require user have arcgis server physical machine local access, because feature server allow user to edit and write data on arcgis server physical machine hard drive. So you must have server local access to be able to create and setup FeatureServer. 

This is why you don't see featureServer that much. Most of time you see is MapServer. MapServer does not require local server access, is read-only to user. 

Feature server sample: 

http://transparentgov.net/json2tree/esri/server/folder.html?url=https://services2.arcgis.com/CcI36Pduqd0OR4W9/ArcGIS/rest/services&org=Kentucky%20FeatureServer%20&_center_lat=37.8393&_center_long=-84.27&_center_zoom=17

f=Pbf is smaller than f=json,  so save your internet traffic, with faster response time.

f=pjson (pretty json with linebreak readable) is largest format.

 

pbf compare to json, is how much smaller? how much faster (less response time)?

 

same request    f=pjson  use 6.13 second with 15.08MB 

https://services8.arcgis.com/0IhsDShsWMvHpVHf/arcgis/rest/services/ZONING/FeatureServer/0/query?&resultOffset=0&resultRecordCount=500&returnGeometry=true&outSR=4326&f=pjson&outFields=*&geometryType=esriGeometryEnvelope&geometry=%7B%22spatialReference%22:%7B%22wkid%22:4326%7D,%20%22xmin%22%20:%20-117.82649510811554,%20%22ymin%22%20:%2033.81366302784781,%20%22xmax%22%20:%20-117.33314031075226,%20%22ymax%22%20:%2034.18709133809821%7D&callback=jQuery331025378877325127025_1649259552423&_=1649259552442

 

same request    f=json  use 6.47 second with 10.08MB 

https://services8.arcgis.com/0IhsDShsWMvHpVHf/arcgis/rest/services/ZONING/FeatureServer/0/query?&resultOffset=0&resultRecordCount=500&returnGeometry=true&outSR=4326&f=json&outFields=*&geometryType=esriGeometryEnvelope&geometry=%7B%22spatialReference%22:%7B%22wkid%22:4326%7D,%20%22xmin%22%20:%20-117.82649510811554,%20%22ymin%22%20:%2033.81366302784781,%20%22xmax%22%20:%20-117.33314031075226,%20%22ymax%22%20:%2034.18709133809821%7D&callback=jQuery331025378877325127025_1649259552423&_=1649259552442

 

 

 

 

  same request    f=pbf  use 3.69 second with 1.2 MB 

Size reduce 90%, but response time only reduce 20%-30%,  I don't think pbf is ideal format, only save yousize, not time. That is why ESRI don't apply pbf to MapServer, only limit pbf to FeatureServer.

https://services8.arcgis.com/0IhsDShsWMvHpVHf/arcgis/rest/services/ZONING/FeatureServer/0/query?&resultOffset=0&resultRecordCount=500&returnGeometry=true&outSR=4326&f=pbf&outFields=*&geometryType=esriGeometryEnvelope&geometry=%7B%22spatialReference%22:%7B%22wkid%22:4326%7D,%20%22xmin%22%20:%20-117.82649510811554,%20%22ymin%22%20:%2033.81366302784781,%20%22xmax%22%20:%20-117.33314031075226,%20%22ymax%22%20:%2034.18709133809821%7D&callback=jQuery331025378877325127025_1649259552423&_=1649259552442

by

Please log in or register