This utility generates an ASCII-raster file based on a 2D surface mesh. A raster is superimposed on the mesh and pixel values are set to the surface elevation at each pixel’s position. If no mesh element is located beneath a pixel it’s value is set to NODATA.
The tool is part of the official OpenGeoSys git repository.
c specifies the cell size (i.e. pixel size) of the raster. While optional, it is still recommended to choose a value as the default will be set to the minimum edge length in the input mesh which for unstructured grids may result in a very fine and (extremely) large output raster.
The input mesh for this example is a homogeneous, unstructured triangle mesh with an average edge length of 100m.
Mesh2Raster -i input.vtu -o output.asc -c 50
The generated output raster has a size of 340x333 pixels and represents the original surface well. Given the average edge length of 100m in the original mesh, an even smaller cellsize would not have contained more details but resulted in a larger file size.1
Mesh2Raster -i input.vtu -o output.asc -c 200
The generated output raster has a size of 85x84 pixels and still represents the original surface reasonably well, despite visible undersampling.
Mesh2Raster -i input.vtu -o output.asc -c 1000
The generated output raster has a size of 17x17 pixels and shows severy undersampling. However, this is the resolution that a large number of weather data products are available at.
The resulting ASCII-rasters can be used to represent surface data in geographic information systems. In the absense of input data, a detailed raster can also be used by OpenGeoSys preprocessing tools to generate new surface meshes with different resolution or properties.