WMS – Querying Custom Dimension of NetCDF Raster

geoservernetcdfrasterwms

I have a NetCDF raster with mean temperatures, having this structure:

Dimensions:      (horizon: 13, percentiles: 3, lat: 213, lon: 274)
Coordinates:
  * lon          (lon) float32 -79.71 -79.63 -79.55 ... -57.13 -57.05 -56.96
  * lat          (lat) float32 62.62 62.54 62.46 62.37 ... 45.12 45.04 44.96
  * horizon      (horizon) datetime64[ns] 1951-01-01 1961-01-01 ...
2071-01-01
  * percentiles  (percentiles) int64 10 50 90
Data variables:
    tg_mean      (horizon, percentiles, lat, lon) float64 ...

I am serving this raster as a WMS layer with GeoServer (along with the NC plugin) and I'd like to know if there's a mechanism to select particular values for the dimensions, through the query. Given its type, it seems that horizon is automatically detected as the TIME dimension (as I can see in the "Layer -> Dimensions" tab of the GUI), which means I can use it in a query, but for percentiles, even though I can enable it as a "custom dimension" (in that same tab), I cannot figure out how to use it in the context of a query. Is that simply possible?

Best Answer

Dimensions are used by prefixing the dimension with DIM_ in the query. Just add &DIM_PERCENTILES=your value to the query.

The DIM_ prefix is specified in the WMS specification and is not a GeoServer specific feature.

See Are Dimensions/Attributes Other Than Time and Elevation Possible for a similar discussion.

Related Question