Summary
This tool recalculates the XY, Z, and M extent property of a feature class based on the features within the feature class.
A feature class has a spatial extent that is based upon all the coordinates within the feature class. This spatial extent is used when adding a feature class to a map in order to recenter and display all the features within. Rather than examining every feature in the feature class each time the feature class is added to a map (a potentially long process), a feature class has an extent property containing the last known spatial extent. However, this extent property is not always updated when features within the feature class are edited. This means that the values in the extent property might not contain the actual spatial extent of the features. Executing this tool reads all the features and updates the extent property.
Usage
Recalculate Feature Class Extent updates geodatabase feature classes or shapefiles (point, multipoint, line, or polygon).
On an enterprise geodatabase, extent is a property of the feature class schema and requires an exclusive schema lock to execute.
When using this tool with an enterprise geodatabase feature class as input, the extent is calculated based on the features that exist in that feature class in all versions. The extent will not shrink or expand unless this tool is run after the database has been compressed.
This tool will fail if you do not have permissions for editing the feature class.
Recalculating the feature class extent cannot be undone.
The values of the extent property are returned by the arcpy.Describe function.
This tool performs the same operation as opening the Feature Class Properties in ArcCatalog or the Catalog Window in ArcMap, choosing the Feature Extent tab, and clicking Recalculate in the appropriate Extent section.
Syntax
RecalculateFeatureClassExtent_management (in_features)
Parameter | Explanation | Data Type |
in_features | The shapefile or geodatabase feature class that will be updated. | Feature Layer |
Derived Output
Name | Explanation | Data Type |
out_features |
Code sample
RecalculateFeatureClassExtent example (Python window)
The following Python window script demonstrates how to use the RecalculateFeatureClassExtent tool in immediate mode. It recalculates the XY, M, or Z extent of a feature class.
import arcpy
feature_class = r"C:\Data\europe.gdb\norway_cities"
arcpy.RecalculateFeatureClassExtent_management(feature_class)
Environments
Licensing information
- ArcGIS Desktop Basic: No
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes