OceanBrowser WMS Server

From GHER

Jump to: navigation, search

The NetCDF files in OceanBrowser can be visualized in WMS clients (web-based or stand-alone WMS client). The base URL of the SeaDataNet WMS server for DIVA products is:

http://oceanbrowser.net/web-vis/Python/web/wms

For EMODNET Chemistry the base URL is:

http://oceanbrowser.net/emodnet/Python/web/wms

OceanBrowser uses WMS version 1.3.0 and 1.1.1.

Contents

List of layers (GetCapabilities)

To get an inventory of all layers, you can use the GetCapabilities request:

http://oceanbrowser.net/web-vis/Python/web/wms?request=GetCapabilities&service=WMS&version=1.3.0

For instance there is a layer with the name: Mediterranean Sea/JRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1

Map (GetMap)

As the layer name contains a space, it has to be URL encoded (the space ' ' is replaced by '%20'). A GetMap request for this layer is for instance:

http://oceanbrowser.net/web-vis/Python/web/wms?LAYERS=Mediterranean%20Sea%2FJRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1&STYLES=pcolor_flat&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&ELEVATION=-0.0&TIME=01&SRS=EPSG%3A4326&BBOX=0,0,90,90&WIDTH=512&HEIGHT=512

The URL includes the following parameters:

LAYERS
Mediterranean Sea/JRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1
STYLES
pcolor_flat
TRANSPARENT
true
FORMAT
image/png
SERVICE
WMS
VERSION
1.1.1
REQUEST
GetMap
ELEVATION
0.0
TIME
01
SRS
EPSG:4326
BBOX
0,0,90,90
WIDTH
512
HEIGHT
512

Style parameter

The default color-range takes range of values of all data (irrespective of location, depth and time), because the WMS protocol foresees also only a legend for all depth layers and time instances. Sometimes it is necessary to have a more reduced color-bar range, this can be done by including this info in the style attribute.

The full URL is:

http://oceanbrowser.net/web-vis/Python/web/wms?LAYERS=Mediterranean%20Sea%2FJRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1&STYLES=cmap%3Ajet%2Binverted%3Afalse%2Bmethod%3Apcolor_flat%2Bvmin%3A7.38751%2Bvmax%3A18.8895&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&ELEVATION=0.0&TIME=01&SRS=EPSG%3A4326&BBOX=0,0,90,90&WIDTH=512&HEIGHT=512

The URL includes the following parameters:

LAYERS
Mediterranean Sea/JRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1
STYLES
cmap:jet+inverted:false+method:pcolor_flat+vmin:7.38751+vmax:18.8895
TRANSPARENT
true
FORMAT
image/png
SERVICE
WMS
VERSION
1.1.1
REQUEST
GetMap
ELEVATION
0.0
TIME
01
SRS=EPSG
4326
BBOX
0,0,90,90
WIDTH
512
HEIGHT
512

The styles parameters is a list for key-values pairs. It can contain the following information:

method
plotting method (pcolor, contour or contourf)
ncontours
number of contours (ignored for pcolor)
inverted
true if color-map is inverted
cmap
color map name (http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps)
vmin
minimum of color-map range
vmax
maximum of color-map range

Key and values are separated by a colon and key-value pairs by a plus sign. The style of the previous example is thus (decoded):

method:pcolor_flat+inverted:false+cmap:jet+vmin:-5.43691+vmax:30.0554

The order of the key/values is not significant.

Data at a given location (GetFeatureInfo)

The following is an example of a request to give the data at a given location (typically initiated by a click of a user).

http://oceanbrowser.net/web-vis/Python/web/wms?LAYERS=Mediterranean%20Sea%2FJRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1&STYLES=cmap%3Ajet%2Binverted%3Afalse%2Bmethod%3Apcolor_flat%2Bvmin%3A7.38751%2Bvmax%3A18.8895%2Bncontours%3A40&TRANSPARENT=true&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&ELEVATION=-0.0&TIME=01&SRS=EPSG%3A4326&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-327.5%2C-25%2C347.5%2C110&X=962&Y=198&INFO_FORMAT=application%2Fvnd.ogc.gml&QUERY_layers=Mediterranean%20Sea%2FJRA5_Temperature.19002009-2.4Danl.nc*Temperature_L1&WIDTH=1920&HEIGHT=384&

The response is:

<info>
  <feature>
    <longitude>10.75</longitude>
    <latitude>40.375</latitude>
    <DataURL>
      <depth>-0.0</depth>
      <time>01</time>
      <value>13.946</value>
    </DataURL>
  </feature>
</info>

This response includes the longitude, latitude, depth, time index and the value at selected coordinates.

Statistics about a layer

The GetStats request provides a way to query the statistics of a layer at a given depth and time.

http://gher-diva.phys.ulg.ac.be/web-vis/Python/web/wms?&elevation=-0.0&time=01&layer=Atlantic%2FSalinity.19002013.4Danl.nc*Salinity_L1&request=GetStats

LAYERS
name of the layer
ELEVATION
elevation (altitude) of the layer
TIME
time slice
REQUEST
GetStats
<stats>
  <param id="cmap" type="imageselector" default="jet" label="Colormap">
    <option value="jet">img/mini_colormap_jet.png</option>
    <option value="hsv">img/mini_colormap_hsv.png</option>
    <option value="gray">img/mini_colormap_gray.png</option>
    <option value="RdBu">img/mini_colormap_RdBu.png</option>
    <option value="Paired">img/mini_colormap_Paired.png</option>
  </param>
  <param id="inverted" type="boolean" default="False" label="Invert colormap">
  </param>
  <param id="method" type="string" default="pcolor_flat" label="Plotting style" description="Flat shading will produce interpolated colors">
    <option value="pcolor_flat">Flat shading</option>
    <option value="contourf">Filled contours</option>
    <option value="contour">Contours</option>
  </param>
  <param id="vmin" type="float" default="28.9686" label="Minimum color-bar range">
  </param>
  <param id="vmax" type="float" default="37.4726" label="Maximum color-bar range">
  </param>
  <param id="ncontours" type="int" default="40" label="Number of contour-lines">
  </param>
  <xmin>-82</xmin>
  <xmax>9.8</xmax>
  <ymin>10</ymin>
  <ymax>64.8</ymax>
  <vmin>28.9686</vmin>
  <vmax>37.4726</vmax>
</stats>
Personal tools