AnsweredAssumed Answered

Calculate geometry (lat/long for a projected points layer) with python geoprocessing

Question asked by morangm on May 19, 2012
Latest reply on May 21, 2012 by bharold-esristaff
As part of a longer script I'm writing, I need to add fields to my points layer and put the lat/long coordinates in those fields.  This is so EASY to do manually by opening the attributes table, adding the fields, and doing a "Calculate geometry."  There's an option to tell it what units you want.

I keep trying to find a way to do this with python geoprocessing, and I can't figure it out.

I was using AddXY_Management, but this only yields the X and Y coordinates in whatever projection my points layer happens to be in.  CalculateField_Management won't let me specify the units for a points layer (or if it does, I can't figure out how).

Anyone know how to do this?  I feel like it should be easy and I'm just missing the magic python command.

Outcomes