Select to view content in your preferred language

UTM to DMS?

1282
6
07-25-2013 01:43 PM
DustinHolt
Deactivated User
Does anyone have a script for field calculator to convert UTM in Degrees minutes second?
Tags (2)
0 Kudos
6 Replies
AnthonyGiles
Honored Contributor
Dustin,

Have you looked at the Convert Coordinate notation tool:

http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000tw000000

Regards

Anthony
0 Kudos
RhettZufelt
MVP Notable Contributor
not sure if you mean the Field Calculator or the calculateField tool.

if you want to do it within arcmap, you can just right-click on the column header, pick calculate geometry, and select what coordinate system you want the values calculated from.

R_
0 Kudos
DustinHolt
Deactivated User
I have used the Convert Coordinate notation tool, but it creates a new feature class and since this layer is going to be updated often it would be kind of a pain.

I'm looking for a script that I could use in the field calculator so the conversion would update in the attribute table.
0 Kudos
RhettZufelt
MVP Notable Contributor
Well, since you ignored the post about being within ArcMap, I'm going to have to assume that when you say Field Calculator, you actually mean the calculateField python tool meaning that you want to do the entire thing in code without having to open ArcMap.

One option would be to run the

ConvertCoordinateNotation_management (in_table, out_featureclass, x_field, y_field, input_coordinate_format, output_coordinate_format, {id_field}, {spatial_reference})

tool using your OID (or other unique field in your data) as the id_field (which is specifically included to allow for joins back to the original table).   As you said, this would create a new FC, but could be saved in_memory to increase speed.

Then makeFeatureLayer on your original table so that you can do one of the following (won't work direclty on the FC):

Now, if you want to add these new coordinates to the existing table, use the joinfield tool to add the new columns to the original table.

Or, if you want to "update" some existing fields in the original FC, you would use addJoin to join the two together, then caclulateField and calculate the existing field(s) to the newly joined fields, then remove the join and you are done.

R_
0 Kudos
DustinHolt
Deactivated User
Thanks for the information. This is a new area for me and I may have not been asking the right questions, but is gives me a good place to start.
0 Kudos
RhettZufelt
MVP Notable Contributor
No worries.  Didn't mean to sound snotty or anything.  Wasn't sure if you were asking the correct questions, that is why I tried to clarify in my first post.

Seems to be the norm to not reply to post that don't seem to "apply", so, from that, I figured that you must be asking for code only solutions.

R_
0 Kudos