Friday, November 18, 2011

Getting the Extent is Easy as Describe() - ArcPy

Early in my blog, I posted methods on obtaining the extent, and creating an extent polygon using the Array and Poylgon objects.  Here is the short cut for creating extent polygons for a whole feature class:

import arcpy
dataset = r"c:\temp\myfeatures.shp"
desc = arcpy.Describe(dataset)
extent = desc.extent
arcpy.CopyFeatures_management(extent, "c:/TEMP/extent.shp")

Very cool, and very easy.

No comments: