Tools that honor the Extent environment will only process features or rasters that are within the extent specified in this setting.
The Extent environment defines the features or rasters that will be processed by a tool. It is useful when you are processing only a portion of a larger dataset. You can think of this setting as a rectangle used to select input features and rasters for processing. The rectangle is used only to select features, not to clip them. The extent of the output dataset will typically be larger than the Extent environment to account for features or cells that pass through the extent rectangle.
Usage notes
- The coordinate system listed under the Extent Coordinate System collapsible section is used by tools to interpret the location of the extent coordinates and is not affected by the Output Coordinate System environment.
- The Current Display Extent , Draw Extent , and Extent of a Layer options use the active map's coordinate system.
- The Browse and Clipboard options use the dataset's or pasted coordinate system.
- The Intersection of Inputs and Union of Inputs options determine the coordinate system at tool run time and use the coordinate system of the first input dataset.
- When an extent without a coordinate system is specified, the extent will use the coordinate system of the first input dataset used by a tool.
Dialog syntax
- Current Display Extent —The extent will be based on the active map or scene. This option is only available when there is an active map.
- Draw Extent —The extent will be based on a rectangle drawn on the map or scene. This option will create a feature class in the project geodatabase and add a layer to the map. The feature class will have the same coordinate system as the map.
Note:
This option is not available in the Environments dialog box. It is only available from a tool parameter with an extent data type or from the Environments tab on a tool dialog box.
Note:
When the Enable and disable editing from the Edit tab editing option is checked, you must enable editing on the Edit ribbon tab to draw the extent.
- Extent of a Layer —The extent will be based on an active map layer. Use the drop-down list to choose an available layer or use the Extent of data in all layers option to get the combined extent of all active map layers, excluding the basemap. This option is only available when there is an active map with layers.
Each map layer has the following options:
- All Features —The extent of all features in the layer.
- Selected Features —The extent of the selected features in the layer.
- Visible Features —The extent of visible features in the layer.
Note:
The extents from the Selected Features and Visible Features options are only available for feature layers.
- Browse —The extent will be based on an existing dataset.
- Intersection of Inputs —The extent will be based on the minimum or intersecting extent of all inputs. If no inputs overlap, a null extent with all zeros will result.
- Union of Inputs —The extent will be based on the maximum or combined extent of all inputs.
- Clipboard —The extent can be copied to and from the clipboard.
- Copy Extent —Copies the extent coordinates and coordinate system to the clipboard.
- Paste Extent —Pastes the extent coordinates and, optionally, the coordinate system from the clipboard. If the clipboard values do not include a coordinate system, the extent will use the map’s coordinate system.
Note:
The extent coordinates are copied to and pasted from the clipboard using the same formatting and order as the ArcPy Extent object: x-min, y-min, x-max, y-max, and the spatial reference.
- Reset Extent —The extent will be reset to the default value.
- Manually entered coordinates—The coordinates must be numeric
values and in the active map's coordinate system.
Caution:
The map may use different display units than the entered coordinates. The use of a cardinal direction (N, S, E, W) is not supported. Use a negative value sign for south and west coordinates.
When you use the Current Display Extent , Draw Extent , Extent of a Layer , or Browse option, the extent is read and stored at that moment; the extent will not update later if a change is made to the map, layer, or dataset. The Intersection of Inputs and Union of Inputs options will determine the extent coordinates and coordinate system at tool run time.
Scripting syntax
arcpy.env.extent = extent
Note:
When set, the extent environment property returns an Extent object in Python.
extent | Explanation |
---|---|
Extent object | An Extent object can be used to define the extent. |
MINOF | The extent where all input features or rasters overlap (intersect one another). It is possible that no features overlap and that a null extent (zero width and height) may result. In such cases, no features or cells will be processed. |
MAXOF | The combined extent of all input data. All features or cells will be processed. |
"XMin, YMin, XMax, YMax" | Space-delimited coordinates that define the extent in the coordinate system in which the input data is stored. |
Path name | The path to a dataset. The extent of the dataset will be used. |
Script example
import arcpy
# Set the extent environment using a keyword
arcpy.env.extent = "MAXOF"
# Set the extent environment using the Extent class
arcpy.env.extent = arcpy.Extent(-107.0, 38.0, -104.0, 40.0)
# Set the extent environment using a space-delimited string
arcpy.env.extent = "-107.0 38.0 -104.0 40.0"
# Set the extent environment using a feature class
arcpy.env.extent = "C:/data/StudyArea_perim.shp"
# Set the extent environment using a raster
arcpy.env.extent = "C:/data/StudyArea.tif"