English

How To: Convert Decimal Minutes to Decimal Degrees using the Field Calculator

Summary

Instructions provided describe how to convert decimal minutes data to decimal degrees (DDEG) data. This script works for string decimal minutes values in the format of: <Deg> <space> <Decimal_minutes>.

For example:

-10  30.57
100 49.3
0 25.2789
45 0
-2 0.25

Procedure

  1. Create a new field with data type 'double' to store the DDEG data.

    A. Click Options in the table where the field will be added.
    B. Click Add field.
    C. Type the name of the field.
    D. Click the Type dropdown arrow and select Double.
    E. Click OK.

  2. Select Editor > Start Editing from the Editor toolbar.
  3. Right-click on the new field and select Calculate Values.
  4. Click the Advanced check box.
  5. Copy the following code into the Pre-Logic VBA Script code:

    Code:
    dec_min=[dec_min]
    if IsNull(dec_min) or dec_min = "" or IsEmpty(dec_min) then
    dec_deg = 0
    else
    space_pos=InStr(dec_min," ")
    deg=Left(dec_min,space_pos-1)
    min=Right(dec_min,Len(dec_min)-space_pos)
    min=min/60
    if deg < 0 then
    dec_deg=(Abs(deg)+min) * -1
    else
    dec_deg=deg+min
    end if
    end if

  6. On line 1 of the code sample, change [dec_min] to be the name of the field that stores the decimal minutes values.
  7. Type the word 'dec_deg' in the text box under [Your field Name] =.
  8. Click OK.