We presented a workshop on Mesh layer in QGIS during FOSS4G in Bucharest. Below is step-by-step guide for those who'd like to know more about mesh layers in QGIS.
Data for this tutorial can be found here.
In this tutorial, we are going to work with a mesh layer in QGIS.Throughout this tutorial you will learn to:
For the purpose of this tutorial, we are going to use the ERA5 datasetfrom ECMWF:
(the data in the first link should contain what you need to proceed withthis tutorial).
Before loading the mesh layer in QGIS, we are going to add the world mapas a background layer.
In QGIS, from the Browser panel, browse to the downloaded data >Working with mesh layer > vector_data.gpkg and add world_map layer.
You can change the project background layer to blue to have an imagesimilar to the one below:
To add the mesh layer:
In QGIS, from the Browser panel, browse to the downloaded data >Working with mesh layer and add Hurricane Michael data from CopernicusECMWF.nc as a mesh layer (not raster).
Depending on your QGIS settings, the CRS setting window might appear.Ensure you assign EPSG:4326 to the mesh layer.
To change the mesh layer style:
In QGIS, from the layers panel, select the mesh layer and press F7
The layer styling panel will appear on the right of your QGIS window
Within this panel, you can switch on/off quantities, vectors, style thelayer and browse through time.
Below, we are going to switch on the wind data and style it:
On the Style panel, click on Symbology tab
You can change the blending mode to Darken and you will see an imagesimilar to the one below:
To style vector component of the wind data:
If your mesh layer has time dimension, you should be able to browsethrough time using the slider provided under the settings tab:
Note that the time reference does not always parse correctly. To changethe time (if you know the correct format and starting date/time):
Click on the setting in front of time
In the new window:
To plot time series, you will need to install Crayfish plugin from QGISplugin repository. Once the plugin is installed:
In QGIS, from the main menu > Mesh > Crayfish > Plot
An empty plot appears at the bottom of your QGIS window. To generatetime series for multiple points on the map:
Make sure you have the following settings
Layer: Hurricane Michale data from Copernicus ECMWF
Plot: Time series
Group: [current]
And then click on From Map: Point
Hold Ctrl key on your keyboard and click on the locations you want toplot time series:
A series of graphs will be plotted for each point with matching colours.
You can also create long profile (including aggregated long plot) for aspecific time step.
To export mesh to a raster or vector, you can use the processingtoolbox:
In QGIS, from the main menu > Processing > Toolbox
Under Crayfish algorithm, double click on Rasterize
A new window will appear:
Similarly, you can export your mesh to points or polygon for each timestep.
To export to animation, you can set up a print layout template.
Ensure you have selected 10 m wind quantity from the mesh layerproperties panel
Right-click on Hurricane Michael data from Copernicus ECMWF and selectExport to animation
Set the correct parameters for start time/end time
Set the values for time, legend, title, etc
Set the filename for the animation file
Mesh calculator is similar to the Raster calculator with the followingadded functionalities:
Try to calculate the maximum precipitation values for HurricaneMichale data from Copernicus ECMWF dataset
Let's make the QGIS work for you
Lutra Consulting is a QGIS-focused expert provider of geospatial software development, consulting, training, and support services.