Directory / folder structure of DEM directory

Dear all,
Ive got a question regarding the Orthorectification application. In my understanding of the manual, a DEM directory can be provided with the -elev.dem directory parameter. I have succesfully done this with adding one directory, without any subdirectories, providing all the SRTM tiles.

Now my question is, because I want to try to use a DEM which is divided in different tiles with different subdirectories:
What kind of directory structure is required? And as a follow up question, how does orfeo retrieve the correct DEM tile from all the SRTM tiles in the -elev.dem directory?

Thanks in advance,

Dear @Matthijs-Oosterhuis,

The OTB will look for all files located in the directory you provided, and its subdirectories. So, the structure is not important.

Julien :slight_smile:

1 Like

Thanks for the quick answer! How does it know if the location of the satellite image is the same as the DEM file?

OTB doesn’t check if the image is within the DEM footprint.

If the image is outside the DEM, the default value will be used (see the parameter -elev.default).

Alright, in other words, only one DEM image should be in the DEM folder, otherwise it uses the default? I wonder how it seems to have made a difference in my SRTM folder with many SRTM images present.

According to the manual:

" DEM directory -elev.dem directory
This parameter allows selecting a directory containing Digital Elevation Model files. Note that this directory should contain only DEM files. Unexpected behaviour might occurs if other images are found in this directory."

This does suggest there can be multiple DEM files in the DEM directory, how does orfeo pick the correct DEM file in this case?

Sorry, I think that I was not clear.

The DEM files included in the directory are load into memory. When OTB needs the elevation of a particular point, it uses the DEMHandler which relies on GDAL to retrieve the elevation from the DEM files in memory. If GDAL doesn’t find the point in the footprint of the DEM, it returns the default value.

1 Like

Alright, thanks, that does indeed clears it up! This link is the one then that I should be looking at, now its more clear: DEM Handler — Orfeo ToolBox 7.4.0 documentation
Regards and thanks for the support,