Agisoft Metashape

Agisoft Metashape => General => Topic started by: volantdrone on January 05, 2022, 05:27:37 PM

Title: Creating / Exporting DEM for Terrain Awareness DJI M300RTK
Post by: volantdrone on January 05, 2022, 05:27:37 PM
Hello,
Ive been working with Metashape Pro for a few weeks; I have created some wonderful models but cannot seem to create (or export at the right size) a DEM that is smaller that 20MB, with a spacial resolution of less than 10 fee. The goal is to fly a DJI Matrice 300RTK in Terrain Awareness mode, but the GEOTIFF must be smaller than 20mb. Any suggestions how to generate files that meet these requirement? My files are significantly larger and I'm not sure what I need to change to make them smaller.
Title: Re: Creating / Exporting DEM for Terrain Awareness DJI M300RTK
Post by: Paulo on January 06, 2022, 02:12:07 AM
Hello Volantdrone,

the DEM exported to geotff is represented by 32 bit (4 bytes) floating numbers. So for 20 MB = 20 971 520 bytes max export limit, you should export with split by blocks selected.

With block_width = block_height = n pixels,

Then n * n * 4 bytes < 20 971 520 bytes

or 4 n² < 20 971 520
        n  < sqrt(20 971 520/4)
         n  < sqrt(5 242 880)
         n  <  2 289.73.

So for DEM export without compression the block size should be something like 2280 by 2280 pixel....

However it seems that DEM export uses LZW compression so each pixel vaue can be compressed down to about 3 bytes from 4 bytes. Then block size can be increased to 2 600 pixels...

as 2 600 * 2 600 * 3 = 20 280 000 bytes < 20 971 520 bytes = 20 MB. So let us say your DEM resolution is 10 feet or 3 m then a 2600 pix by 2600 pîx DEM block  would cover a 7.8 km by 7.8 km area. 

You should test on your own data if this fits your needs as actual compression may vary according to elevation value range,
Title: Re: Creating / Exporting DEM for Terrain Awareness DJI M300RTK
Post by: c-r-o-n-o-s on January 06, 2022, 11:21:42 AM
Hello,

I can only report with the "Terrain Awareness" mode of the P4RTK.
The size limitation also has something to do with performance. On my remote, the handling of the DEM file is very slow.
When exporting the file, you actually only set the resolution to a lower value. With the Phantom, less than 5 metres are not taken into account at all.
If necessary, you have to create several files instead of one huge one that covers the whole project.