Arcpy spatial index Validation

2035
4
Jump to solution
12-23-2020 05:37 AM
JDA
by
New Contributor

Hi, 

Is there in arcpy a function that does the same as the Validate button in the image below? or has some a python script for that?

DominiqueAndriessen_0-1608730531532.png

Thanks

1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

Unfortunately, spatial index extents are not available through ArcPy.  I am not even sure they are available in Pro SDK yet because the ArcPy Index methods appear to just mimic what is already available in the Pro SDK.

View solution in original post

4 Replies
DavidPike
MVP Frequent Contributor

The documentation suggests it's running a comparison of the spatial index extent and the feature class extent.

you can probably grab index info with ListIndexes—ArcGIS Pro | Documentation  then I would hope the info is in the 'fields' attribute of the Index class Index—ArcGIS Pro | Documentation but i'm not entirely sure.

 

You would get the FC extent using Describing data—ArcGIS Pro | Documentation 

file geodatabase - Accessing feature extent of feature class using ArcPy? - Geographic Information S...

has an example.

 

I'd then run some comparison of the MinX MinY etc for the FC extent and the Spatial Index extent, or maybe you can do an equality on the extent objects? (no idea).

 

JoshuaBixby
MVP Esteemed Contributor

Unfortunately, spatial index extents are not available through ArcPy.  I am not even sure they are available in Pro SDK yet because the ArcPy Index methods appear to just mimic what is already available in the Pro SDK.

DanPatterson
MVP Esteemed Contributor

Add Spatial Index (Data Management)—ArcGIS Pro | Documentation

will recalculate one if that is what you are looking for.  See the code sample section


... sort of retired...
DavidBlanchard
Esri Contributor

I would be careful with recalculating spatial indexes, especially on larger datasets or on enterprise databases. This can be a time consuming operation and could impact other users of the dataset.

Unfortunately, I am not aware of a way of validating the spatial reference via a script.

0 Kudos