arcpy desc hasSpatialindex

07-18-2019 12:44 AM
New Contributor III


I run python script using following code

desc = arcpy.Describe(fc)
sindex = str(desc.hasSpatialIndex)
stype = desc.featureType
print str(fc)+ "--"+sindex + "--"+stype

it returns the feature class name and type correctly.  but it doesnt return the correct value for hasSpatialIndex.

It returns the values as true when the ArcCatelog show that the layer doesnt have spatial index.

any idea

0 Kudos
3 Replies
MVP Esteemed Contributor

Was catalog refreshed when you checked?

Did you try to delete the spatial index? You will get an error if the spatial index doesn't exist which would confirm that it doesn't exist.

More on spatial indices

Spatial indexes in the geodatabase—Geodatabases | ArcGIS Desktop 

New Contributor III


I refreshed the catalog but still the same result.

Actually we migrated SDE database from Oracle 11g to Oracle 12c Exadata. it was migrated using data dump process. During the migration, we got error randomly that spatial index exist for some layers.

After the migration, we found that many layers missing their spatial index using  the Arccatalog.

I used the above script to get the list instead of viewing each layer in Arccatalog. unfortunately the script provided wrong results. 

Also, in Arccatalog, the spatial index buttons (add,delete, rebuild) options are not enabled even though it displays the message that the layer has no spatial index.

0 Kudos
New Contributor III

got the same issue with ArcGIS Desktop 10.6.1, ArcSDE 10.6.1 on Oracle11g

0 Kudos