Developer’s Corner: Supporting Wind Barbs In GeoServer and GeoTools
in this post we would like to talk about the work we are doing to improve support in GeoServer for serving Meteorological and Oceanographic data, specifically the ability to render raster data for wind models using Wind Barbs.
When ingesting and serving MetOc models (raster data) for Wind data you are now already able to render them using an arrow symbology by concatenating:
- the gs:rasterAsFeatureCollection Rendering Transformation to transform the raster dataset into a series of vector points where the bands of the input raster data are the attributes
- a vector style to create arrows for each point with proper module and rotation controlled by the module and direction of the Wind data
With this approach you can obtain something like the following:
There are a few drawbacks in this approach which are trying to improve in GeoServer, namely:
- it is not uncommon to draw too many symbols depending on the resolution of the underlying data which makes the visualization slow and cluttered. It is possible to use the standard techniques in GeoServer to reduce the cluttering but this happens once you have generated the vector points with the gs:rasterAsFeatureCollection Rendering Transformation hence it is a slow process (think about collision detection and conflict resolution)
- meteorologists want Wind Barbs and not simple arrows
We are currently working to improve point 1, we will describe that work in a different post. As of point 2 we are going to provide native support for Wind Barbs by developing a new graphic factory for GeoServer (actually for its rendering engine which is developed using GeoTools) which would allow to render vector points a as Wind Barbs this way:
which allows us to:
- extract the speed from the respective speed attribute (yes, we have renamed the underlying raster band to speed)
- specify the unit of measure of the speed. Note that Wind Barbs always deal with speed in knots. Therefore, specifying the input unit of measure allows the factory to do the proper conversion to knots.
rotation can be applied as usual for point vector symbologies. The full style can be found here below:
notice the usage of the gs:RasterAsPointCollection Rendering Transformation to turn the raster into a series of vector points. This feature is being developed as we speak, it will be first available on the development series of GeoServer (2.6.x) and then will be backported to 2.5.x. More on the work that we are doing for improving the support for Meteorological and Oceanographic data will be reported in the next posts. It is worth mentioning that this work is being performed under our GeoSolutions Enterprise Services framework contract.
The GeoSolutions team,