micmacIGN / micmac

Free open-source photogrammetry software tools
http://micmac.ensg.eu
Other
686 stars 150 forks source link

Negative altitude with XifGps2Txt #181

Open harlock974 opened 2 years ago

harlock974 commented 2 years ago

XifGps2Txt doesn't seem to take into account the Exif.GPSInfo.GPSAltitudeRef tag and so doesn't output negative altitudes.

Example :

$ exiv2 -pa DJI_0151.JPG |grep Info.GPSAltitude
Exif.GPSInfo.GPSAltitudeRef    Byte        1  Below sea level
Exif.GPSInfo.GPSAltitude       Rational    1  10.1 m

$ ./mm3d XifGps2Txt DJI_0151.JPG OutTxtFile=/dev/stdout
"DJI_0151.JPG": 1 matches.
DJI_0151.JPG : WGS84(rad) [0.963989,-0.366831,10.1] GeoC  [3.3966e+06,4.89299e+06,-2.27324e+06]
"stdout": 0 matches.
DJI_0151.JPG 55.232528 -21.017850 10.100000 

If all altitudes are negative, a possible workaround is to use awk after XifGps2Txt on the created file, e.g. :

awk -i inplace '{print $1,$2,$3,-$4}' GpsCoordinatesFromExif.txt