Select to view content in your preferred language

Identify Feature Classes with 64-bit ObjectID

887
18
Jump to solution
08-27-2024 09:03 AM
ModernElectric
Frequent Contributor

Is there an easy way to identify all Feature Class(s) within a File Geodatabase that have a 64-bit Object ID, as in constructing a Python script? Versus going thru the properties over hundreds of different Feature Class(s) and a number of different GDBs?

18 Replies
SSWoodward
Esri Contributor

@ModernElectric 

If you'd like another way to check you can always use a schema report.  I left this response to @Bud 's linked Idea but I'll put it in here as well for good measure:

The 'Field' worksheet of the schema report will give you information about every field in the geodatabase. To use it to make sure there are no 64-bit OIDs in your workspace, you can try the following.

1. Generate an Excel schema report of your geodatabase by right-clinging in the catalog pane and selecting 'Generate Schema Report'

2.  Navigate to the 'Field' worksheet in the produced XLSX report.  This sheet contains the property information for all fields in the geodatabase.

3. Sort the table by field type to group all Object ID fields together.

4. Take note of whether the OID field length is 4 ( standard OID ) or 8 ( 64 bit OID )

ModernElectric
Frequent Contributor

Curious:

I understand this tool works on a file GDB. How about pulling a Hosted Feature Layer from my AGOL portal? Will the tool work on that? 

0 Kudos
SSWoodward
Esri Contributor

Indeed it does. File, Mobile, SDE, and feature services are all supported.

For feature services you can pass the feature server URL as input. 

0 Kudos
ModernElectric
Frequent Contributor

BINGO!!

This works so much better, since my knowledge of working with Excel is miles above Python. This process did identify a few GDB Tables that are a 64-bit Object ID. No Feature Classes though so not sure if these tables are adding to my issues with AGOL that I am working thru.

Appreciate your help @SSWoodward 

SSWoodward
Esri Contributor

Glad I could help.

I'd be interested to know what GDB tables were overlooked in that python.  Were they unregistered/database tables? Or geodatabase tables?

0 Kudos
ModernElectric
Frequent Contributor

Very Interesting.

The (2) tables that Excel flagged with an 8-length in the OID are in-fact GDB Tables, that I created within the GDB versus importing an external table into the GDB

0 Kudos
SSWoodward
Esri Contributor

a) Can you confirm both of these tables do indeed have a 64-bit OID
b) Can you confirm both of these tables return False when you try the below?  

 

 

table = < path to table >

arcpy.Describe(table).hasOID64

 

 


Wondering if the issue was my sample code or if there is something else going on here. 

0 Kudos
ModernElectric
Frequent Contributor

@SSWoodward 

Yes, I did confirm thru the properties in ArcGIS Pro - Catalog Pane that both tables do show 64-bit OID.

When I run the script within IDLE 3.11.8 against the individual table(s), the IDLE produces a blank screen after the script runs. It shows that is ran successfully, just no printed results. 

0 Kudos
SSWoodward
Esri Contributor

If I'm understanding you correctly, you'd likely need to print out the list or call for it to be displayed in some other way. 

In the example where we we're writing classes to a list, try print(<list_name>)

0 Kudos