Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a field that is in degree minutes seconds, populated from ET Geowizards COGO Inverse tool. It populates the values as 90-12-28.15 where 90 is the degree, 12 is the minutes and 28.15 is the seconds.

I need to use this field to label on a map. The format of the label is calling for the degree minutes seconds characters (i.e. 90° 12' 28.15") so I want to add a new field and use VB/Python to field calculate these characters in and remove the dashes.

share|improve this question
up vote 6 down vote accepted

The following Python field calculation script should work for you (tested in ArcMap 10.0):

Your expression should be:


And your code block should be:

def calc(val):
    val = val.split('-')
    return u'%s\u00B0 %s\u2032 %s\u2033' % tuple(val)

The \uXXXX characters are special unicode characters for °, ′, and ″ (thanks to Mike Toews)

share|improve this answer

Your Answer


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.