Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a layer in WGS84 (Geographic, DD) that I need to label in DDM (Degrees Decimal Minutes).

I need to calculate within an arcpy UpDateCursor, a label field with DDM in it.

I saw that you can run the Convert Coordinate Notation, but I need to be able to calculate these labels on the fly within my cursor (this script is also moving points around).

After trapsing through the Esri forums I have not seen any snippets with how to achieve this.

This is likely a noob question, but this is very early steps for me any arcpy.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Assuming your points are in DD:

import math

def dd_to_ddm(val):
    minutes, degrees = math.modf(val)
    minutes = abs(minutes) * 60
        return "%i° %f'" % (degrees, minutes)

share|improve this answer
    
perfect, thanks! –  Simon Aug 1 '12 at 10:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.