ESRI_OID handling

879
2
01-27-2022 11:02 AM
MaulikVaidya
New Contributor

(noob here, so your patience is appreciated)

Unsure whether this is a question on JS API or the arcGIS Server itself.

Setup

  • .sd REST service with both Map and Feature layer enabled. Created using arcGIS Pro from geo-spatial enabled (postGIS) tables residing in PostgreSQL (14.x)
  • service is published w/ REST using arcGIS Enterprise Server (10.9.x)
  • react- based front-end consuming said service and displaying map

Issue

  • Features aren't displayed in browser map

Background/Troubleshooting_thus_far:

  • service has 4 layers. each layer's url is verified to work
  • FeatureLayer() w/ definedExpression for each layer works correctly. confirmed via console.log of queryFeatuerCount()
  • But problem comes during rendering (error while parsing FeatureSet pbf)
  • problem narrowed down to query url handling. below is the query url params output using config interceptor before()

 

{
    "f": "pbf",
    "geometry": "{\"xmin\":-8981656.571621992,\"ymin\":4167958.2783359867,\"xmax\":-8962088.69238099,\"ymax\":4187526.1575769875}",
    "orderByFields": "ESRI_OID",
    "outFields": "ESRI_OID",
    "outSR": 102100,
    "quantizationParameters": "{\"extent\":{\"spatialReference\":{\"latestWkid\":3857,\"wkid\":102100},\"xmin\":-8981656.571621992,\"ymin\":4167958.2783359867,\"xmax\":-8962088.69238099,\"ymax\":4187526.1575769875},\"mode\":\"view\",\"originPosition\":\"upperLeft\",\"tolerance\":38.21851414257816}",
    "resultType": "tile",
    "returnExceededLimitFeatures": false,
    "spatialRel": "esriSpatialRelIntersects",
    "where": "cty_key='37025'",
    "geometryType": "esriGeometryEnvelope",
    "inSR": 102100
}​

 

 ESRI_OID is being asked in outFields. PgS dB tables do not have ESRI_OID column. But, during layer creation (in arc Pro) process, unique identifier was mapped to a column with unique identifiers (say. col name = uid, type = text). When querying attributes tables in arcPro, one can see ESRI_OID initialized using integers. So, when JS client asks for information about each feature, arcGIS server should serve up the results. Instead, for some reason, it is going to PgS with SQL query:

 

SELECT ESRI_OID,geometry FROM <blah> WHERE <blah> ORDER BY ESRI_OID ASC;Spatial Filter: esriSpatialRelIntersects;Search Geometry Envelope: (<blah>)

 

 

Tables are created and maintained using other programs, so altering tables' properties is not an option.

So, either i:

  1. remove ESRI_OID from url query. interceptor().before allows setting params but not sure how to delete it?
  2. or somehow force arcGIS server to serve up the answer to SQL query using locally cached data
  3. or somehow force arcGIS server to remove cols such as ESRI_OID which do not exist on PgS

I'm sure I'm missing something very basic here. Penny for your thoughts?

2 Replies
JeffreyWilkerson
Occasional Contributor III

I don't know anything about React, but my first thought was that I've never heard of ESRI_OID being used as the internal ID, it's always been OBJECTID from what I've seen.  Since the REST service is in ArcGIS Online you can go there to check on the exact field names.  Also, if you are confident with the 'ESRII_OID' fieldname, you should probably put those in lists like [ESRI_OID].  If all else fails, remark out the order by and put ['*'] in the outFields.

 

0 Kudos
MaulikVaidya
New Contributor

Thanks @JeffreyWilkerson.

layer information shows 

ESRI_OID ( type: esriFieldTypeOID, alias: ESRI_OID, editable: false, nullable: false, defaultValue: null, modelName: ESRI_OID )

 

 

0 Kudos