Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gsml="urn:cgi:xmlns:CGI:GeoSciML:2.0" xmlns:om="http://www.opengis.net/om/2.0" xmlns:sa="http://www.opengis.net/sampling/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wml2="http://www.opengis.net/waterml/2.0" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:sf="http://www.opengis.net/sampling/2.0" xmlns:sams="http://www.opengis.net/samplingSpatial/2.0" xsi:schemaLocation="http://www.opengis.net/om/2.0 ../observation.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/sampling/2.0 ../samplingFeature.xsd http://www.opengis.net/waterml/2.0 ../waterml2.xsd http://www.opengis.net/swe/2.0 http://schemas.opengis.net/sweCommon/2.0/swe.xsd">
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="0">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>0</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="0">
                        <gml:pos srcName="Rijks Driehoekstelsel">53.64671168116518 5.175518773508316</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="1">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>1</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="1">
                        <gml:pos srcName="Rijks Driehoekstelsel">53.3835058954904 4.560651062185197</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="2">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>2</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="2">
                        <gml:pos srcName="Rijks Driehoekstelsel">52.48257667744973 4.283120419290973</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="3">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>3</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="3">
                        <gml:pos srcName="Rijks Driehoekstelsel">51.493692036021535 3.0541898956873954</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="4">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>4</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="4">
                        <gml:pos srcName="Rijks Driehoekstelsel">50.99065599128154 3.0796721627765615</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="5">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>5</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="5">
                        <gml:pos srcName="Rijks Driehoekstelsel">51.01107956492021 4.6177610376887515</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="6">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>6</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="6">
                        <gml:pos srcName="Rijks Driehoekstelsel">50.59113044096123 5.4719202115344</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
    <wfs:member>
        <om:featureOfInterest>
            <wml2:WaterMonitoringPoint gml:id="7">
                <sf:parameter>
                    <om:NamedValue>
                        <om:name xlink:title="Location name"/>
                        <om:value>7</om:value>
                    </om:NamedValue>
                </sf:parameter>
                <sams:shape>
                    <gml:Point gml:id="7">
                        <gml:pos srcName="Rijks Driehoekstelsel">50.58761564487022 6.290845285636415</gml:pos>
                    </gml:Point>
                </sams:shape>
            </wml2:WaterMonitoringPoint>
        </om:featureOfInterest>
    </wfs:member>
</wfs:FeatureCollection>

Get Observations Request

The GetObservations call supports two types of requests:

...

Code Block
languagejava
<?xml version="1.0" ?>
<sos:GetObservation version="2.0.0" service="SOS"
    maxFeatures="3"
    xmlns:sos="http://schemas.opengis.net/sos/2.0.0/"
    xmlns:wfs="http://www.opengis.net/wfs"
    xmlns:ogc="http://www.opengis.net/ogc"
    xmlns:gml="http://www.opengis.net/gml/3.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:om="http://www.opengis.net/om/2.0"
    xmlns:fes="http://www.opengis.net/fes/2.0"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xsi:schemaLocation="http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0.0/sos.xsd">
    <sos:featureOfInterest>0</sos:featureOfInterest>
    <sos:observedProperty>T.for</sos:observedProperty>
    <sos:temporalFilter>
        <fes:During>
            <fes:ValueReference>phenomenonTime</fes:ValueReference>
            <gml:TimePeriod gml:id="tp_1">
                <gml:beginPosition>2013-02-15T01:00:00.000+01:00</gml:beginPosition>
                <gml:endPosition>2013-03-01T01:00:00.000+01:00</gml:endPosition>
            </gml:TimePeriod>
        </fes:During>
    </sos:temporalFilter>
    <sos:temporalFilter>
        <fes:TEquals>
            <fes:ValueReference>analysisTime</fes:ValueReference>
            <gml:TimeInstant gml:id="ti_2">
                <gml:timePosition>2013-03-02T00:00:00.000+01:00</gml:timePosition>
            </gml:TimeInstant>
        </fes:TEquals>
    </sos:temporalFilter>
</sos:GetObservation>
                        

Secondly the HTTP-POST request where the request is written as a XML document.

Returns a pi timeseries xml file containing the timeseries data belonging to the filter defined by the 'filterId'.
The 'convertDatum' argument is to allow timeseries that support a global datum to have their values converted from a value relative to the location height to an absolute value.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

  • clientId <id not used>.
  • startTime start date/time of run.
  • timeZero Forecast time zero. If missing System time is used (optional)
  • endTime end date/time of run.
  • filterId Filter id (optional).
  • locationIds Subset of locations for which to retrieve timeseries (optional).
  • parameterIds Subset of parameters for which to retrieve timeseries (optional).
  • convertDatum Convert values from relative location height to absolute height values (optional).
  • useDisplayUnits Export values using display units (optional).
  • piVersion File format version (optional)
  • return PiTimeseries xml file content.

 

QueryParameters is defined by following schema definition:

Get Observations Response

 

Code Block
<wml2:Collection xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wml2="http://www.opengis.net/waterml/2.0" xmlns:om="http://www.opengis.net/om/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sf="http://www.opengis.net/sampling/2.0" xmlns:sams="http://www.opengis.net/samplingSpatial/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/waterml/2.0 ../waterml2.xsd
Code Block
<xs:complexType name="queryParameters">
    <xs:sequence><gml:description>0</gml:description>
    	<xs:element name="convertDatum" type="xs:boolean"></xs:element>
		<xs:element name="endCreationTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="endTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="filterId" type="xs:string" minOccurs="0"></xs:element>
		<xs:element name="forecastTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="locationIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
		<xs:element name="omitMissing" type="xs:boolean"></xs:element>
		<xs:element name="onlyHeaders" type="xs:boolean"></xs:element>
		<xs:element name="parameterIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
		<xs:element name="piVersion" type="xs:string" minOccurs="0"></xs:element>
		<xs:element name="showThresholds" type="xs:boolean"></xs:element>
		<xs:element name="startCreationTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="startTime" type="xs:dateTime" minOccurs="0"></xs:element><wml2:metadata>
        <wml2:DocumentMetadata gml:id="WaterMlServletResponse_WaterMlServlet">
            <wml2:generationDate>2015-03-16T17:40:35+01:00</wml2:generationDate>
        </wml2:DocumentMetadata>
    </wml2:metadata>
    <wml2:observationMember>
        <om:OM_Observation gml:id="timeseries_0">
            <om:phenomenonTime>
                <gml:TimePeriod gml:id="series_period">
                    <gml:beginPosition>2013-02-20T00:00:00+01:00</gml:beginPosition>
                    <gml:endPosition>2013-03-01T01:00:00+01:00</gml:endPosition>
                </gml:TimePeriod>
            </om:phenomenonTime>
            <om:resultTime>
                <gml:TimeInstant gml:id="series_available">
        <xs:element name="useDisplayUnits" type="xs:boolean"></xs:element>
            </xs:sequence>
</xs:complexType>

 

Returns a pi timeseries xml file containing the timeseries data belonging to the query parameters defined in the query parameters object.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

  • convertDatum Convert values from relative location height to absolute height values (optional).
  • endCreationTime end date/time for the creation time of the timeseries to return
  • endTime end date/time of run.
  • filterId Filter id (optional).
  • forecastTime Forecast time zero. If missing System time is used (optional)
  • locationIds Subset of locations for which to retrieve timeseries (optional).
  • omitMissing Toggle omitting or returning of missing values in response
  • onlyHeaders Toggle to return only header information or also data
  • parameterIds Subset of parameters for which to retrieve timeseries (optional).
  • piVersion File format version (optional)
  • showThresholds Option to toggle the returning of threshold information in the headers
  • startCreationTime start date/time for the creation time of the timeseries to return
  • startTime start date/time of run.
  • useDisplayUnits Export values using display units (optional).
  • return PiTimeseries xml file content.

 

Setter methods

Code Block
void putTimeSeriesForFilters(String clientId, String piTimeSeriesXmlContent, byte[] piTimeSeriesBinaryContent, boolean convertDatum);

 Write timeseries data to the FEWS system using the timeseries sets defined by the filters.

For performance reasons it is possible to split the timeseries header information from the timeseries data. The header information is stored in the piTimeSeriesXmlContent and the timeseries data is stored in the piTimeSeriesBinaryContent. If both header information and data is stored in the XML content the the 'piTimeSeriesBinaryContent' argument can be null.

The 'convertDatum' argument is to allow timeseries that support a datum to have their values converted to a value
relative to the location height. If values are already relative to location then enter FALSE or omit.

  • clientId <id not used>.
  • piTimeSeriesXmlContent PiTimeseries xml file content
  • piTimeSeriesBinaryContent FastInfoSet PiTimeseries file content(optional)
  • convertDatum Convert values from relative location height to absolute height values (optional).

...

<gml:timePosition>2015-03-16T17:40:35+01:00</gml:timePosition>
                </gml:TimeInstant>
            </om:resultTime>
            <om:parameter>
                <om:NamedValue>
                    <om:name xlink:title="T0 (Time of analysis)" xlink:role="analysisTime"/>
                    <om:value xsi:type="gml:TimePositionType">2013-03-02T00:00:00+01:00</om:value>
                </om:NamedValue>
            </om:parameter>
            <om:observedProperty xlink:href="http://nl.wldelft.waterml/parameters/T.for" xlink:title="Temperature forecast"/>
            <om:featureOfInterest>
                <wml2:MonitoringPoint gml:id="0">
                    <sf:parameter>
                        <om:NamedValue>
                            <om:name xlink:title="Location name"/>
                            <om:value>0</om:value>
                        </om:NamedValue>
                    </sf:parameter>
                    <sams:shape>
                        <gml:Point gml:id="0">
                            <gml:pos srcName="Rijks Driehoekstelsel">141000.0 629000.0</gml:pos>
                        </gml:Point>
                    </sams:shape>
                    <wml2:timeZone>
                        <wml2:TimeZone>
                            <wml2:zoneOffset>+1</wml2:zoneOffset>
                            <wml2:zoneAbbreviation>GMT</wml2:zoneAbbreviation>
                        </wml2:TimeZone>
                    </wml2:timeZone>
                </wml2:MonitoringPoint>
            </om:featureOfInterest>
            <om:result>
                <wml2:MeasurementTimeseries gml:id="timeseries_0">
                    <wml2:temporalExtent>
                        <gml:TimePeriod gml:id="timeseries_period_0">
                            <gml:beginPosition>2013-02-20T00:00:00+01:00</gml:beginPosition>
                            <gml:endPosition>2013-03-01T01:00:00+01:00</gml:endPosition>
                        </gml:TimePeriod>
                    </wml2:temporalExtent>
                    <wml2:defaultPointMetadata>
                        <wml2:DefaultTVPMeasurementMetadata>
                            <wml2:uom uom="C"/>
                            <wml2:interpolationType xlink:href="http://www.opengis.net/def/waterml/2.0/interpolationType/Discontinuous" xlink:title="Discontinuous"/>
                        </wml2:DefaultTVPMeasurementMetadata>
                    </wml2:defaultPointMetadata>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2013-02-20T00:00:00+01:00</wml2:time>
                            <wml2:value>0.37933815</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>

        <!--    ... skipped some values -->

                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2013-02-28T22:59:59+01:00</wml2:time>
                            <wml2:value>-0.38247958</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2013-03-01T00:00:00+01:00</wml2:time>
                            <wml2:value>-0.23891993</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2013-03-01T01:00:00+01:00</wml2:time>
                            <wml2:value>0.086797565</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                </wml2:MeasurementTimeseries>
            </om:result>
        </om:OM_Observation>
    </wml2:observationMember>
</wml2:Collection>

Installing a WaterML2 Service

The file DAC installation guide (final).doc describes how to install a Tomcat instance containing a DataAccessComponent instance. Once these steps are completed the FewsPiServiceWaterMlService.WAR can be deployed using a context xml file such as FewsPiServiceWaterMLService.xml

Configuration

The are two levels of configuration. The first is the DataAccessComponent which is a FEWS client hosted as a GlobalResource in Tomcat. The DataAccessComponent uses the regular FEWS configuration which falls outside the scope of this documentation. The second level of configuration is what is used by the FewsPiService webservice which has been deployed in Tomcat. To deploy this webservice a context XML file is required which looks like this:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- Location of specific AI war file. (Can be a symlink) -->
<Context docBase="${catalina.home}/fews/FewsPiService.war" antiJARLocking="true" crossContext="true" >
    <!—- 'clientConfigFileId' points to a FEWS configuration file in de FEWS configuration directory 'PiClientConfigFiles'. -->
     <Parameter name="clientConfigFileId" value="FewsPiService.properties" override="false"/>
    <!—- resourceId must match the 'name' of 'ResourceLink' below -->
     <Parameter name="resourceId" value="DAC" override="false"/>
     <Parameter name="serviceName" value="FewsPiServiceImpl" override="false"/>
     <Parameter name="namespaceUri" value="http://fewpiservice.wldelft.nl" override="false"/ in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- Location of specific AI war file. (Can be a symlink) -->
<Context docBase="${catalina.home}/fews/WaterMlService.war" antiJARLocking="true" crossContext="true" >
    <!—- 'clientConfigFileId' points to a FEWS configuration file in de FEWS configuration directory 'PiClientConfigFiles'. -->
     <Parameter name="portNameclientConfigFileId" value="FewsPiServiceImplPortWaterMlService.properties" override="false"/>
    <!—-  'fewspi_config_naam'resourceId must match the file 'name' of this'ResourceLink' configuration file without the XML extension. below -->
     <Parameter name="wsdlresourceId" value="http://localhost:8080/FewsPiService/fewspiservice?wsdlDAC" override="false"/>
    <!—-  Global 'fews_dac' must be the same as the DAC resource name in the file 'server.xml'-->
     <ResourceLink name="DAC"
                  global="fews_dac"
                  type="nl.wldelft.fews.system.data.dac.DataAccessComponent"/>
     <Loader loaderClass="nl.wldelft.fews.system.data.dac.DacClassLoader" delegate="true"/>
</Context>

In the above configuration example you see a number of two 'Parameter' values which will be explained below:

  • clientConfigFileId = This is a reference to a FEWS configuration file. With this file it is possible to configure the webservice instance. We will discuss this file in more detail below. The field is optional. If omitted then the defaultFilterId must be configured in the Filters.xml FEWS configuration file.
  • resourceId = Tells the webservice what Tomcat resource link to use.

...

  • .

...

  • serviceName = Name of the service
  • namespaceUri = Namespace of the service
  • portName = Name of the service port
  • wsdl = URI of the service WSDL file

FEWS Client Config File (clientConfigFileId)

This is a simple text configuration file that is located in the FEWS configuration in the directory:

Code Block
%REGION_HOME%/Config/PiClientConfigFiles/FewsPiServiceWaterMlService.properties

In the above example the clientConfigFileId would be FewsPiServiceWaterMlService.properties.

This properties file can contain the following configuration items:

...

  • IMPORT_FLAG_CONVERSION_ID = Identical to the export option except that with this option the external flags are mapped to FEWS flags. This option can be omitted resulting in no conversion. If the flags are unknown to FEWS they will not be imported.
  • IMPORT_UNITCONVERSION_ID = Identical to the export option except that with this option the external units can be converted to FEWS units. This option can be omitted resulting in no conversion. If the units are unknown to FEWS then it is assumed that the values are in the same unit as the import parameter.
  • *IMPORT_IDMAP_ID = *Identical to the export option except that with this option external id are translated to internal FEWS ids. This option can be omitted resulting in the export of the FEWS ids. If the external ids are unknown to FEWS then it will not be possible to map the timeseries and the values will be discarded.

Example SOAP calls

See soap-example-calls.zip for examples SOAP client calls.