CNES/MAJA

Process MAJA outside the SRTM range

FerdinandKlingenberg opened this issue · 10 comments

Hi,

We are planning a large project of processing Sentinel-2 covering the whole Norway, but we noticed that the current version of Maja does not support processing data beyond 60 degrees north.

Is it true that Maja V3.3 can only process data within the SRTM range or is it possible to tweak the SRTM DTM and the SBWD to one's own dataset that is beyond the SRTM range? We really want to process data beyond 60 degrees north, but this is outside the SRTM range. We have a free and open DTM that we can use.

My following-up question is, will the next version of Maja be possible to use your own DEM or other DEMs that goes above the SRTM range? And if so, do you by chance know when this new version of Maja will be released?

Many thanks for your help!

Kind regards,

I asked the same question two weeks ago (to myself). One obvious way to process outside the SRTM range is to create the files prepare_dtm would create – just filled with data taken from your (non-SRTM) digital elevation model and water body data.

You would need a tool that produces output which formally produces the same output as prepare_dtm does but takes other DEM and water body data for input. Would be nice if such a tool were included with Maja / Start-Maja.

Yes, we would like to have that too, and its in our action list, but we are a small team...

Hi @octoflar and @olivierhagolle

Thanks for the quick response. I will check the DTM and the water mask for one Sentinel-2 scene below 60 degrees north and try to convert with my own dataset. In the meantime, we look forward to the new features and the new version of Maja.

Kind regards,

Hi,

It is possible to add this functionality for a new DEM type using the prepare_mnt.mnt.MNTBase class. You will need to implement the following:

  • Create a new class, <YourNewDEMType>.py inheriting from MNTBase. You can see an example of that in SRTM.py.
    In that class, implement:

  • prepare_mnt: Returns a filepath to the DEM at full resolution with the same extent and coordinate system as your input product extent - I.e. a single Sentinel2 tile. This is the important step that needs to be fulfilled in order to interface later with the to_maja_format() function.

  • get_raw_data (Optional): Download the DEM data from a given provider automatically and return the filenames to the downloaded archive(s).

  • Finally, add your new class to the MNTFactory.py

Thanks for this information @petket-5, this would help us a lot!

Kind regards,

Thanks for this information @petket-5, this would help us a lot!

Kind regards,

Did you succeed with it? Do you also work on the WorldCover project?

Thanks for this information @petket-5, this would help us a lot!
Kind regards,

Did you succeed with it? Do you also work on the WorldCover project?

Hi,
I am sorry, but I did not get enough time to finish the job. I will let you all know if I succeed. I hope that I will have more time next coming weeks. Meanwhile, I will be very happy if you share your knowledge if you succeed.

No, I do not work on WorldCover project, but it looks like a nice project after reading a little about it.

Kind regards,
Ferdinand Klingenberg

Hi @octoflar,
I think I succeed to use our custom DEM, but since we still have not setup our hardware for our project I am not able to test it out properly. At least the modification I did on the branch "reprog-rc1" returned no error messages, and the DTM prep files is kind of similar to the original run (on SRTM data of southern Norway), but they differ because of different resolution of SRTM and our DEM.

If you want to try out, you can check my forked version: Link
Note, it is probably possible to clean up the code even more, but for now it is working, regardless if you processing with your own DEM either inside or outside the SRTM range.
If you want to test with my DEM (on the Sentinel-2 tile 32VMK), please let me know, and I can send it to you. I will be very pleased to know if it work properly.

Best regard,
Ferdinand Klingenberg

Hi @FerdinandKlingenberg, thank you very much for your message 👍 I'll let you know my test results.

With best wishes,
Ralf

We managed to manipulate the EU-DEM to use our own national wide DTM with the latest MAJA 4.2 version.