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?
Thanks
Solved! Go to Solution.
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.
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
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).
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.
Add Spatial Index (Data Management)—ArcGIS Pro | Documentation
will recalculate one if that is what you are looking for. See the code sample section
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.