Quick tip if you get data coded with your lat long coded in Deg, Min, Sec
Open your table -> Calculate Field -> New Field = Lat
Field Type = Float
Lat = ConvertLat(!START_LAT__DDMM_MM_!)
def ConvertLat(lat):
d = lat[-7:-5]
m = lat[-5:-3]
s = lat[-2:]
return float(d) + float(m)/60 + (float(s)/(60*60))
Do the same thing for Long, keep in mind you may need to add a “-” to your calculation.
Field Name = Lon
Field Type = Float
Lon = ConvertLat(!START_LON__DDMM_MM_!)
def ConvertLat(lon):
d = lon[-7:-5]
m = lon[-5:-3]
s = lon[-2:]
return -(float(d) + float(m)/60 + (float(s)/(60*60)))
if your decimal is DD MM.MMM then you can use
def ConvertLat(lat):
d = lat[:2]
m = lat[3:8]
return float(d) + float(m)/60
Don’t forget to add – if W or S
def ConvertLat(lon):
d = lat[:2]
m = lat[3:8]
return -(float(d) + float(m)/60)