Tutorial suitable for Agisoft Metashape Professional edition. DJI is writing two altitude information to the image metadata (XMP header of the image) - AbsoluteAltitude and RelativeAltitude (the latter defines the height above the take-off point). To the image EXIF the AbsoluteAltitude value is written. 

In some cases the default height in EXIF (AbsoluteAltitude) is incorrect. Metashape just reads EXIF and populates the corresponding fields of the Reference pane without any additional transformation of the coordinates. And if the invalid altitude information is read, then some additional corrections may be required. 

If the height above the ellipsoid of the take-off point is known, you can read the RelativeAltitude from the meta-information using the following script:


And then add the known offset using another script:


How to work with these scripts:

1. Download the scripts from the links above (just plain text .py files).

2. Select Tools > Run script command.

3. Specify the path to the script file and click OK:

After that, you can find a new tab in the Main Menu: Custom menu. 

4. Select Custom menu -> Add reference altitude...or Read altitude from DJI metadata

5. Specify the height offset in the dialog window:

6. Click OK button and the input altitude value will be added to all the camera coordinates in the Reference pane.

7. After correcting the altitude information press Update button on the Reference pane to apply the changes.

Additional notes regarding DJI data processing:

  • when working with DJI drone images we usually suggest unchecking Adaptive Camera Model Fitting option in the Align Photos dialog and during the Optimization include all the parameters except K4. 
  • if Phantom RTK is used, enable load camera location accuracy from XMP meta data option in the Advanced preferences tab prior to the image loading in order to read and apply the measurement accuracy of the camera locations data. 
  • if no GCPs are used for Phantom RTK projects, it may be reasonable to enable Fit additional corrections option in the Optimize Cameras dialog.