Geoprocessing tool fails for not having OID #14
Labels
esri-client
This issue relates to esri software
known-issue
We understand there is an issue
with-workaround
This issue has a work around
The problem
Some ArcGIS geoprocessing tools require a real esri object id.
The reason
When using Open SGID data in ArcGIS the data is ingested as a Query Layer. Query layers do not have an esri OID while they will have a primary key that is unique.
Several ArcGIS geoprocessing tools require an OID field in order to successfully execute. Without an OID field in the layer you're processing, the tool will fail with
ERROR 000339: Input does not have OIDs.
.This behavior and solutions are documented in ESRI help pages and GIS StackExchange.
The workaround
Query layer's without an esri OID was resolved in ArcGIS Pro v2.5.
If you are at a version below v2.5, CopyFeatures will create a temporary feature class (either in-memory or in a file geodatabase) with OIDs. You can then run the geoprocessing tool on the temporary feature class.
Examples
This code fails with
ERROR 000339
:This code successfully runs to completion:
The text was updated successfully, but these errors were encountered: