mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.1k stars 3.46k forks source link

Corrupted altitude data in image geotagging #6800

Closed DanielePettenuzzo closed 5 years ago

DanielePettenuzzo commented 5 years ago

I tried geotagging images in qgc. I loaded my flight log and the images into qgc and everything seemed to work fine. When I open the image's metadata using exif I get the following metadata for the geotagging. Latitude and Longitude seem fine but the altitude data has an invalid format (ASCII and not Byte).

GPS Tag Version                    |2.0.0.0
North or South Latit                  |N
Latitude                                     |47, 21, 1.731
East or West Longitu                |E
Longitude                                  | 8, 31, 20.537
Corrupt data
The data provided does not follow the specification.
ExifEntry: The tag 'GPSAltitudeRef' contains data of an invalid format ('ASCII', expected 'Byte').

Anyone knows where the issue could be?

DanielePettenuzzo commented 5 years ago

FYI @dogmaphobic @LorenzMeier

DonLakeFlyer commented 5 years ago

@birchera I don't know anything about the exif format. Does this ring a bell?

birchera commented 5 years ago

No, I haven't ever seen that. Strange, because then lat and lon should have the same problem.

kikislater commented 5 years ago

May be allowing to find solution, there is a note on exiftool documentation :

When adding GPS information to an image, it is important to set all of the following tags: GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, and GPSAltitude and GPSAltitudeRef if the altitude is known

https://sno.phy.queensu.ca/~phil/exiftool/TagNames/GPS.html

So for latitude example, information should be written twice in exif with these GPSLatitude and GPSLatitudeRef. I had problem in the past to write exif in picture and it was solve applying exiftool rules !

GPSAltitudeRef : 0 = Above Sea Level, 1 = Below Sea Level

DanielePettenuzzo commented 5 years ago

Apparently the gpsAltRef has to be 0 or 1 but the type of this value has to be uint8 instead of string. With this change I solved my issues: https://github.com/mavlink/qgroundcontrol/pull/6810 Now the exif editor doesn't give me the error anymore and when I feed the geotagged images to pix4d the geotagging is used.

GPS Tag Version     |2.0.0.0
North or South Latit|N
Latitude            |47, 21, 0.594
East or West Longitu|E
Longitude           | 8, 31, 17.244
Altitude Reference  |Sea level
Altitude            |481.10