Developer’s Corner: Raster Views in GeoServer via the CoverageView concept
in this post we would like to talk about some developments we have performed lately to support coverage views in GeoServer where a CoverageView is made by composing different bands originally available inside coverages (either bands of the same coverage or different coverages) of the same store.
Some examples of usage of this capability:
- Right now, physical entities for some metoc models are exposed as different coverages in GeoServer. As an instance, if you think about a NetCDF dataset storing meteo model, you may have an U coverage for the U component of the Wind and a V coverage for the V component of the Wind. However it’s often useful, if not mandatory, to expose a Wind coverage with 2 bands (U and V) or a single Wind coverage made of 2 bands (Speed and Direction).
- Some Meteosat datasets are made of N different channels (as an instance, 12 channels exposed as 12 different coverages, in some cases) on top of which we would like to define a “Vegetation” coverage made of channels #3,#2,#1.
As you know, for vectorial data, you may configure an SQL View starting from a DataStore. This will allow configuring a new Layer which is an SQL view of an existing store. The concept of CoverageView allows to do similar thing for raster data: once a CoverageStore is selected, you may create a CoverageView on top of the coverages internally available on that CoverageStore (no need to configure single layers associated to underlying coverages).
At this preliminar stage, the offered capabilities are basic: just selecting the input coverages to be merged into a coverage view. Moreover, coverages should respect some constraints:
- same CRS
- same resolution
- same bbox
- same data type
- same dimensions (same number of dimension, same type, and same name)
In the near expect more goodness:
- ability to perform raster algebra on the input bands
- ability to force specific bbox, resolution and so on
Example of usage: defining a currents CoverageView made of u and v components of the water current
In the CoverageView editor we are configuring a currents coverage made of the u and v components of the current surface.
Once done, clicking save will redirect to the layer configuration page, where you can notice the presence of the 2 bands:
Once the layer has been saved, we can test this, as an instance, through a GetFeatureInfo request from the integrate OpenLayers MapPreview:
A potential use case that we can now cover is the ability to turn this raster layer into a vector current field. You can get some hints by looking at this blog post about Wind Barbs.
Additional documentation is available here. The related code currently lives on GeoServer master hence it will be available in GeoServer 2.6.x, although a backport is not unlikely to be done since we have already performed it internally and it under our Continuous Integration infrastructure.
It worth mentioning that this work was performed as part of our GeoSolutions Enterprise Services offer, hence if you want to know more about how we can help your organization reaching its goals, feel free to contact us!
The GeoSolutions team,