Skip to content

GPS Altitude rounded when written to Exif #1989

@smathermather

Description

@smathermather

Via this post,

File: opendm/video/video2dataset.py
Altitude values are correctly parsed from the SRT file, but they are rounded to an integer when written to EXIF:
gps_ifd[piexif.GPSIFD.GPSAltitude] = float_to_rational(round(altitude))
# 192.048 -> 192

This causes loss of vertical accuracy, which is critical for RTK and precise ground surveys.
Suggested fix:
gps_ifd[piexif.GPSIFD.GPSAltitude] = float_to_rational(altitude)
or (to preserve millimeter precision with a stable denominator):
gps_ifd[piexif.GPSIFD.GPSAltitude] = float_to_rational(round(altitude * 1000) / 1000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions