GPS Altitude rounded when written to Exif
Author: smathermatherCreated Feb 4, 2026Updated Feb 4, 2026
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)
Source: OpenDroneMap/ODM