15. March 2015

# How to create a wind map in QGIS

A few days ago I saw Franz Leonardo’s post on the ArcGIS group on facebook: He visualised wind speed and direction in ArcGIS for a wind map and I thought by myself: let’s do it with QGIS… Here is the tutorial which covers some aspects of interpolation, symbol levels, classification and formulas…

### The Data

The whole process starts with the values for seven point location which could be potential weather stations or simple observation points. We have values for direction and speed of the wind for a single event. If you only have horizontal and vertical speeds (which seem to be a common thing for wind data) you can convert it to speed and directions using this source.

 Station UTMX UTMY Direction Speed A 615380 9531496 22.5 15 B 616004 9533157 45 14 C 617620 9533808 90 12 D 619191 9532326 135 12 E 621295 9530663 112.5 5 F 622303 9533906 180 5 G 616992 9532169 22.5 13

You can simply convert it into a shapefile by adding it as a csv layer and save it as a ESRI shapefile (download it here). After this comes the more less hardest task of interpolation of values for the vector field. As we are concentrated on the visuals instead the math behind interpolation I simply used the interpolation plugin. Ujaval has a nice tutorial on the usage of this plugin. I ended up with using a standard IDW (Inverse Distance Weighted) interpolation for both the speed and directional values. Of course this is over simplified and you can get your hands dirty with this. If you want to make it right you might read these articles:

• Luo, W., Taylor, M. C. and Parker, S. R. (2008), A comparison of spatial interpolation methods to estimate continuous wind speed surfaces using irregularly distributed data from England and Wales. Int. J. Climatol., 28: 947–959. doi: 10.1002/joc.1583 | PDF

• Gumiaux, C., Gapais, D., & Brun, J. P. (2003). Geostatistics applied to best-fit interpolation of orientation data. Tectonophysics, 376(3), 241-259. | PDF
After finishing you might end up with three data sets: a point layer with the input points, one raster with directional values and one raster with speed values and it could look like this:

Wind speed interpolation raster in QGIS

Both raster will be the basis for our vector field. Now we have two possibilities: create a mesh of regular spaced points over the raster data or convert the raster to points… I’ll go with first one, as the second will result in 90.000 points which is a bit much. You can create a mesh by using Vector -> Research Tools -> Regular Points:

Regular spaced points

At this grid locations we need to extract the values of the both raster layers. YOu can do so by using the Add grid values to points function from the processing toolbox in QGIS. This function will extract the values from the selected layers so you don’t need to run an extraction twice as you have two input raster files. Nice! Now, your layer with regular spaced points should have an attribute with the direction data and one with the speed data.

### The Visualisation

Now let’s open the properties and adjust the style of the regular spaced points layer to create a stunning wind speed and direction layer. First we choose a graduated style and change the base symbol to be the arrow:

Arrow as symbol

After this make sure to select the entry “Simple Marker” to see the following dialog:

Marker dialog

And you can see I made some selections on the size and rotation tab and guess what: size = speed values and rotation = direction values. But why should I write so much and not show you the actual options I adjusted in a short video:

The result can look like this:

Vector field for wind data

I hope you like it. I’ll appreciate any comment!