Extent properties |
|
Release 9.3
Last modified January 19, 2010 |
Print all topics in : "Properties and Methods" |
Note:
This topic was updated for 9.3.1.
NOTE: Supported only when the geoprocessor is instantiated using the arcgisscripting module with a version of 9.3. Extent will otherwise return a space delimited string (XMin YMin XMax YMax).
Learn more about creating the geoprocessor object
|
Property |
XMin | |
YMin | |
XMax | |
YMax | |
MMin | |
MMax | |
ZMin | |
ZMax | |
Width | |
Height | |
Depth | |
LowerLeft: Point Object | |
LowerRight: Point Object | |
UpperLeft: Point Object | |
UpperRight: Point Object |
import arcgisscripting gp = arcgisscripting.create(9.3) # Open a search cursor on a feature class (polygon or polyline). # rows = gp.searchcursor(r"C:\hydro\river_lines.shp") # Get the first row of the feature class. # row = rows.next() # Get the shape field. # shape = row.shape # Get the extent object. # extent = shape.extent # Print out properties of the extent object. # print "XMin: %f" % (extent.xmin) print "YMin: %f" % (extent.ymin)print "XMax: %f" % (extent.xmax) print "YMax: %f" % (extent.ymax) if extent.mmin: print "MMin: %f" % (extent.mmin) print "MMax: %f" % (extent.mmax) if extent.zmin: print "ZMin: %f" % (extent.zmin) print "ZMax: %f" % (extent.zmax) print "Width: %f" % (extent.width) print "Height: %f" % (extent.height) if extent.depth: print "Depth: %f" % (extent.depth) # LowerLeft, LowerRight, UpperLeft, and UpperRight properties return # point objects. Print out the x and y properties for each point object. # ll = extent.lowerleft print "LowerLeft (x;y): %f;%f" % (ll.x, ll.y) lr = extent.lowerright print "LowerRight (x;y): %f;%f" % (lr.x, lr.y) ul = extent.upperleft print "UpperLeft (x;y): %f;%f" % (ul.x, ul.y) ur = extent.upperright print "UpperRight (x;y): %f;%f" % (ur.x, ur.y)