Page tree

Versions Compared

Key

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

...

DAC installation guide (final).doc

Table of Contents

Introduction

The Tomcat WaterML2 service is hosted in a Tomcat service container. This service allows REST clients to interact with a WaterML2  service that is connected to a FEWS system through the FEWS DataAccessComponent. With this API the REST client can retrieve data from the FEWS system. Before a client application can access the FEWS system there is some configuration work that needs to be done.

...

WaterML2 Service API

Get Capabilities request

Code Block
http://localhost:8081/WaterMlService/waterml?request=GetCapabilities

The GetCapabilities request returns a document describing the operations supported by this webservice.

Get Capabilities response

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<sos:Capabilities xmlns:sos="http://www.opengis.net/sos/2.0" xmlns:oost="http://www.oostethys.org/schemas/0.1.0/oostethys" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:swe="http://www.opengis.net/swe/1.0.1" xmlns:ogc="http://www.opengis.net/ogc" xsi:schemaLocation="http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/2.0.0/sosGetCapabilities.xsd" version="2.0.0">
    <ows:ServiceIdentification>
        <ows:Title></ows:Title>
        <ows:ServiceType>OGC:SOS</ows:ServiceType>
        <ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion>
        <ows:Fees>None</ows:Fees>
        <ows:AccessConstraints>None</ows:AccessConstraints>
    </ows:ServiceIdentification>
    <ows:ServiceProvider>
        <ows:ProviderName></ows:ProviderName>
        <ows:ProviderSite xlink:href=""/>
        <ows:ServiceContact>
            <ows:IndividualName></ows:IndividualName>
            <ContactInfo>
                <ows:Address>
                    <ows:DeliveryPoint></ows:DeliveryPoint>
                    <ows:City></ows:City>
                    <ows:PostalCode></ows:PostalCode>
                    <ows:Country></ows:Country>
                    <ows:ElectronicMailAddress></ows:ElectronicMailAddress>
                </ows:Address>
            </ContactInfo>
        </ows:ServiceContact>
    </ows:ServiceProvider>
    <ows:OperationsMetadata>
        <ows:Operation name="GetCapabilities">
            <ows:DCP>
                <ows:HTTP>
                    <ows:Get xlink:href="http://localhost:8081/WaterMlService/waterml?request=GetCapabilities"/>
                </ows:HTTP>
            </ows:DCP>
            <ows:Parameter name="service">
                <ows:AllowedValues>
                    <ows:Value>SOS</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="version">
                <ows:AllowedValues>
                    <ows:Value>1.0.0</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
        </ows:Operation>
        <ows:Operation name="GetFeature">
            <ows:DCP>
                <ows:HTTP>
                    <ows:Get xlink:href="http://localhost:8081/WaterMlService/waterml?request=GetFeature"/>
                </ows:HTTP>
            </ows:DCP>
            <ows:Parameter name="service">
                <ows:AllowedValues>
                    <ows:Value>SOS</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="version">
                <ows:AllowedValues>
                    <ows:Value>1.0.0</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
        </ows:Operation>
        <ows:Operation name="GetObservation">
            <ows:DCP>
                <ows:HTTP>
                    <ows:Get xlink:href="http://localhost:8081/WaterMlService/waterml?request=GetObservation"/>
                    <ows:Post xlink:href="http://localhost:8081/WaterMlService/waterml?request=GetObservation"/>
                </ows:HTTP>
            </ows:DCP>
            <ows:Parameter name="service">
                <ows:AllowedValues>
                    <ows:Value>SOS</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="version">
                <ows:AllowedValues>
                    <ows:Value>1.0.0</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="request">
                <ows:AllowedValues>
                    <ows:Value>GetObservation</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="featureId">
                <ows:AllowedValues>
                    <ows:Value>0</ows:Value>
                    <ows:Value>1</ows:Value>
                    <ows:Value>2</ows:Value>
                    <ows:Value>3</ows:Value>
                    <ows:Value>4</ows:Value>
                    <ows:Value>5</ows:Value>
                    <ows:Value>6</ows:Value>
                    <ows:Value>7</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="observedProperty">
                <ows:AllowedValues>
                    <ows:Value>Parameter</ows:Value>
                    <ows:Value>T.for</ows:Value>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="beginPosition">
                <ows:AllowedValues>
                    <ows:AnyValue/>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="endPosition">
                <ows:AllowedValues>
                    <ows:AnyValue/>
                </ows:AllowedValues>
            </ows:Parameter>
            <ows:Parameter name="analysisTime">
                <ows:AllowedValues>
                    <ows:AnyValue/>
                </ows:AllowedValues>
            </ows:Parameter>
        </ows:Operation>
    </ows:OperationsMetadata>
</sos:Capabilities>

Get Feature request

Code Block
http://localhost:8081/WaterMlService/waterml?request=GetFeature

The GetFeature request returns a document containing a list of feature members supported by the webservice. A feature member corresponds to what is know in FEWS as Location.

Get Feature response

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>
                        

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">
    <gml:description>0</gml:description>
    <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">
                    <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 WaterMlService.WAR can be deployed using a context xml file such as WaterMLService.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:

...