Resumen
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.
Debate
The Extent object supports equal (==) and not equal (!=) operators for comparing extents.
Nota:
When used as input to Extensión ArcGIS Spatial Analyst tools—Create Constant Raster, Create Normal Raster, Create Random Raster, Extract By Rectangle, Extract by Mask, and Topo To Raster—only the XMin, YMin, XMax, and YMax values are used by these tools.
Sintaxis
Extent ({XMin}, {YMin}, {XMax}, {YMax}, {ZMin}, {ZMax}, {MMin}, {MMax}, {spatial_reference})
Parámetro | Explicación | Tipo de datos |
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 |
spatial_reference | The spatial reference of the extent. | SpatialReference |
Propiedades
Propiedad | Explicación | Tipo de datos |
JSON (Sólo lectura) | Returns a JSON representation of the extent as a string. Sugerencia:The returned string can be converted to a dictionary using the json module's loads function. | String |
MMax (Sólo lectura) | The extent MMax value. None if no m-value. | Double |
MMin (Sólo lectura) | The extent MMin value. None if no m-value. | Double |
XMax (Sólo lectura) | The extent XMax value. | Double |
XMin (Sólo lectura) | The extent XMin value. | Double |
YMax (Sólo lectura) | The extent YMax value. | Double |
YMin (Sólo lectura) | The extent YMin value. | Double |
ZMax (Sólo lectura) | The extent ZMax value. None if no z-value. | Double |
ZMin (Sólo lectura) | The extent ZMin value. None if no z-value. | Double |
depth (Sólo lectura) | The extent depth value. None if no depth. | Double |
geohash (Sólo lectura) | A geohash string of the extent is returned. | String |
geohashCovers (Sólo lectura) | Returns a list of up to the four longest geohash strings that fit within the extent. | String |
geohashNeighbors (Sólo lectura) | A list of the geohash neighbor strings for the extent is returned. | String |
height (Sólo lectura) | The extent height value. | Double |
lowerLeft (Sólo lectura) | The lower left property: A point object is returned. | Point |
lowerRight (Sólo lectura) | The lower right property: A point object is returned. | Point |
polygon (Sólo lectura) | Returns the extent as a polygon object. | Polygon |
spatialReference (Sólo lectura) | The spatial reference of the extent. | SpatialReference |
upperLeft (Sólo lectura) | The upper left property: A point object is returned. | Point |
upperRight (Sólo lectura) | The upper right property: A point object is returned. | Point |
width (Sólo lectura) | The extent width value. | Double |
Descripción general del método
Método | Explicación |
contains (second_geometry, {relation}) | Indicates if the base geometry contains the comparison geometry. contains is the opposite of within. Only True relationships are shown in this illustration. |
crosses (second_geometry) | Indicates if the two geometries intersect in a geometry of a lesser shape type. Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline or a point (for vertical line) in common on the interior of the polygon which is not equivalent to the entire polyline. Only True relationships are shown in this illustration. |
disjoint (second_geometry) | Indicates if the base and comparison geometries share no points in common. Two geometries intersect if disjoint returns False. Only True relationships are shown in this illustration. |
equals (second_geometry) | Indicates if the base and comparison geometries are of the same shape type and define the same set of points in the plane. This is a 2D comparison only; M and Z values are ignored. Only True relationships are shown in this illustration. |
overlaps (second_geometry) | Indicates if the intersection of the two geometries has the same shape type as one of the input geometries and is not equivalent to either of the input geometries. Only True relationships are shown in this illustration. |
projectAs (spatial_reference, {transformation_name}) | Projects a geometry from one spatial reference to another. When the geometry object and the destination spatial reference do not have a common datum, specify a transformation_name parameter value. For more information, see Geographic datum transformations and ListTransformations. A vertical transformation will be performed when the following criteria are met:
When the transformation_name parameter value is a vertical transformation, and neither the geometry object nor the destination spatial reference have a vertical coordinate system, the function will fail with a ValueError exception. If either the geometry object or the spatial_reference parameter value have an unknown spatial reference, the output geometry's spatial reference will be that of the spatial_reference parameter value. Use of unknown spatial reference is not recommended for analysis. The projectAs method will not modify m-values, if present. |
touches (second_geometry) | Indicates if the boundaries of the geometries intersect. Two geometries touch when the intersection of the geometries is not empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. Only True relationships are shown in this illustration. |
within (second_geometry, {relation}) | Indicates if the base geometry is within the comparison geometry. within is the opposite operator of contains. Only True relationships are shown in this illustration. The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty. within is a Clementini operator, except in the case of an empty base geometry. |
Métodos
contains (second_geometry, {relation})
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
relation | The spatial relationship type.
(El valor predeterminado es None) | String |
Tipo de datos | Explicación |
Boolean |
A return Boolean value of True indicates this geometry contains the second geometry. |
crosses (second_geometry)
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
Tipo de datos | Explicación |
Boolean | A return Boolean value of True indicates the two geometries intersect in a geometry of a lesser shape type. |
disjoint (second_geometry)
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
Tipo de datos | Explicación |
Boolean | A return Boolean value of True indicates that the two geometries share no points in common. |
equals (second_geometry)
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
Tipo de datos | Explicación |
Boolean |
A return Boolean value of True indicates that the two geometries are of the same shape type and define the same set of points in the plane. |
overlaps (second_geometry)
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
Tipo de datos | Explicación |
Boolean | A return Boolean value of True indicates the intersection of the two geometries has the same dimension as one of the input geometries. |
projectAs (spatial_reference, {transformation_name})
Parámetro | Explicación | Tipo de datos |
spatial_reference | The spatial reference to which the geometry will be projected. The value can be a SpatialReference object or the coordinate system name. | SpatialReference |
transformation_name | The geotransformation name. With ArcGIS Pro, if you do not specify a transformation, none will be applied. With ArcGIS Server, if you do not specify a transformation, a fallback transformation will be applied. | String |
Tipo de datos | Explicación |
Object | The projected geometry. |
touches (second_geometry)
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
Tipo de datos | Explicación |
Boolean | A return Boolean value of True indicates the boundaries of the geometries intersect. |
within (second_geometry, {relation})
Parámetro | Explicación | Tipo de datos |
second_geometry | A second geometry. | Object |
relation | The spatial relationship type.
(El valor predeterminado es None) | String |
Tipo de datos | Explicación |
Boolean | A return Boolean value of True indicates this geometry is contained within the second geometry. |
Muestra de código
Display extent object properties for features.
import arcpy
feature_class = 'c:/Data/Florida.gdb/airports'
# Fetch each feature from the cursor and examine the extent properties
for row in arcpy.da.SearchCursor(feature_class, ['SHAPE@', 'CNTY_NAME']):
extent = row[0].extent
print('Extent of county {}:'.format(row[1]))
print('XMin: {}, YMin: {}'.format(extent.XMin, extent.YMin))
print('XMax: {}, YMax: {}'.format(extent.XMax, extent.YMax))