Arcpy - Reproject Polygon object

703
1
04-19-2011 08:00 AM
deleted-user-1T_bOHag6M8d
Occasional Contributor
My script creates an arcpy.Polygon object from the extent of a data frame in an MXD. The coordinate system of the data frame varies in different maps. So the spatial reference of the arcpy.Polygon object can also vary. What I want the script to do is re-project the arcpy.Polygon object into a standard coordinate system, but I don't see a function to do this. I know I can call the Project_management tool, but that requires an output feature class to be created. I would much rather the reprojected output be a new arcpy.Polygon object.

Is there an option to re-project an arcpy.Polygon object into another arcpy.Polygon object?
Tags (2)
0 Kudos
1 Reply
deleted-user-1T_bOHag6M8d
Occasional Contributor
My script creates an arcpy.Polygon object from the extent of a data frame in an MXD. The coordinate system of the data frame varies in different maps. So the spatial reference of the arcpy.Polygon object can also vary. What I want the script to do is re-project the arcpy.Polygon object into a standard coordinate system, but I don't see a function to do this. I know I can call the Project_management tool, but that requires an output feature class to be created. I would much rather the reprojected output be a new arcpy.Polygon object.

Is there an option to re-project an arcpy.Polygon object into another arcpy.Polygon object?


I went another way with this. I found out that my cursor can be defined with a spatial reference that will transform any other reference to the defined one. So I set the spatial reference in the cursor to the standard coordinate system and it re-projects the arcpy.Polygon object before inserting it into the feature class.
0 Kudos