I have 500+ feature classes stored in an Enterprise Geodatabase. The goal is to update extent to each feature class to match the Organization's extent. Does ArcPy have the function to perform this task?
Yes it would be very easy, you use the Describe object on a dataset.
Thanks my friend. I know how to GET the extent of a feature class:
desc = arcpy.Describe(fc) xmin = desc.extent.XMin xmax = desc.extent.XMax ymin = desc.extent.YMin ymax = desc.extent.YMax
But what I need is to RESET the extent. I know I can change the output extent in the environment settings using the Extent class, but this only defines what features will be processed by a tool. It does not alter the actual geometry of the feature class:
arcpy.env.extent = arcpy.Extent(-107.0, 38.0, -104.0, 40.0)
Thanks
Well, there is the:
Recalculate Feature Class Extent (Data Management)
geoprocessing tool that you could easily call from ArcPy. Do note though that it requires an exclusive schema lock, which might be problematic in some cases.
It also calculates the extent based on the actual features according to the Help page, while your first post suggests setting a predefined "organization" extent that may not reflect the actual data's true extent.
I am not sure if that is possible with the ESRI tools, or if you would need to hack into the geodatabases system tables to achieve that.
Thanks.
There is no input parameters to set xmin, ymin, xmax, and ymx in the RecalculateFeatureClassExtent function. It simply updates the x,y,z and m extent properties of a feature class based on that's already set in that feature class. It won't allow me to set the custom xmin, ymin, xmax, and ymax values.
I'm exploring the update cursor option and trying to figure out if I can do so by altering a feature class @SHAPE attribute.