- Use the 'Minimum Bounding Geometry' tool to create 'ENVELOPE' geometry types with or without the 'Group Option'. This tool is available at the 'Advanced' level, so if you don't know how to/want to use python, this is your go to option to use. The output is a feature class.
- For whole feature class extent use the arcpy.Describe(), and write it out to disk
import arcpy from arcpy import env env.overwriteOutput = True fc = r"c:\States.shp"desc = arcpy.Describe(fc) extent = desc.extent pts = [arcpy.Point(extent.XMin, extent.YMin), arcpy.Point(extent.XMax, extent.YMin), arcpy.Point(extent.XMax, extent.YMax), arcpy.Point(extent.XMin, extent.YMax)] array = arcpy.Array(items=pts) poly = arcpy.Polygon(array) arcpy.CopyFeatures_management(poly, r"%scratchgdb%\way1")
- Method 1 for individual features: Use a cursor with extent XMin, YMin, XMax, and YMax, and arcpy.CreateFeatureClass()
import arcpy from arcpy import env env.overwriteOutput = True fc = r"c:\States.shp" out_fc = r"%scratchgdb%\way2" if not arcpy.Exists(out_fc): arcpy.CreateFeatureclass_management(out_path="%scratchgdb%", out_name="way2", geometry_type="POLYGON", spatial_reference=arcpy.SpatialReference(4326)) icur = arcpy.da.InsertCursor(out_fc, "SHAPE@") with arcpy.da.SearchCursor(fc, "SHAPE@") as rows: for row in rows: extent = row[0].extent pts = [arcpy.Point(extent.XMin, extent.YMin), arcpy.Point(extent.XMax, extent.YMin), arcpy.Point(extent.XMax, extent.YMax), arcpy.Point(extent.XMin, extent.YMax)] array = arcpy.Array(items=pts) poly = arcpy.Polygon(array) icur.insertRow([poly]) del array del poly del pts del extent del row
- Method 2 for individual features: Use a cursor objects and arcpy.CopyFeatures()
import arcpy from arcpy import env env.overwriteOutput = True fc = r"c:\States.shp" out_fc = r"%scratchgdb%\way3" with arcpy.da.SearchCursor(fc, "SHAPE@") as rows: polys = [] array = arcpy.Array() for row in rows: extent = row[0].extent array.add(extent.lowerLeft) array.add(extent.lowerRight) array.add(extent.upperRight) array.add(extent.upperLeft) array.add(extent.lowerLeft) polys.append(arcpy.Polygon(array)) array.removeAll() del row del array arcpy.CopyFeatures_management(polys, out_fc) del polys
Enjoy