Skip to content

GPS coordinates always positive – missing hemisphere sign #31

@thomasjjj

Description

@thomasjjj

Description

When extracting EXIF GPS data, the script converts latitude and longitude to decimal degrees but does not check the hemisphere reference tags (GPSLatitudeRef and GPSLongitudeRef).

As a result, coordinates in the southern and western hemispheres are always plotted as positive, ending up in the wrong place on the map.


An image with:

  • GPSLatitude = 23°32′
  • GPSLatitudeRef = "S"
    should be -23.55, but it is stored as +23.55.

Before storing the decimal degrees, apply:

if lat_ref == 'S':
    lat_dd *= -1
if lon_ref == 'W':
    lon_dd *= -1

Impact

All south/west coordinates are incorrect.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions