NetCDF-family files configuration

In this sections two simple examples of configuration of a NetCDF and a Grib file are presented.

NetCDF

NetCDF file description

The following NetCDF file is part of the Polyphemus dataset already described. More specifically, this file contains 3 layers called NO2, V, O3. Each one of these 3 layers internally have elevation (called z) and time as additional dimensions.

From an abstract point of view, these layers can be seen as 2-dimensional arrays of 2D slices, where each array is composed by T x E slices where

  • T = number of temporal positions.
  • E = number of elevation positions.

Here you can find how the file is structured:

../../_images/netcdf_scr.png

Note

Note that the z-dimension will be referred as elevation in the next steps.

The GeoServer internal reader is able to parse the NetCDF file and configure the 3 different layers taking into account their additional dimensions. With the following example, we are going to understand how to access these layers.

Configuring a NetCDF file

  1. Go to Stores -> Add new Store. Then click on the NetCDF label:

    ../../_images/netcdf.png
  2. Enter testNetCDF for the Data Source Name field and $TRAINING_ROOT/data/user_data/multidim/polyphemus/polyphemus_20130303.nc ( or %TRAINING_ROOT%/data/user_data/multidim/polyphemus/polyphemus_20130303.nc on Windows, remind to use / in file selector ) for the URL field. Then press Save.

    ../../_images/storeNC.png
  3. Click on the Publish button of the first layer called NO2

  4. Then in the Layer configuration page you can see various parameters associated to the selected layer. Rename the layer testNetCDF, in order to avoid errors in the next sections.

    ../../_images/testNetCDF.png
  5. For configuring the time and elevation dimensions, you have to go to the Dimensions page and enable them. Also you should configure the Presentation as List in order to see these dimensions as separate values. The following settings allow to set specific time and elevation parameters for accessing a particular slice of the layer.

    ../../_images/dimNC.png
  6. Click on Publishing tab, and assign the N02 style as the default style of the layer.

  7. Click on Save, for saving the configuration.

  8. Execute the following requests:

    http://localhost:8083/geoserver/geosolutions/wms?service=WMS&version=1.1.0&request=GetMap&layers=geosolutions:testNetCDF&bbox=4.9375,44.96875,14.9375,50.96875&width=275&height=165&srs=EPSG:4326&format=image/png

    http://localhost:8083/geoserver/geosolutions/wms?service=WMS&version=1.1.0&request=GetMap&layers=geosolutions:testNetCDF&bbox=4.9375,44.96875,14.9375,50.96875&width=275&height=165&srs=EPSG:4326&format=image/png&elevation=10&time=2013-03-03T00:00:00.000Z

  9. As you can see, the two images are different because they represents the same layer at two different time and elevation positions:

    Request without parameters

    ../../_images/defNC.png

    Request with elevation=10 and time=2013-03-03T00:00:00.000Z

    ../../_images/paramNC.png

Grib

Grib File description

The Grib file we used in the following example contains information about the marine currents on the African coast. This file is composed by two layers:

  • u-component_of_current_surface.
  • v-component_of_current_surface.

It should be pointed out that the two layers contain an additional time dimension, so we can see the following file as a 3D array where the 3 dimensions are: latitude, longitude, time.

For a better comprehension, you can see the following screenshot of the image structure:

../../_images/grib_scr.png

Note

All the Grib files used in the following training have been created by converting original WRF (Weather Research and Forecasting system) data in the Grib format.

Configuring a Grib File

The configuration of a Grib data is very similar to that of a NetCDF one. For this reason some steps will not be shown:

  1. Go to Stores -> Add new Store. Then click on the GRIB entry:

    ../../_images/grib.png
  2. Enter testGrib for the Data Source Name field and $TRAINING_ROOT/data/user_data/multidim/africa.grb2 ( or %TRAINING_ROOT%\data\user_data\multidim\africa.grb2 ) for the URL field.

  3. Click on the Publish button of the first layer called u-component_of_current_surface

  4. Then in the Layer configuration page you can enable the additional parameters.

    ../../_images/dimGR.png
  5. Click on Save, for saving the configuration.

  6. Execute the following request:

    http://localhost:8083/geoserver/geosolutions/wms?service=WMS&version=1.1.0&request=GetMap&layers=geosolutions:u-component_of_current_surface&styles=africa&bbox=339.9,-30.1,411.09,20.1&width=256&height=180&srs=EPSG:4326&format=image/png
    http://localhost:8083/geoserver/geosolutions/wms?service=WMS&version=1.1.0&request=GetMap&layers=geosolutions:u-component_of_current_surface&styles=africa&bbox=339.9,-30.1,411.09,20.1&width=256&height=180&srs=EPSG:4326&format=image/png&time=2014-01-24T06:00:00.000Z
    
  7. Compare the results:

    Request without parameters

    ../../_images/defGR.png

    Request with time=2014-01-24T06:00:00.000Z

    ../../_images/paramGR.png

Note

The following requests have been rendered with a style called africa for highlighting the differences between the two images.