Background
MIKE+ uses Digital Elevation Models (DEM) for various purposes, for example:
1. to fill in missing ground levels at nodes of water supply or sewer networks.
2. to trace the location of a river bed.
3. to add heights to a 2D mesh.
Occasionally terrain models are delivered in the form of separate tiles, while some tools require a continuous terrain model in one single file.
Strictly speaking, tools can be applied in three ways:
# 01 - Merge: Tiles that touch each other are merged into one file.
# 02 - Resampling: When merging, the cell size can be enlarged if unnecessary details or data noise are to be ignored.
# 03 - Conversion: Since the tool can read GeoTIFF, Esri ASCII Grid and dfs2 files and write them independently of the input format, it can also be used for pure conversion.
The Combine DEM Files Tool
The tool is accessed through MIKE+ GUI, under Tools (Fig. 1).
Fig 1- Combine DEM Tool
Input Files
The following data formats are supported, whereby all tiles must have the same data format:
- Esri ASCII grids (*.asc, *.txt)
- Raster data in DHI format (* .dfs2)
- GeoTIFF (*.tif, *.tiff)
An Esri ASCII Grid must be present in the gridline registration. i.e., in the header of the text file the origin must be defined via parameters xllcorner and yllcorner.
If, on the other hand, the Esri ASCII frid is defined in the pixel registration with xllcenter and yllcenter, the file is shifted by half grid width- a correction of the tool is being worked on. As a workaround you will have to manually adjust the header of the *.asc file to xllcorner and yllcorner and move the coordinates half a cell width down to the left.
If the files are not real GeoTIFF files but TIFF files without geographic metadata, a world file with the same file name and the extension *.tfw must be available for each tile to establish the spatial reference.
All tiles must have the same resolution (i.e. the same cell size).
Overlapping tiles are not supported. If the situation is found a warning is given and the process is cancelled.
However, gaps are allowed, in which case empty cells are written in the output DEM. This can happen, for example, if the project area deviates from a rectangular shape and some tiles are not required.
Fig 2 - example of a working area with valid missing tiles
In Figure 2, some tiles are missing because they are outside the editing area. The tool will use "Delete Values" for the areas that are left out.
Output DEM
The result can be saved in one of the following formats, independent of the input tiles:
- Esri ASCII Grid (.asc, .txt)
- Raster data in DHI format (*.dfs2)
- GeoTIFF (*.tif, *.tiff)
Note on the coordinate reference system
Only GeoTIFF and dfs2 store the coordinate reference system in the metadata of the file.
- If you convert within GeoTIFF, within dfs2 or between GeoTIFF and dfs, the coordinate reference system is retained.
- When converting from Esri ASCII Grid to dfs2 or GeoTIFF, the coordinate reference system is left blank.
- If you convert from dfs2 or GeoTIFF to Esri ASCII Grid, the coordinate reference system will be lost because Esri ASCII Grid does not store a coordinate reference system.
Avoid using a different coordinate reference system in the project than your raster data has, otherwise you will be confronted with confusing warnings.
Result type in the dfs2
The name of the result in dfs2 files "Combined DEM", the type is "Elevation", the unit must be specified.
Rotation is ignored
When converting from dfs2 to GeoTIFF or Esri ASCII Grid, a warning is issued regarding the rotation angle.
"Validating tiles...
Merge tiles data...
Save data...
Warning: Rotation for Tiff is not supported and will be ignored when saving
Warning: Rotation for ASC is not supported and will be ignored when saving"
If they are typical DEM tiles, the deviation from geographic north is very small and you will not notice any difference on the site plan. Read more about this in our User Guide Geodesy in MIKE Zero - Map Projection and Datum Conversion, chapter Grid Orientation.
Resampling Factor
Theresampling factor can be used to coarsen the resolution of the output DEM. The cell width of the output DEM is equal to the cell width of the input tiles times this factor.
- With a factor of 1, the output DEM uses the same cell size as the input tiles
- If the resampling factor is greater than 1, the mean value of all underlying cells in the input DEM is formed in the output DEM.
Resampling starts from the lower left corner of the input area (Fig. 3):
Fig 3 - Resampled DEM vs original tiles
On the left are the identically coloured original tiles. The resampled DEM is superimposed on the right. The factor of 50 his very large in order to make the effect clearly visible. You can see that the resample process starts at the lower left corner. At some edges, the tiles hang over the initial data, depending on how it turns out with the selected tile width.
Explanation | |
Insert | Adds one or more tiles; in the map the outline of the tiles is shown in light grey. In the selection dialogue several tiles can be selected with <Ctrl>+<click>. |
Delete | Removes the selected tile from the list |
File [...] | Selection dialogue for specifying the output file |
Resampling factor | Factor indicating how many times the new cell width should be larger than the old one; default = 1, i.e. the cell width remains the same |
Run | Executes the operation without closing the tool |
Close | Closes the tool without clearing the list of input tiles. |
Fig. 4 - Tabular description of the tool fields
Other methods for converting raster data
In the MIKE Zero Toolbox there are two tools Grd2MIKE and MIKE2Grd, each of which can be used to convert a file from Esri ASCII Grid to dfs2 or vice versa. It is not possible to merge several files. The main strength of both tools is that you can directly choose the name and type of the result. In addition, a batch file can be started so that many raster files can be converted at once.
Have you seen our latest video tutorial "MIKE+ | Understanding the Combine DEM Tiles tool" presented by Thomas Telegdy, our MIKE+ Product Specialist? In just under 10 minutes, you will be walked through the most important features of the tool. Enjoy!
FURTHER INFORMATION & USEFUL LINKS
Manuals and User Guides
MIKE+ User Guide. Model Manager
MIKE+ User Guide. 2D Overland
MIKE+ Documentation Index
Video tutorial
MIKE+ | Understanding the Combine DEM Tiles tool