Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geoprocessing tool fails for not having OID #14

Open
eneemann opened this issue Apr 2, 2020 · 0 comments
Open

Geoprocessing tool fails for not having OID #14

eneemann opened this issue Apr 2, 2020 · 0 comments
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

Comments

@eneemann
Copy link

eneemann commented Apr 2, 2020

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:

arcpy.analysis.Buffer('opensgid.boundaries.county_boundaries', out_name, "50 Meters", "FULL", "ROUND", "ALL", "", "")

This code successfully runs to completion:

temp_features = r'in_memory\temp_features'
arcpy.management.CopyFeatures('opensgid.boundaries.county_boundaries', temp_features)
arcpy.analysis.Buffer(temp_features, out_name, "50 Meters", "FULL", "ROUND", "ALL", "", "")

image

@eneemann eneemann changed the title Some ArcPy geoprocessing tools fail because layer doesn't have OIDs Some ArcPy geoprocessing tools fail because the Open SGID layer doesn't have OIDs Apr 2, 2020
@steveoh steveoh changed the title Some ArcPy geoprocessing tools fail because the Open SGID layer doesn't have OIDs Geoprocessing tool fails for not having OID Apr 2, 2020
@steveoh steveoh added esri-client This issue relates to esri software known-issue We understand there is an issue with-workaround This issue has a work around labels Apr 2, 2020
@agrc agrc deleted a comment from gregbunce Apr 8, 2020
@agrc agrc locked as resolved and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

2 participants