Select to view content in your preferred language

Coordinate Conversion in ArcPy?

2549
1
07-06-2010 07:50 AM
KeithFraley
Emerging Contributor
Is there an easy way to take a set of coords in one projection and re-project them to another projection?

example

desc = arcpy.Describe(fc)
ENVXLOW = desc.extent.XMin
LNG_LOW = #convert ENVXLOW to 4326 coord?

I know this has to be able to be done, but I cant figure out how.

Thanks!
0 Kudos
1 Reply
ChrisSnyder
Honored Contributor
check out the SpatialReference parameter in the search cursor. Unfortunately you cannot directly convert coordinates using gp.describe, so you would either have to:

1. Using the SpatialReference parameter in the search cursor, loop through all the features keeping track of the xMin, yMin, xMax, and yMax extents of each feature, and then compute the xMin, yMin, xMax, and yMax for the entire layer.

2. Using gp.describe, get the layers extent, construct a polygon feature for it, project it (using the project tool), and then reread the coordinates.
0 Kudos