(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:
- remove ESRI_OID from url query. interceptor().before allows setting params but not sure how to delete it?
- or somehow force arcGIS server to serve up the answer to SQL query using locally cached data
- 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?