Extent

Summary

An extent is a rectangle specified by providing the coordinate of the lower left corner and the coordinate of the upper right corner in map units.

Discussion

NoteNote:

When used as input to the Spatial Analyst tools, Create Constant Raster, Create Normal Raster, Create Random Raster, Extract By Rectangle and Topo To Raster only the XMin, YMin, XMax and YMax values are used by these tools.

Syntax

Extent ({XMin}, {YMin}, {XMax}, {YMax}, {ZMin}, {ZMax}, {MMin}, {MMax})
ParameterExplanationData Type
XMin

The extent XMin value.

Double
YMin

The extent YMin value.

Double
XMax

The extent XMax value.

Double
YMax

The extent YMax value.

Double
ZMin

The extent ZMin value. None if no Z value.

Double
ZMax

The extent ZMax value. None if no Z value.

Double
MMin

The extent MMin value. None if no M value.

Double
MMax

The extent MMax value. None if no M value.

Double

Properties

PropertyExplanationData Type
MMax
(Read Only)

The extent MMax value. None if no M value.

Double
MMin
(Read Only)

The extent MMin value. None if no M value.

Double
XMax
(Read Only)

The extent XMax value.

Double
XMin
(Read Only)

The extent XMin value.

Double
YMax
(Read Only)

The extent YMax value.

Double
YMin
(Read Only)

The extent YMin value.

Double
ZMax
(Read Only)

The extent ZMax value. None if no Z value.

Double
ZMin
(Read Only)

The extent ZMin value. None if no Z value.

Double
depth
(Read Only)

The extent depth value. None if no depth.

Double
height
(Read Only)

The extent height value.

Double
lowerLeft
(Read Only)

The lower left property: A point object is returned.

Point
lowerRight
(Read Only)

The lower right property: A point object is returned.

Point
upperLeft
(Read Only)

The upper left property: A point object is returned.

Point
upperRight
(Read Only)

The upper right property: A point object is returned

Point
width
(Read Only)

The extent width value.

Double

Code Sample

Extent example

Display extent object properties for features.

import arcpy
from arcpy import env

# Set the workspace
#
env.workspace = "C:/Data/Florida.gdb"

# Create a search cursor from the airports featureclass
#
sCur = arcpy.SearchCursor("airports", '"CNTY_NAME" = \'Orange\'')

# Fetch each feature from the cursor and examine the extent properties
#
for row in sCur:
    geom = row.shape
    ext = geom.extent  # or row.Shape.extent
    print "Extent of feature:\nXMin: %f, YMin: %f, \nXMax: %f, YMax: %f" % \
          (ext.XMin,ext.YMin,ext.XMax,ext.YMax) 

Related Topics


10/28/2011