12

I have a series of coordinates (e.g. 38,40.1365N, 75,4.23933W) that I cannot make sense of. These coordinates were with the pictures taken with iPhone 12. I need to know their type so that I can then convert them to standard coordinates accepted by ArcGIS.

2
  • 3
    WGS84 maybe, but with a comma for designing ° (degree)? And a decimal minute value. Would it make sense in your situation? Sep 25 at 19:04
  • Yep makes sense now Sep 25 at 19:42
17

Mobile devices use WGS84 coordinates, and the coordinates might be displayed in different formats. One of them is DDM format. A comma for separating degree and minute, a dot for decimal. Your coordinates look like in that format.

DD: Decimal degrees. Ex: 38.2045 N
DDM: Degrees decimal minutes. Ex: 38° 40.1365' N
DMS: Degrees minutes seconds. Ex: 38° 40' 20" N

I think it is a very rare case. In many cases, it is represented as a DMS or DD.

A short Python script converting DDM string above to latitude and longitude values:

def get_lat_lon(s):
    
    # split by comma
    l = s[1:-1].split(',')

    # get lat lon without direction
    lat = int(l[0]) + ( float(l[1][:-1]) / 60) # -1 for skipping direction letter
    lon = int(l[2]) + ( float(l[3][:-1]) / 60)
    
    # check cardinal direction letter
    if l[1][-1] in ['S', 's']: lat = -lat        
    if l[3][-1] in ['W', 'w']: lon = -lon
        
    return lat, lon

s = "(38,40.1365N, 75,4.23933W)"

lat, lon = get_lat_lon(s)
5
  • Thanks, I am trying to write this script in php. Sep 25 at 19:38
  • I don't have any experience on PHP. I've added Python script, since ArcGIS uses Python. Sep 25 at 19:40
  • pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/… is where I checked it should be DDM not DMM
    – PolyGeo
    Sep 25 at 20:50
  • @PolyGeo DDM is more reasonable. I saw as DMM in Google Maps Docs Sep 25 at 20:57
  • BTW, the raw geolocation metadata in Exif photos is apparently stored as three numbers (degrees, minutes and seconds) per coordinate… but each of these numbers can itself be a fraction. (Why it was designed that way, I have no idea. A single fraction field would've been more than enough to accommodate all the common formats without rounding.) Anyway, the OP's weird text format is not actually the raw geolocation data, but something generated by some other program that's extracting it from the photos. Sep 26 at 15:12
7

It looks like normal lat/lon:

38° 40.1365' N, 75° 04.23933’ W

DD MM SS:

38°40'08.2"N, 75°04'14.4"W 

or Decimal Degrees:

38.668942, -75.070656 
3
  • Thanks, your converted values to decimal helped in writing the conversion script. Sep 25 at 19:40
  • Is it really "normal", though? To me, it looks like a horrible, confusing notation, with the mix of dot and comma. Sep 26 at 11:51
  • dots: decimal separator; comma: delimiter of lat/lon values
    – Babel
    Sep 26 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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