[mapserver-commits] r11379 - in trunk: docs/en/ogc mapserver msautotest/wxs msautotest/wxs/expected

svn at osgeo.org svn at osgeo.org
Wed Mar 30 05:19:38 EDT 2011


Author: schpidi
Date: 2011-03-30 02:19:38 -0700 (Wed, 30 Mar 2011)
New Revision: 11379

Modified:
   trunk/docs/en/ogc/wcs_server.txt
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwcs20.c
   trunk/msautotest/wxs/expected/wcs_20_desc.xml
   trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name.dat
   trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name_new.dat
   trunk/msautotest/wxs/expected/wcs_20_getcov_full.dat
   trunk/msautotest/wxs/expected/wcs_20_getcov_grd_mp.dat
   trunk/msautotest/wxs/expected/wcs_20_post_bands_name.dat
   trunk/msautotest/wxs/expected/wcs_20_post_bands_name_new.dat
   trunk/msautotest/wxs/expected/wcs_20_post_desc.xml
   trunk/msautotest/wxs/expected/wcs_20_post_getcov_full_multipart.dat
   trunk/msautotest/wxs/wcs_multi.map
Log:
WCS 2.0: Adjusted definition of NilValues (#3685).


Modified: trunk/docs/en/ogc/wcs_server.txt
===================================================================
--- trunk/docs/en/ogc/wcs_server.txt	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/docs/en/ogc/wcs_server.txt	2011-03-30 09:19:38 UTC (rev 11379)
@@ -20,14 +20,22 @@
 geospatial information representing space-varying phenomena. In the MapServer world 
 it allows for unfiltered access to raster data. Conceptually it is easy think of 
 WCS as a raster equivalent of WFS. The following documentation is based on the `Open 
-GIS Consortium's (OGC) Web Coverage Server Interfaces Implementation Specification 
+Geospatial Consortium's (OGC) Web Coverage Service Interfaces Implementation Specification 
 version 1.0.0`_.
 
 Links to WCS-Related Information
 --------------------------------
 
+- `OGC'c WCS Standard page`_
 - `WCS 1.0.0 specification`_
 - `WCS 1.1.1c1 specification`_
+- WCS 2.0
+
+  - `GML 3.2.1 Application Schema Coverages`_
+  - `WCS 2.0 Specification - Core`_
+  - `WCS 2.0 Specification - KVP Protocol Binding Extension`_
+  - `WCS 2.0 Specification - XML/POST Protocol Binding Extension`_
+
 - :ref:`WMS Server HowTo <wms_server>`
 
 Software Requirements
@@ -40,13 +48,13 @@
 - GDAL: raster support library.
 - MapServer: version >= 4.4 (tested with 5.0.2 while updating this document)
 
-For WCS 1.1.x support (MapServer 5.2) there is an additional requirement:
+For WCS 1.1.x (MapServer 5.2) and WCS 2.0 (MapServer 6.0) support there is an additional requirement:
 
 - libxml2: An xml parser and generation library. 
 
 Please see the :ref:`MapServer UNIX Compilation and Installation HowTo <unix>` for detailed 
 instructions on compiling MapServer with support for these libraries and features. 
-For Windows users, `MapServer for Windows (MS4W)`_ comes WCS Server support.
+For Windows users, `MapServer for Windows (MS4W)`_ comes with WCS Server support.
 
 Configuring Your Mapfile to Serve WCS Layers
 ============================================
@@ -66,6 +74,7 @@
 - LAYER metadata "wcs_label" must be set
 - LAYER metadata "wcs_rangeset_name" must be set
 - LAYER metadata "wcs_rangeset_label" must be set
+- LAYER is enabled to be served via WCS (see http://mapserver.org/development/rfc/ms-rfc-67.html)
 
 
 Example WCS Server Mapfile
@@ -374,13 +383,305 @@
 in this ordering as appropriate.  
 
 
+WCS 2.0 
+=======
+
+Overview
+--------
+
+Version 6.0 introduces support for the new version 2.0 of the WCS
+specification. This section documents the usage of the new WCS version.
+
+Web Coverage Service (WCS) 2.0 Interface Standard
+`````````````````````````````````````````````````
+This specification adopts the new OGC Core and Extension model and at
+the moment the following documents are available from the
+`OGC'c WCS Standard page`_:
+
+* `GML 3.2.1 Application Schema Coverages`_
+* `WCS 2.0 Specification - Core`_
+* `WCS 2.0 Specification - KVP Protocol Binding Extension`_
+* `WCS 2.0 Specification - XML/POST Protocol Binding Extension`_
+* `WCS 2.0 Specification - XML/SOAP Protocol Binding Extension`_
+
+
+
+Technical changes from WCS version 1.1.2 include entirely building on the `GML 3.2.1 Application Schema Coverages`_.
+
+WCS 2.0 is based on OWS Common 2.0 and as the WCS 1.1 implementation
+takes advantage of the OWS metadata services in mapowscommon.c. However,
+because of main technical changes like the adoption of GML 3.2.1 or the
+introduction of trim and slice concepts the implementation is largely
+separated in mapwcs20.c.
+
+The schemas are available at http://schemas.opengis.net/wcs/2.0/
+
+WCS 2.0 KVP request parameters
+``````````````````````````````
+
+    **COVERAGEID=id:** This parameter is technically the same as the **COVERAGE** parameter for WCS 1.0 or the **IDENTIFIER** parameter for WCS 1.1. In DescribeCoverage requests, multiple IDs can be requested by concatenating them with semicolons.
+
+    **SUBSET=axis[,crs](low,high):** This parameter subsets the coverage on the given axis. This parameter can be given multiple times, once for each axis. The optional sub-parameter can either be an EPSG definition (like EPSG:4326), an URN or an URI or 'imageCRS' (which is the default). All crs sub-parameters from all **SUBSET** parameters must be equal. (E.g: you canot subset one axis in imageCRS and another in EPSG:4326).
+    
+    **SIZE=axis(value):** This parameter sets the size of the desired axis to the desired value (pixels).
+    
+    **RESOLUTION=axis(value):** This parameter sets the resolution of the desired axis to the desired value (pixels/unit).
+    
+The **SIZE** and **RESOLUTION** are mutually exclusive on one axis, but can be mixed on different axes (e.g: SIZE on x-axis and RESOLUTION on y-axis). Also axis names in **SUBSET**, **SIZE** and **RESOLUTION** parameters cannot be mixed. E.g: ...&SUBSET=x(0,100)&SIZE=lon(200)&... is not legal although the axis names logically refer to the same axis.
+
+Recognized values for the axis sub-parameter are: "x", "xaxis", "x-axis", "x_axis", "long", "long_axis", "long-axis", "lon", "lon_axis", "lon-axis", "y", "yaxis", "y-axis", "y_axis", "lat", "lat_axis" and "lat-axis".
+
+    **OUTPUTCRS=crs:** This parameter defines in which crs the output image should be expressed in. 
+
+    **MEDIATYPE=mediatype:** This parameter is relevant to GetCoverage requests, when multipart XML/image output is desired. It should be set to 'multipart/mixed' (which is currently the only possible value for this parameter).
+    
+    **INTERPOLATION=intperolation_method:** This defines the interpolation method used, for rescaled images. Possible values are "NEAREST", "BILINEAR" and "AVERAGE".
+
+    **RANGESUBSET=band1[,band2[,...]]:** With this parameter, a selection of the bands can be made. Also the bands can be reordered. The bands can be refered to either by name (which can be retrieved using the DescribeCoverage request) or by index (starting with '1' for the first band).
+
+Unchanged KVP parameters
+''''''''''''''''''''''''
+
+The following parameters have not (or just slightly) changed since the last version of the WCS standard.
+
+    **VERSION=version:** For WCS 2.0, this should be set to '2.0.0'.
+    
+    **SERVICE=service**
+    
+    **REQUEST=request**
+    
+    **ACCEPTVERSIONS=versions**
+    
+    **SECTIONS=sections**
+    
+    **UPDATESEQUENCE=updatesequence**
+    
+    **ACCEPTFORMATS=formats:** This parameter is currently ignored.
+    
+    **ACCEPTLANGUAGES=languages:** This parameter is currently ignored.
+    
+    **FORMAT=format:** The desired format can now also be set with the name of the outputformat object defined in the mapfile.
+    
+    **MAP=mapfile**
+    
+All other parameter keys are invalid in WCS 2.0 and will therefore produce an exception message.
+
+KVP request examples
+''''''''''''''''''''
+
+The below sample request outline the new KVP request syntax::
+
+  # GetCapabilities
+  http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCapabilities
+  # DescribeCoverage 2.0
+  http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=DescribeCoverage&COVERAGEID=grey
+  # GetCoverage 2.0 image/tiff full
+  http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff
+  # GetCoverage 2.0 multipart/mixed (GML header & image/tiff) full
+  http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff&MEDIATYPE=multipart/mixed
+  # GetCoverage 2.0 image/tiff trim x y both
+  http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff&SUBSET=x(10,200)&SUBSET=y(10,200)
+  # GetCoverage 2.0 reproject to EPSG 4326
+  http://www.yourserver.com/wcs?SERVICE=wcs&VERSION=2.0.0&REQUEST=GetCoverage&COVERAGEID=grey&FORMAT=image/tiff&SUBSET=x,http://www.opengis.net/def/crs/EPSG/0/4326(-121.488744,-121.485169)
+
+Please refer to the tests in msautotest for further sample requests (http://trac.osgeo.org/mapserver/browser/trunk/msautotest/wxs/wcs_simple.map).
+
+HTTP-POST support
+-----------------
+
+Since version 6.0 MapServer also supports HTTP-POST XML requests. All requests possible via HTTP GET are also able with POST. POST requests are possible for WCS 1.1 or WCS 2.0 requests which adhere to the according standard. 
+
+This is an example GetCapabilities request:
+
+.. code-block:: xml
+
+  <?xml version="1.0" encoding="UTF-8"?>
+  <ows:GetCapabilities service="WCS"> 
+    <ows:AcceptVersions>
+      <ows:Version>2.0.0</ows:Version>
+    </ows:AcceptVersions>
+    <ows:updatesequence>2010-12-21</ows:updatesequence>
+    <ows:Sections>
+      <ows:Section>OperationsMetadata</ows:Section>
+      <ows:Section>ServiceIdentification</ows:Section>
+    </ows:Sections>
+  </ows:GetCapabilities>
+
+This is an example DescribeCoverage request, which is only valid for WCS 2.0.
+
+.. code-block:: xml
+
+  <wcs:DescribeCoverage 
+    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+    xsi:schemaLocation="http://www.opengis.net/wcs/2.0 ../../wcsAll.xsd" 
+    xmlns="http://www.opengis.net/wcs/2.0"
+    xmlns:wcs="http://www.opengis.net/wcs/2.0" service="WCS" version="2.0.0">
+    <wcs:CoverageID>SOME_ID</wcs:CoverageID>
+  </wcs:DescribeCoverage>
+
+This example demonstrates the usage of a WCS 2.0 POST-XML GetCoverage request:
+
+.. code-block:: xml
+
+  <?xml version="1.0" encoding="UTF-8"?>
+  <wcs:GetCoverage 
+    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+    xsi:schemaLocation="http://www.opengis.net/wcs/2.0 ../../wcsAll.xsd" 
+    xmlns="http://www.opengis.net/wcs/2.0"
+    xmlns:wcs="http://www.opengis.net/wcs/2.0" service="WCS" version="2.0.0">
+    <wcs:Format>image/tiff</wcs:Format>
+    <wcs:Mediatype>multipart/mixed</wcs:Mediatype>
+    <wcs:Resolution dimension="x">0.01</wcs:Resolution>
+    <wcs:Size dimension="y">50</wcs:Size>
+    <wcs:CoverageID>SOME_ID</wcs:CoverageID>
+    <wcs:DimensionTrim>
+      <wcs:Dimension crs="http://www.opengis.net/def/crs/EPSG/0/4326">x</wcs:Dimension>
+      <wcs:TrimHigh>17.25</wcs:TrimHigh>
+      <wcs:TrimLow>16.5</wcs:TrimLow>
+    </wcs:DimensionTrim>
+    <wcs:DimensionTrim>
+      <wcs:Dimension crs="http://www.opengis.net/def/crs/EPSG/0/4326">y</wcs:Dimension>
+      <wcs:TrimLow>47.9</wcs:TrimLow>
+    </wcs:DimensionTrim>
+  </wcs:GetCoverage>
+
+Please refer to the `WCS 2.0 Specification - XML/POST Protocol Binding Extension`_ and the schemas ... for the exact API.
+
+Changes to previous versions
+----------------------------
+
+The layer name must be a valid NCName, e.g: must not start with a number and can only contain alphanumerical characters. This constraint derives of the gml:id property which has to be a NCName, that relates to the coverage ID which is itself taken from the layers name.
+
+Issues
+------
+
+If you want to use libxml2 or its derived tools (like xmllint) for validation be aware that there is a bug that breaks the validation of GML 3.2.1.
+
+Additional layer metadata entries
+---------------------------------
+
+In this section, WCS 2.0.0 specific layer metadata entries will be discussed.
+
+New band related metadata entries
+`````````````````````````````````
+
+(see http://triton.eox.at/odas/wiki/UsageAndMetadata)
+
+With the following layer metadata fields can be used to return a more detailed description for the range type of a "virtual dataset" coverage. A coverage is considered as a "virtual dataset" if the (wcs|ows)_extent metadata entry is set and one of the (wcs|ows)_size or (wcs|ows)_resolution metadata fields are set.
+
+First of all, the used version of metadata has to be identified. To identify the bands of a coverage, one of the following fields must be present:
+
+* (wcs|ows)_band_names (corresponding to WCS 2.0)
+* (wcs|ows)_rangeset_axes (corresponding to WCS 1.1)
+
+The type of these fields is a space delimited list of names, whereas the count of the names has to match the "bandcount" metadata field. These names are then used as a prefix for other metadata fields only concerning this band. The possible metadata keys are the following:
+
+* WCS 2.0:
+
+  * {band_name}_band_interpretation
+  * {band_name}_band_uom
+  * {band_name}_band_definition
+  * {band_name}_band_description
+  * {band_name}_interval
+
+* WCS 1.1
+
+  * {band_name}_semantic
+  * {band_name}_values_types
+  * {band_name}_values_semantic
+  * {band_name}_description
+  * {band_name}_interval
+
+All values are interpreted as strings, only "interval" is interpreted as 2 double precision float values separated with a space.
+
+For every key, also default values can be configured. These have the same suffix as the band specific keys but start with (wcs|ows) instead of the bands name.
+
+* WCS 2.0:
+
+  * (wcs|ows)_band_interpretation
+  * (wcs|ows)_band_uom
+  * (wcs|ows)_band_definition
+  * (wcs|ows)_band_description
+  * (wcs|ows)_interval
+
+* WCS 1.1
+
+  * (wcs|ows)_semantic
+  * (wcs|ows)_values_types
+  * (wcs|ows)_values_semantic
+  * (wcs|ows)_description
+  * (wcs|ows)_interval
+  
+If no specific or default value is given, the output is dependant on the metadata key. The UOM, for example will be set to 'W.m-2.Sr-1', interval and significant figures will be determined according to the image type and definition, description and interpretation will not be visible in the output at all.
+
+This example demonstrates the use of the band-specific metadata fields with their default values.
+
+.. code-block:: mapfile
+
+  METADATA
+    "ows_srs" "EPSG:4326"
+    "wcs_extent" "47.5070762077246 16.038578977182 49.0103258976982 17.2500586851354"
+    
+    "wcs_size" "1200 1100"
+    "wcs_imagemode" "BYTE"
+    
+    "wcs_bandcount" "3"
+    "wcs_band_names" "BandA BandB BandC"
+    
+    #default values
+    "wcs_band_interpretation"   "This is default interpretation"
+    "wcs_band_uom"              "DefaultUOM"
+    "wcs_band_definition"       "DefaultDefinition"
+    "wcs_band_description"      "This is default description"
+    "wcs_interval"              "0 125"
+    "wcs_significant_figures"   "3"
+    
+    #specific band values
+    "BandA_band_interpretation" "This is a specific interpretation"
+    "BandA_band_uom"            "SpecificUOM"
+    "BandA_band_definition"     "SpecificDefinition"
+    "BandA_band_description"    "This is a specific description"
+    "BandA_interval"            "0 255"
+  END
+
+The above example would result in having BandA a more specific description, and BandB and BandC having the default description. It would also be possible to only use some of the specific values for BandA and others from the default.
+
+If no default and specific values are given for the interval or significant figures metadata field, the a default is generated from the "imagemode" field. (Which itself defaults to FLOAT32).
+
+The new metadata fields also consist the *(wcs|ows)_nilvalues* and *(wcs|ows)_nilvalues_reasons*
+
+* (wcs|ows)_nilvalues
+
+With this field, specific nilvalues can be set. The values have to be delimited by a space.
+
+* (wcs|ows)_nilvalues_reasons
+
+This field defines the reasons for the specific nilvalues. The reasons are also space delimited and reference the nilvalue with the same index. The reasons should be a URIs/URNs.
+
+The following example demonstrates the use of both metadata fields:
+
+.. code-block:: mapfile
+
+  METADATA
+    "ows_srs" "EPSG:4326"
+    "wcs_extent" "47.5070762077246 16.038578977182 49.0103258976982 17.2500586851354"
+
+    "wcs_size" "1200 1100"
+    "wcs_imagemode" "BYTE"
+    "wcs_bandcount" "3"
+
+    "wcs_nilvalues" "0 255"
+    "wcs_nilvalues_reasons" "urn:ogc:def:nil:OGC::BelowDetectionLimit urn:ogc:def:nil:OGC::AboveDetectionLimit"
+  END
+
 Reference Section
 =================
 
-WCS support tries to leverage existing WMS or OWS metadata definitions. The 
-rationale being that many values will be the same regardless of the type of service. 
-The module will look for the following metadata prefixes (in order): wcs, ows and 
-finally wms unless otherwise noted.
+To avoid confusion only "wcs_*" and "ows_*" prefixed metadata entries
+are evaluated in OGC WCS services. Previous versions used "wms_*"
+prefixed entries as fallback which is dropped in version 6.0 in favor of
+forcing explicit decisions. The module will look for the "wcs_*" and
+"ows_*" metadata prefixes in this order.
 
 The following metadata are available in the setup of the mapfile:
 
@@ -627,6 +928,12 @@
 the resulting .dbf file using a desktop tool such as Mircosoft Access or ESRI
 Arcview.
 
+WCS 2.0 Application Profile - Earth Observation (EO-WCS)
+========================================================
+
+Open Source implementation based on MapServer available at http://www.eoxserver.org
+<<TBD>>
+
 To-do Items and Known Limitations
 =================================
 
@@ -648,5 +955,11 @@
 .. _`Open GIS Consortium's (OGC) Web Coverage Server Interfaces Implementation Specification version 1.0.0`: https://portal.opengeospatial.org/files/?artifact_id=3837
 .. _`WCS 1.0.0 specification`: https://portal.opengeospatial.org/files/?artifact_id=3837
 .. _`WCS 1.1.1c1 specification`: http://portal.opengeospatial.org/files/?artifact_id=22560
+.. _`OGC'c WCS Standard page`: http://www.opengeospatial.org/standards/wcs
+.. _`GML 3.2.1 Application Schema Coverages`: http://portal.opengeospatial.org/files/?artifact_id=41438
+.. _`WCS 2.0 Specification - Core`: http://portal.opengeospatial.org/files/?artifact_id=41437
+.. _`WCS 2.0 Specification - KVP Protocol Binding Extension`: http://portal.opengeospatial.org/files/?artifact_id=41439
+.. _`WCS 2.0 Specification - XML/POST Protocol Binding Extension`: http://portal.opengeospatial.org/files/?artifact_id=41440
+.. _`WCS 2.0 Specification - XML/SOAP Protocol Binding Extension`: http://portal.opengeospatial.org/files/?artifact_id=41441
 .. _`Open Geospatial Consortium (OGC)`: http://www.opengeospatial.org/
 .. _`MapServer for Windows (MS4W)`: http://www.maptools.org/ms4w/index.phtml

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/mapserver/HISTORY.TXT	2011-03-30 09:19:38 UTC (rev 11379)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- WCS 2.0: Adjusted definition of NilValues.
+
 - Fixed handling of PROJ_LIB value relative to mapfile path (#3094)
 
 - Fixed compilation error with opengl support (#3769)

Modified: trunk/mapserver/mapwcs20.c
===================================================================
--- trunk/mapserver/mapwcs20.c	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/mapserver/mapwcs20.c	2011-03-30 09:19:38 UTC (rev 11379)
@@ -1721,7 +1721,7 @@
         xmlNsPtr psGmlNs, xmlNsPtr psGmlcovNs, xmlNsPtr psSweNs, xmlNsPtr psXLinkNs, xmlNodePtr psRoot)
 {
     xmlNodePtr psRangeType, psDataRecord, psField, psQuantity,
-        psUom, psConstraint, psAllowedValues = NULL/*, psNilValues = NULL*/;
+        psUom, psConstraint, psAllowedValues = NULL, psNilValues = NULL;
     char **arr = NULL;
     int i, num = 0;
 
@@ -1778,7 +1778,26 @@
             xmlNewChild(psQuantity, psSweNs, BAD_CAST "description", BAD_CAST cm->bands[i].description);
         }
 
-        xmlNewChild(psQuantity, psSweNs, BAD_CAST "nilValues", NULL);
+        /* if there are given nilvalues -> add them to the first field */
+        /* all other fields get a reference to these */
+        if(cm->numnilvalues > 0)
+        {
+            int j;
+            psNilValues = xmlNewChild(
+                xmlNewChild(psQuantity, psSweNs, BAD_CAST "nilValues", NULL),
+                psSweNs, BAD_CAST "NilValues", NULL);
+            for(j = 0; j < cm->numnilvalues; ++j)
+            {
+                xmlNodePtr psTemp =
+                    xmlNewChild(psNilValues, psSweNs, BAD_CAST "nilValue", BAD_CAST cm->nilvalues[j]);
+                if(j < cm->numnilvalues)
+                    xmlNewProp(psTemp, BAD_CAST "reason", BAD_CAST cm->nilvalues_reasons[j]);
+            }
+        }
+        else /* create an empty nilValues tag */
+        {
+            xmlNewChild(psQuantity, psSweNs, BAD_CAST "nilValues", NULL);
+        }
 
         psUom = xmlNewChild(psQuantity, psSweNs, BAD_CAST "uom", NULL);
         if(cm->bands[i].uom != NULL)
@@ -1805,35 +1824,6 @@
             snprintf(significant_figures, sizeof(significant_figures), "%d", cm->bands[i].significant_figures);
             xmlNewChild(psAllowedValues, psSweNs, BAD_CAST "significantFigures", BAD_CAST significant_figures);
         }
-
-        /* if there are given nilvalues -> add them to the first field */
-        /* all other fields get a reference to these */
-        /* TODO: look up specs for nilValue */
-        /*if(psNilValues == NULL && numNilValues > 0)
-        {
-            int j;
-            char id[100];
-            psNilValues = xmlNewChild(
-                xmlNewChild(psQuantity, psSweNs, BAD_CAST "nilValues", NULL),
-                psSweNs, BAD_CAST "NilValues", NULL);
-            snprintf(id, sizeof(id), "NIL_VALUES_%s", layer->name);
-            xmlNewNsProp(psNilValues, psGmlNs, BAD_CAST "id", BAD_CAST id);
-            for(j = 0; j < numNilValues; ++j)
-            {
-                xmlNodePtr psTemp =
-                    xmlNewChild(psNilValues, psSweNs, BAD_CAST "nilValue", BAD_CAST nilValues[j]);
-                if(j < numNilValueReasons)
-                    xmlNewProp(psTemp, BAD_CAST "reason", BAD_CAST nilValueReasons[j]);
-            }
-        }
-        else if(numNilValues > 0)
-        {
-            char href[100];
-            xmlNodePtr psTemp =
-                xmlNewChild(psQuantity, psSweNs, BAD_CAST "nilValues", NULL);
-            snprintf(href, sizeof(href), "#NIL_VALUES_%s", layer->name);
-            xmlNewNsProp(psTemp, psXLinkNs, BAD_CAST "href", BAD_CAST href);
-        }*/
     }
 }
 
@@ -2330,6 +2320,10 @@
                     {
                         cm->nilvalues_reasons[i] = msStrdup(t_nilvalues_reasons[i]);
                     }
+                    else
+                    {
+                        cm->nilvalues_reasons[i] = msStrdup("");
+                    }
                 }
             }
             msFreeCharArray(t_nilvalues, n_nilvalues);

Modified: trunk/msautotest/wxs/expected/wcs_20_desc.xml
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_desc.xml	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_desc.xml	2011-03-30 09:19:38 UTC (rev 11379)
@@ -31,7 +31,11 @@
         <swe:field name="bands">
           <swe:Quantity>
             <swe:description>Test description</swe:description>
-            <swe:nilValues/>
+            <swe:nilValues>
+              <swe:NilValues>
+                <swe:nilValue reason="">-99</swe:nilValue>
+              </swe:NilValues>
+            </swe:nilValues>
             <swe:uom code="W.m-2.Sr-1"/>
             <swe:constraint>
               <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -40,7 +40,11 @@
       <swe:field name="Band1">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -53,7 +57,11 @@
       <swe:field name="Band5">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -66,7 +74,11 @@
       <swe:field name="Band9">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name_new.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name_new.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_getcov_bands_name_new.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -40,7 +40,11 @@
       <swe:field name="Band1">
         <swe:Quantity definition="SomeDefinition">
           <swe:description>This is some description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="urn:ogc:def:nil:OGC:1.0:inapplicable">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="SomeUOM"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -53,7 +57,11 @@
       <swe:field name="Band5">
         <swe:Quantity definition="DefaultDefinition">
           <swe:description>Default description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="urn:ogc:def:nil:OGC:1.0:inapplicable">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="DefaultUOM"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -66,7 +74,11 @@
       <swe:field name="Band9">
         <swe:Quantity definition="DefaultDefinition">
           <swe:description>Default description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="urn:ogc:def:nil:OGC:1.0:inapplicable">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="DefaultUOM"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_getcov_full.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_getcov_full.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_getcov_full.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -40,7 +40,11 @@
       <swe:field name="bands">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">-99</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_getcov_grd_mp.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_getcov_grd_mp.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_getcov_grd_mp.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -42,7 +42,11 @@
       <swe:field name="bands">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">-99</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_post_bands_name.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_post_bands_name.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_post_bands_name.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -40,7 +40,11 @@
       <swe:field name="Band1">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -53,7 +57,11 @@
       <swe:field name="Band5">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -66,7 +74,11 @@
       <swe:field name="Band9">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_post_bands_name_new.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_post_bands_name_new.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_post_bands_name_new.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -40,7 +40,11 @@
       <swe:field name="Band1">
         <swe:Quantity definition="SomeDefinition">
           <swe:description>This is some description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="urn:ogc:def:nil:OGC:1.0:inapplicable">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="SomeUOM"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -53,7 +57,11 @@
       <swe:field name="Band5">
         <swe:Quantity definition="DefaultDefinition">
           <swe:description>Default description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="urn:ogc:def:nil:OGC:1.0:inapplicable">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="DefaultUOM"/>
           <swe:constraint>
             <swe:AllowedValues>
@@ -66,7 +74,11 @@
       <swe:field name="Band9">
         <swe:Quantity definition="DefaultDefinition">
           <swe:description>Default description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="urn:ogc:def:nil:OGC:1.0:inapplicable">0</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="DefaultUOM"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_post_desc.xml
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_post_desc.xml	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_post_desc.xml	2011-03-30 09:19:38 UTC (rev 11379)
@@ -31,7 +31,11 @@
         <swe:field name="bands">
           <swe:Quantity>
             <swe:description>Test description</swe:description>
-            <swe:nilValues/>
+            <swe:nilValues>
+              <swe:NilValues>
+                <swe:nilValue reason="">-99</swe:nilValue>
+              </swe:NilValues>
+            </swe:nilValues>
             <swe:uom code="W.m-2.Sr-1"/>
             <swe:constraint>
               <swe:AllowedValues>

Modified: trunk/msautotest/wxs/expected/wcs_20_post_getcov_full_multipart.dat
===================================================================
--- trunk/msautotest/wxs/expected/wcs_20_post_getcov_full_multipart.dat	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/expected/wcs_20_post_getcov_full_multipart.dat	2011-03-30 09:19:38 UTC (rev 11379)
@@ -40,7 +40,11 @@
       <swe:field name="bands">
         <swe:Quantity>
           <swe:description>Test description</swe:description>
-          <swe:nilValues/>
+          <swe:nilValues>
+            <swe:NilValues>
+              <swe:nilValue reason="">-99</swe:nilValue>
+            </swe:NilValues>
+          </swe:nilValues>
           <swe:uom code="W.m-2.Sr-1"/>
           <swe:constraint>
             <swe:AllowedValues>

Modified: trunk/msautotest/wxs/wcs_multi.map
===================================================================
--- trunk/msautotest/wxs/wcs_multi.map	2011-03-30 04:55:36 UTC (rev 11378)
+++ trunk/msautotest/wxs/wcs_multi.map	2011-03-30 09:19:38 UTC (rev 11379)
@@ -104,7 +104,7 @@
    "wcs_rangeset_name" "Landsat 5 TM Bands"
    "wcs_rangeset_label" "Bands"
    "wcs_rangeset_description" "Bands for Landsat 5 TM"
-   "wcs_rangeset_nullvalue" "-99"
+   "wcs_rangeset_nullvalue" "0"
   END
 END
 
@@ -143,6 +143,9 @@
     "wcs_interval"            "0 255"
     "wcs_significant_figures"     "3"
     
+    "wcs_nilvalues" "0"
+    "wcs_nilvalues_reasons" "urn:ogc:def:nil:OGC:1.0:inapplicable"
+    
     #specific band values
     "Band1_band_interpretation" "This is some interpretation"
     "Band1_band_uom"            "SomeUOM"



More information about the mapserver-commits mailing list