-
Outputs description:
Prerequisite: A valid CDSE user account from https://dataspace.copernicus.eu/
Digital Elevation Models (DEM) are essential for geolocation and orthorectification in Sen2VM. Users can use different types of DEM (cf Inputs Description).
Sen2VM requires DEM data organized per square degree (see §DEM format requirements). The recommended way to obtain Copernicus DEM in the correct format is to use the CDSE-Copernicus-DEM-downloader tool, which downloads individual 1°×1° geocells from the Copernicus Data Space Ecosystem.
The CDSE-Copernicus-DEM-downloader is a lightweight tool that searches and downloads Copernicus DEM tiles by Sentinel-2 MGRS tile identifiers, producing the per-square-degree format required by Sen2VM.
Tip
This tool is included in the Sen2VM project under CDSE-Copernicus-DEM-downloader/. If you use the bundled copy, adjust the paths below accordingly.
-
Clone the repository:
git clone https://github.com/senbox-org/CDSE-Copernicus-DEM-downloader.git cd CDSE-Copernicus-DEM-downloader -
Download the Copernicus Sentinel-2 tiling system KML file from Sentiwiki, unzip it, and place the KML file in
./cdse-copernicus-dem-downloader/auxiliary/. -
Create and activate the conda environment:
conda env create -f environment.yml conda activate cdse-copernicus-dem-downloader
The tool accepts MGRS tile IDs (e.g. 32UMA, 31TCJ) or SAFE product names. Run from the cdse-copernicus-dem-downloader/ directory.
Single MGRS tile:
python cdse_copernicus_dem_downloader.py --m DGED --r 90 --t 32UMA --o /path/to/output/DEMMultiple tiles from a text file:
Create a file (e.g. input_tiles.txt) with one MGRS tile ID or SAFE filename per line:
32UMA
31TCJ
31TDG
Then run:
python cdse_copernicus_dem_downloader.py --m DGED --r 90 --i /path/to/input_tiles.txt --o /path/to/output/DEMOptions:
| Option | Description |
|---|---|
--r {30,90} |
DEM resolution in metres (30 or 90) |
--m {DTED,DGED} |
DEM model (DGED recommended for Sen2VM) |
--t TILE |
Single MGRS tile ID |
--i FILE |
Input file with list of tiles |
--o DIR |
Output directory for DEM files |
--config [PATH] |
Use XML configuration file |
--reset |
Reset stored credentials |
Note
On first run, you will be prompted for your CDSE username (email) and password. Credentials are encrypted and stored in credentials/credentials.yaml for later use.
Important
Sen2VM expects DGED format. DTED is not supported by Sen2Cor and may cause compatibility issues. Use --m DGED.
A more detailed user guide is available: CDSE DEM Downloader Quick User Guide
The Copernicus Data Space Browser offers a Copernicus DEM Mosaic workflow that produces a single raster covering your Area of Interest (AOI).
Warning
Do not use this workflow for Sen2VM. The DEM Mosaic outputs a single file that often spans more than one square degree. Sen2VM dynamically reads DEM data per square degree (cf input_description.md §1.3.1). When given a mosaic larger than 1°×1°, the code only loads part of it, resulting in geolocation without altitude data over the rest of the scene—and thus incorrect orthorectification. Use the CDSE-Copernicus-DEM-downloader instead.
If you still need to use the Browser workflow (e.g. for manual inspection or non-Sen2VM use):
- Go to https://browser.dataspace.copernicus.eu/ and log in.
- Define your AOI (polygon, file upload, or WKT).
- Search for Copernicus DEM, select format and resolution.
- Select a product, open the Copernicus DEM Mosaic workflow, and submit an order.
- Download the result when processing is completed.
Note
Copernicus DEM data is available in different formats and resolutions. Ensure you select the appropriate type for your use case (DGED recommended for Sen2VM).
Tip
For more details, refer to the official Copernicus DEM documentation.
- CDSE-Copernicus-DEM-downloader (GitHub)
- Copernicus Data Space Browser Documentation
- Copernicus DEM Product Description
- CDSE APIs Reference
