Versions Compared

Key

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

...

It is possible to setup the WaterMl2 import to read from a WaterMl2 webserver using the WaterMlServerParser or it is possible to read directly form an import directory using the WaterMLTimeSeriesParser.

Table of Contents

TimeSeries XML Request

...

format

Here is an example of an HTTP-GET XML request URLfile:

Code Block
titlehttp-get
http://localhost:8081/WaterMlService/waterml?request=GetObservation&featureId=01446500&observedProperty=Discharge&beginPosition=2013-02-01T00:00:00%2B01:00&endPosition=2013-03-01T00:00:00%2B01:00&analysisTime=2013-02-01T00:00:00%2B01:00

 

Here is an example of an HTTP-POST XML request file:

Code Block
<?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://<?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>01446500</sos:featureOfInterest>
    <sos:observedProperty>Discharge</sos:observedProperty>
    <!-- Represents the location id to return -->
     <sos:featureOfInterest>01446500</sos:featureOfInterest>
 OPTIONAL -->    <om:procedure>Continuous/Instantaneous</om:procedure>
    <!-- Represents the parameter id to return -->
     <sos:observedProperty>Discharge</sos:observedProperty>

	<!-- phenomenonTime defines the period for which to retrieve timeseries values -->	 
	OPTIONAL -->
    <om:offering>UNIT</om:offering>
    <sos:temporalFilter>
               <fes:During>
            <fes:ValueReference>phenomenonTime</fes:ValueReference>
                   <gml:TimePeriod<gml:TimeInstant gml:id='beginPosition'>
            <gml:timePosition>2012-06-29</gml:timePosition>
        </gml:TimeInstant>
        <gml:TimeInstant 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>
	
    <!-- Optional: analysisTime can be used to return forecast timeseries for a specific forecast T0 value. -->
    <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>                                                          

TimeSeries XML Response format

Here is an example of an XML response file:

'endPosition'>
            <gml:timePosition>2012-07-06</gml:timePosition>
        </gml:TimeInstant>
    </sos:temporalFilter>
</sos:GetObservation>                                                          

TimeSeries XML Response format

Here is an example of an XML response file:

Code Block
<wml2:Collection xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:om="http://www.opengis.net/om/2.0"
    xmlns:sa="http://www.opengis.net/sampling/2.0" xmlns:swe="http://www.opengis.net/swe/2.0"
    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:wml2="http://www.opengis.net/waterml/2.0"
    xmlns:x-wml2="http://www.opengis.net/waterml/2.0" xmlns:gmd="http://www.isotc211.org/2005/gmd"
    xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:sf="http://www.opengis.net/sampling/2.0"
    xmlns:sams="http://www.opengis.net/samplingSpatial/2.0"
    xmlns:gts
Code Block
<wml2:Collection xmlns:gml="http://www.opengisisotc211.netorg/gml2005/3.2gts" xmlns:omgss="http://www.opengisisotc211.netorg/om2005/2.0gss"
    xmlns:sagsr="http://www.opengisisotc211.netorg/sampling2005/2.0gsr"
    xmlnsxsi:sweschemaLocation="http://www.opengis.net/swewaterml/2.0"
    xmlns:xlink="http://wwwnwisvaws02.er.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:wml2usgs.gov/ogc-swie/schemas/waterml2.xsd"
    gml:id="TO_BE_DETERMINED">
    <gml:identifier codeSpace="http://wwwnwis.waterdata.opengisusgs.netgov/watermlNJ/2.0nwis"
    xmlns:x-wml2        >USGS.01446500</gml:identifier>
    <gml:name codeSpace="http://wwwnwis.waterdata.opengisusgs.netgov/watermlNJ/2.0" xmlns:gmd="http://www.isotc211.org/2005/gmd"
    xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:sfnwis">Delaware River at Belvidere
        NJ</gml:name>
    <wml2:metadata>
        <wml2:DocumentMetadata gml:id="doc.USGS.MP.USGS.01446500">
            <gml:metaDataProperty xlink:href="contact">
                <gml:GenericMetaData>http://cida.usgs.gov</gml:GenericMetaData>
            </gml:metaDataProperty>
            <wml2:generationDate>2012-07-06T05:58:44</wml2:generationDate>
            <wml2:version xlink:href="http://www.opengis.net/samplingwaterml/2.0"
    xmlnsxlink:samstitle="http://www.opengis.net/samplingSpatial/WaterML 2.0"
    xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gss="http://www.isotc211.org/2005/gss"
    xmlns:gsr="http://www.isotc211.org/2005/gsr"
    xsi:schemaLocation="http://www.opengis.net/waterml/2.0 http://nwisvaws02.er.usgs.gov/ogc-swie/schemas/waterml2.xsd"
    gml:id="TO_BE_DETERMINED">
    <gml:identifier codeSpace="http://nwis.waterdata.usgs.gov/NJ/nwis"
        >USGS.01446500</gml:identifier>
    <gml:name codeSpace="http://nwis.waterdata.usgs.gov/NJ/nwis">Delaware River at Belvidere
        NJ</gml:name>
    <wml2:metadata>
        <wml2:DocumentMetadata gml:id="doc.USGS.MP.USGS.01446500">
            <gml:metaDataProperty xlink:href="contact">
                <gml:GenericMetaData>http://cida.usgs.gov</gml:GenericMetaData>
            </gml:metaDataProperty>
            <wml2:generationDate>2012            />
        </wml2:DocumentMetadata>
    </wml2:metadata>
    <wml2:observationMember>
        <om:OM_Observation gml:id="obs.USGS.01446500">
            <om:metadata>
                <wml2:ObservationMetadata>
                    <gmd:contact>
                        <gmd:CI_ResponsibleParty>
                            <gmd:organisationName>
                                <gco:CharacterString>New Jersey Water Science
                                    Center</gco:CharacterString>
                            </gmd:organisationName>
                            <gmd:role>
                                <gmd:CI_RoleCode
                                    codeList="http://www.isotc211.org/2005/resources/CodeList/gmxCodelists.xml#CI_RoleCode"
                                    codeListValue="owner"/>
                            </gmd:role>
                        </gmd:CI_ResponsibleParty>
                    </gmd:contact>
                    <gmd:dateStamp>
                        <gco:DateTime>2012-07-06T05:58:44</gco:DateTime>
                    </gmd:dateStamp>
                    <gmd:identificationInfo/>
                </wml2:ObservationMetadata>
            </om:metadata>
            <om:phenomenonTime>
                <gml:TimePeriod gml:id="pt.USGS.01446500">
                    <gml:beginPosition>2012-06-29</gml:beginPosition>
                    <gml:endPosition>2012-07-06</gml:endPosition>
                </gml:TimePeriod>
            </om:phenomenonTime>
            <om:resultTime>
                <gml:TimeInstant gml:id="forecast.2012-07-06">
                    <gml:timePosition>2012-07-06T05:58:44</wml2:generationDate>
            <wml2:version xlink:href="http://www.opengis.net/waterml/2.0" xlink:title="WaterML 2.0"
            />
        </wml2:DocumentMetadata>
    </wml2:metadata>
    <wml2:observationMember>
        <om:OM_Observation gml:id="obs.USGS.01446500">
            <om:metadata>
                <wml2:ObservationMetadata>
                    <gmd:contact>
                        <gmd:CI_ResponsibleParty>
                            <gmd:organisationName>
                                <gco:CharacterString>New Jersey Water Science
                                    Center</gco:CharacterString>
                            </gmd:organisationName>
                            <gmd:role>
                                <gmd:CI_RoleCode
                                    codeList="http://www.isotc211.org/2005/resources/CodeList/gmxCodelists.xml#CI_RoleCode"
                                    codeListValue="owner"/>
                            </gmd:role>
                        </gmd:CI_ResponsibleParty>
                    </gmd:contact>
                    <gmd:dateStamp>
                        <gco:DateTime>2012-07-06T05:58:44</gco:DateTime>
                    </gmd:dateStamp>
                    <gmd:identificationInfo/>
                </wml2:ObservationMetadata>
            </om:metadata>
            <om:phenomenonTime>
                <gml:TimePeriod gml:id="pt.USGS.01446500">
                    <gml:beginPosition>2012-06-29</gml:beginPosition>
                    <gml:endPosition>2012-07-06</gml:endPosition>
                </gml:TimePeriod>
            </om:phenomenonTime>
            <om:resultTime>
                <gml:TimeInstant gml:id="forecast.2012-07-06">
                    <gml:timePosition>2012-07-06T05:58:44</gml:timePosition>
                </gml:TimeInstant>
            </om:resultTime>
            <om:validTime>
                <gml:TimePeriod gml:id="vt.USGS.01446500">
                    <gml:/gml:timePosition>
                </gml:TimeInstant>
            </om:resultTime>
            <om:validTime>
                <gml:TimePeriod gml:id="vt.USGS.01446500">
                    <gml:beginPosition>2012-06-29</gml:beginPosition>
                    <gml:endPosition>2012-07-06</gml:endPosition>
                </gml:TimePeriod>
            </om:validTime>
            <om:procedure xlink:href="http://www.nemi.gov/Continuous/Instantaneous"
                xlink:title="Continuous/Instantaneous"/>
            <om:observedProperty xlink:href="urn:ogc:def:phenomenon:OGC:Discharge"
                xlink:title="Discharge"/>
            <om:featureOfInterest>
                <wml2:MonitoringPoint gml:id="USGS.MP.01446500">
                    <sf:sampledFeature
                        xlink:href="http://nwisvaws02.er.usgs.gov/ogc-swie/wfs?request=GetFeature&amp;featureId=01446500"/>
                    <sf:parameter>
                        <om:NamedValue>
                            <om:name xlink:title="Watershed"/>
                            <om:value>Middle Delaware-Musconetcong</om:value>
                        </om:NamedValue>
                    </sf:parameter>
                    <sams:shape>
                        <gml:Point gml:id="USGS.P.01446500">
                            <gml:pos srsName="urn:ogc:def:crs:EPSG:4269">40.82638889
                                -75.08250000</gml:pos>
                        </gml:Point>
                    </sams:shape>
                    <wml2:descriptionReference
                        xlink:href="http://external.opengis.org/twiki_public/bin/view/HydrologyDWG/SurfacewaterInteroperabilityExperiment#Use_Case_2"
                        xlink:title="This wiki page describes the IE"/>
                    <wml2:timeZone>
                        <wml2:TimeZone>
                            <wml2:zoneOffset>+00:00</wml2:zoneOffset>
                            <wml2:zoneAbbreviation>EDT</wml2:zoneAbbreviation>
                        </wml2:TimeZone>
                    </wml2:timeZone>
                </wml2:MonitoringPoint>
            </om:featureOfInterest>
            <om:result>
                <wml2:MeasurementTimeseries gml:id="ts_01446500_00060_00000">
                    <wml2:metadata>
                        <wml2:TimeseriesMetadata>
                            <wml2:temporalExtent>
                                <gml:TimePeriod gml:id="USGS.TP.00060_00000">
                                    <gml:beginPosition>2012-06-29</gml:beginPosition>
                                                       <gml:endPosition>2012-07-06</gml:endPosition>
                                               </gml:TimePeriod>
            </om:validTime>
            <om:procedure
                            </wml2:temporalExtent>
                        </wml2:TimeseriesMetadata>
                    </wml2:metadata>
                    <wml2:defaultPointMetadata>
                        <wml2:DefaultTVPMeasurementMetadata>
                            <wml2:qualifier xlink:href="http://wwwwaterdata.nemiusgs.gov/ContinuousNJ/Instantaneousnwis/help"
                                               xlink:title="Continuous/InstantaneousProvisional data subject to revision."/>
                            <wml2:uom uom="cfs"/>
                                       <om<wml2:observedPropertyinterpolationType
                                xlink:href="urn:ogc:def:phenomenon:OGC:Discharge"
               http://www.opengis.net/def/interpolationType/WaterML/2.0/Continuous"
                                xlink:title="DischargeContinuous/Instantaneous"/>
                                   <om</wml2:featureOfInterest>DefaultTVPMeasurementMetadata>
                                   <wml2:MonitoringPoint gml:id="USGS.MP.01446500">
                    <sf:sampledFeature
                        xlink:href="http://nwisvaws02.er.usgs.gov/ogc-swie/wfs?request=GetFeature&amp;featureId=01446500"/>
                    <sf:parameter>
                        <om:NamedValue>
                            <om:name xlink:title="Watershed"/>
                            <om:value>Middle Delaware-Musconetcong</om</wml2:defaultPointMetadata>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:00:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:15:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </omwml2:NamedValue>MeasurementTVP>
                    </sfwml2:parameter>point>
                    <sams<wml2:shape>point>
                        <gml:Point gml:id="USGS.P.01446500"><wml2:MeasurementTVP>
                            <gml:pos srsName="urn:ogc:def:crs:EPSG:4269">40.82638889
                                -75.08250000</gml:pos><wml2:time>2012-06-29T00:30:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </gmlwml2:Point>MeasurementTVP>
                    </samswml2:shape>point>
                    <wml2:descriptionReferencepoint>
                        xlink:href="http://external.opengis.org/twiki_public/bin/view/HydrologyDWG/SurfacewaterInteroperabilityExperiment#Use_Case_2"
                        xlink:title="This wiki page describes the IE"/> <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:45:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:timeZone>point>
                        <wml2:TimeZone>MeasurementTVP>
                            <wml2:zoneOffset>+00:time>2012-06-29T01:00:00-04:00</wml2:zoneOffset>time>
                            <wml2:zoneAbbreviation>EDT<value>2860</wml2:zoneAbbreviation>value>
                        </wml2:TimeZone>MeasurementTVP>
                    </wml2:timeZone>
                </wml2:MonitoringPoint>
            </om:featureOfInterest>
            <om:result>
                <wml2:MeasurementTimeseries gml:id="ts_01446500_00060_00000"point>          
<!-- A lot of points inbetween -->
                    <wml2:metadata>point>
                        <wml2:TimeseriesMetadata>MeasurementTVP>
                            <wml2:temporalExtent>
                                <gml:TimePeriod gml:id="USGS.TP.00060_00000">
                                    <gml:beginPosition>2012-06-29</gml:beginPosition>
                                    <gml:endPosition>2012-07-06</gml:endPosition>
                                </gml:TimePeriod>
                           time>2012-07-06T05:30:00-04:00</wml2:time>
                            <wml2:value>2690</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:temporalExtent>point>
                                       </wml2:TimeseriesMetadata>MeasurementTimeseries>
                               </wml2om:metadata>result>
                          <wml2:defaultPointMetadata>
                        <wml2:DefaultTVPMeasurementMetadata>
                            <wml2:qualifier xlink:href="http://waterdata.usgs.gov/NJ/nwis/help"
                                xlink:title="Provisional data subject to revision."/>
                            <wml2:uom uom="cfs"/>
                            <wml2:interpolationType
                                xlink:href="http://www.opengis.net/def/interpolationType/WaterML/2.0/Continuous"
                                xlink:title="Continuous/Instantaneous"/>
                        </wml2:DefaultTVPMeasurementMetadata>
                    </wml2:defaultPointMetadata>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:00:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:15:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:30:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T00:45:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-06-29T01:00:00-04:00</wml2:time>
                            <wml2:value>2860</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>          
<!-- A lot of points inbetween -->
                    <wml2:point>
                        <wml2:MeasurementTVP>
                            <wml2:time>2012-07-06T05:30:00-04:00</wml2:time>
                            <wml2:value>2690</wml2:value>
                        </wml2:MeasurementTVP>
                    </wml2:point>
                </wml2:MeasurementTimeseries>
            </om:result>
       </om:OM_Observation>
    </wml2:observationMember>
</wml2:Collection>

Fews configuration

In order to activate the WaterML import as a FEWS import, it is required to setup a TimeSeriesImportRun module configuration file and an accompanying IdMap file. Also the bin directory containing all WaterML resources must be placed in a location that can be accessed by the FEWS system.

WaterML2 Server import

Here is an example import module configuration file that imports data from a WaterMl2 webserver:

</om:OM_Observation>
    </wml2:observationMember>
</wml2:Collection>

Fews configuration

In order to activate the WaterML import as a FEWS import, it is required to setup a TimeSeriesImportRun module configuration file and an accompanying IdMap file. Also the bin directory containing all WaterML resources must be placed in a location that can be accessed by the FEWS system.

WaterML2 Server import

As of Stable 2017.02 the WaterMlServerParser and WaterMlTimeSeriesParser have been moved to the module lib-parsers-serializer. This implies that they can be configured using the importTypeStandard option and that there is no longer a need to provide the parser classes is a separate binary directory.

Version 2017.02 and later

Here is a 2017.02 and later example import module configuration file that imports data from a WaterMl2 webserver:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
    <!-- This is an example import configuration file for importing WaterML data from a WaterMl server    -->
    <import>
        <general>
			<importTypeStandard>wml2_server</importTypeStandard>
            <serverUrl>http://nwisvaws02.er.usgs.gov/ogc-swie/wml2/uv/sos</serverUrl>
			<relativeViewPeriod unit="hour" end="0" start="-3"/>             
			<idMapId>IdImportWaterML2_usgs</idMapId>
            <importTimeZone>
                <timeZoneOffset>-06:00</timeZoneOffset>
            </importTimeZone>
        </general>
        <properties>
            <!-- Optional: Use this option to write request and response messages to file. -->
            <string key="RequestsOutputDirectory" value="c:/temp/"/>
            <!-- Optional: Use this option to define what the request string must look like. This depends on how the WaterML2 webservice is setup. By using tags in the 
                 request template it is possible to insert the import parameters at run-time.
                 The following tags can be set:
				 @starttime@ = start time request period
				 @endtime@ = end time of request period
				 @locationid@ = location identifier
				 @parameterid@ = parameter identifier
				 @qualifier0@ = qualifier value 0 (can be used freely for additional purposes if required)
				 @qualifier1@ = qualifier value 1
				 @qualifier2@ = qualifier value 2
				 @qualifier3@ = qualifier value 3
            -->
            <string key="requestTemplate" value="format=wml2&amp;from=@starttime@&amp;to=@endtime@&amp;loc_id=@locationid@@&amp;par_id=@parameterid@"/>
            <!-- Optional: Maximum time in millis before a read action times-out. Read time is defined by the time betweend sending a request and start reading the response -->
            <int key="ReadTimeoutMillis" value="10000"/>
            <!-- Optional: Maximum time in millis for making the connection to the WaterML2 service. -->
            <int key="ConnectionTimeoutMillis" value="1000"/>
            <!-- Optional: Option to import multiple locations in single request. -->
            <bool key="RequestMultipleLocations" value="true"/>
        </properties>
        <timeSeriesSet>
            <moduleInstanceId>ImportWaterML2_usgs</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>MyPar</parameterId>
            <locationSetId>MyLocSet</locationSetId>
            <timeSeriesType>external historical</timeSeriesType>
            <timeStep unit="nonequidistant"/>
            <readWriteMode>add originals</readWriteMode>
            <synchLevel>1</synchLevel>
        </timeSeriesSet>
    </import>
</timeSeriesImportRun>

Note that when using qualifiers in the timeSeriesSet, in the idMapping both an internal and external qualifier need to be defined (with the same value):

<map externalParameter="206194010" internalParameter="DP.obs" internalQualifier="normal" externalQualifier="normal"/>

Versions before 2017.02

Here is a pre-2017.02 example import module configuration file that imports data from a WaterMl2 webserver:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
    <!-- This is an example import configuration file for importing WaterML data from a WaterMl server    -->
    <import>
        <general>
           <!-- Class name of WaterML server parser -->
            <parserClassName>nl.wldelft.waterml.timeseriesparsers.WaterMlServerParser</parserClassName>

            <!-- Path to directory containing libraries -->
            <binDir>%REGION_HOME%/Modules/waterml-bin</binDir>

            <!-- Directory from which CSV files are to be imported -->
            <serverUrl>http://nwisvaws02.er.usgs.gov/ogc-swie/wml2/uv/sos</serverUrl>
            <idMapId>IdImportWaterML2_usgs</idMapId>
            <importTimeZone>
                <timeZoneOffset>-06:00</timeZoneOffset>
            </importTimeZone>
        </general>
        <properties>
            <!-- Optional: Use this option to write request and response messages to file. -->
            <string key="RequestsOutputDirectory" value="c:/temp/"/>
            <!-- Optional: Use this option to define what the request string must look like. This depends on how the WaterML2 webservice is setup. By using tags in the 
                 request template it is possible to insert the import parameters at run-time.
                 The following tags can be set:
				 @starttime@ = start time request period
				 @endtime@ = end time of request period
				 @locationid@ = location identifier
				 @parameterid@ = parameter identifier
				 @qualifier0@ = qualifier value 0 (can be used freely for additional purposes if required)
				 @qualifier1@ = qualifier value 1
				 @qualifier2@ = qualifier value 2
				 @qualifier3@ = qualifier value 3
            -->
            <string key="requestTemplate" value="format=wml2&amp;from=@starttime@&amp;to=@endtime@&amp;loc_id=@locationid@@&amp;par_id=@parameterid@"/>
            <!-- Optional: Maximum time in millis before a read action times-out. Read time is defined by the time betweend sending a request and start reading the response -->
            <int key="ReadTimeoutMillis" value="10000"/>
            <!-- Optional: Maximum time in millis for making the connection to the WaterML2 service. -->
            <int key="ConnectionTimeoutMillis" value="1000"/>
            <!-- Optional: Option to import multiple locations in single request. -->
            <bool key="RequestMultipleLocations" value="true"/>

        </properties>
        <timeSeriesSet>
            <moduleInstanceId>ImportWaterML2_usgs</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>MyPar</parameterId>
            <locationSetId>MyLocSet</locationSetId>
            <timeSeriesType>external historical</timeSeriesType>
Code Block
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
                    <timeStep xmlns:xsiunit="http://www.w3.org/2001/XMLSchema-instance"nonequidistant"/>
            <readWriteMode>add originals</readWriteMode>
            <synchLevel>1</synchLevel>
         xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd"></timeSeriesSet>
    </import>
</timeSeriesImportRun>

WaterML2 file import

Version 2017.02 and later

Here is a 2017.02 and later example import module configuration file that imports data from a directory

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"<!-- This is an example import configuration file for importing WaterML data from a WaterMl server    -->
    <import>
        <general>
           <!-- Class name of WaterML server parser -->
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     <parserClassName>nlxsi:schemaLocation="http://www.wldelft.waterml.timeseriesparsers.WaterMlServerParser</parserClassName>

            <!-- Path to directory containing libraries -->
    nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
    <!-- This is an example import configuration file for importing WaterML data from a WaterMl server    -->
    <import>
        <general>
        <binDir>%REGION_HOME%/Modules/waterml-bin</binDir>    <importTypeStandard>wml2</importTypeStandard>

            <!-- Directory from which CSV files are to be imported -->
  	               <serverUrl>http://nwisvaws02.er.usgs.gov/ogc-swie/wml2/uv/sos</serverUrl> <folder>$IMPORT_FOLDER_WATERML$</folder>
            <idMapId>IdImportWaterML2_usgs</idMapId>
            <importTimeZone>
                <timeZoneOffset>-06:00</timeZoneOffset>
            </importTimeZone>
        </general>
        <timeSeriesSet>
            <moduleInstanceId>ImportWaterML2_usgs</moduleInstanceId>
            <<valueType>scalar</general>valueType>
           <properties> <parameterId>MyPar</parameterId>
            <!-- Optional: Use this option to write request and response messages to file. --><locationSetId>MyLocSet</locationSetId>
            <timeSeriesType>external historical</timeSeriesType>
            <string<timeStep keyunit="RequestsOutputDirectory" value="c:/temp/nonequidistant"/>
            <readWriteMode>add originals</readWriteMode>
            <synchLevel>1</synchLevel>
        </timeSeriesSet>
    </import>
</timeSeriesImportRun>

Versions before 2017.02

Here is a pre-2017.02 example import module configuration file that imports data from a directory:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
<!-- Optional: Use this option to define what the request string must look like. This depends on how the WaterML2 webservice is setup. By using tags in the 
                 request template it is possible to insert the import parameters at run-time. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 The following tags can be set:
				 @starttime@ = start time request period
				 @endtime@ = end time of request period
				 @locationid@ = location identifier
				 @parameterid@ = parameter identifier
				 @qualifier0@ = qualifier value 0 (can be used freely for additional purposes if required)
				 @qualifier1@ = qualifier value 1
				 @qualifier2@ = qualifier value 2
				 @qualifier3@ = qualifier value 3
           xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
    <!-- This is an example import configuration file for importing WaterML data from a WaterMl server    -->
    <import>
        <general>
           <!-- Class name of WaterML server parser -->
            <string key="requestTemplate" value="format=wml2&amp;from=@starttime@&amp;to=@endtime@&amp;loc_id=@locationid@@&amp;par_id=@parameterid@"/><parserClassName>nl.wldelft.waterml.timeseriesparsers.WaterMlTimeSeriesParser</parserClassName>

            <!-- Optional: Maximum time in millis before a read action times-out. Read time is defined by the time betweend sending a request and start reading the response Path to directory containing libraries -->
            <binDir>%REGION_HOME%/Modules/waterml-bin</binDir>

            <!-- Directory from which CSV files are to be imported -->
	    <folder>$IMPORT_FOLDER_WATERML$</folder>
        <string key="ReadTimeoutMillis" value="10000"/>    <idMapId>IdImportWaterML2_usgs</idMapId>
            <!-- Optional: Maximum time in millis for making the connection to the WaterML2 service. --><importTimeZone>
                <timeZoneOffset>-06:00</timeZoneOffset>
            <string key="ConnectionTimeoutMillis" value="1000"/></importTimeZone>
        </properties>general>
        <timeSeriesSet> <timeSeriesSet>
            <moduleInstanceId>ImportWaterML2_usgs</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>MyPar</parameterId>
            <locationSetId>MyLocSet</locationSetId>
            <timeSeriesType>external historical</timeSeriesType>
            <timeStep unit="nonequidistant"/>
            <readWriteMode>add originals</readWriteMode>
            <synchLevel>1</synchLevel>
        </timeSeriesSet>
    </import>
</timeSeriesImportRun>

WaterML2

...

Authentication

Currently the server import support two types of authentication: Basic Authentication and OAuth2.

Basic Authentication

Here is an example import module configuration file that imports data from a directoryconfiguration example showing how to configure Basic Authentication. Only a user name and password need to be configured.

Code Block
<general>
	<importTypeStandard>wml2_server</importTypeStandard>
    <serverUrl>https://dummy_hostname/KiWIS/KiWIS</serverUrl>
    <user>dummy_username</user>
    <password>dummy_password</password>
	...
 </general>


As of release 2017.02 it is also possible to configure OAuth2 authentication. This functionality has been backported to Stable 2016.02 and 2017.01, however the way to configure this in the older releases differs.

OAuth2 Authentication version 2017.02 and later

Code Block
<general>
	<importTypeStandard>wml2_server</importTypeStandard>
    <serverUrl>https://dummy_hostname/KiWIS/KiWIS</serverUrl>
    <!-- <user>dummy_username</user> -->				<!-- normally not required for OAuth2 -->
    <!-- <password>dummy_password</password> -->	<!-- normally not required for OAuth2 -->
    <oauth2Config>
		<!-- Required: URL from which to receive the access token
Code Block
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
    <!-- This is an example import configuration file for importing WaterML data from a WaterMl server    -->
    <import>
        <general>
           <!-- Class name of WaterML server parser -->
            <parserClassName>nl.wldelft.waterml.timeseriesparsers.WaterMlTimeSeriesParser</parserClassName>

            <!-- Path to directory containing libraries	<authUrl>https://dummy_hostname/auth</authUrl>
 		<!-- Optional: For proper OAuth2 authentication a client_id and client_secret are required. However in some cases the authentication URL does not require this. 
			 Instead Basic Authentication is required to access the authUrl. Here the user and password fields shown above are required -->
		<clientId>openid client id</clientId>
		<clientSecret>openid client secret</clientSecret>
		<!-- Optional Array: Scope of request -->
            <binDir>%REGION_HOME%/Modules/waterml-bin</binDir>

<scope>openid</scope>
            <scope>email</scope>
		<!-- DirectoryOptional fromArray: whichAudience CSVfor fileswhom arerequest tois beintended. imported -->
	    <folder>$IMPORT_FOLDER_WATERML$</folder>
            <idMapId>IdImportWaterML2_usgs</idMapId>
    Used to validate response. If omitted the clientId and username become are used -->
        <importTimeZone><audience>audienceId</audience>
        <audience>audienceId2</audience>
        <timeZoneOffset>-06:00</timeZoneOffset>
            </importTimeZone>
        </general><!-- Optional: Issuer of the access token. Used to validate response. If omitted the root url of authUrl is used. -->
        <timeSeriesSet><issuer>http://localhost:8080/KiWebPortal/auth</issuer>
       <!-- Optional: A refresh token can  <moduleInstanceId>ImportWaterML2_usgs</moduleInstanceId>
     be used if provider supports this. -->
       <valueType>scalar</valueType>
 <refreshToken>refresh access token</refreshToken>
	</oauth2Config>
	...
 </general>

OAuth2 Authentication versions before 2017.02

Code Block
<general>
	<importTypeStandard>wml2_server</importTypeStandard>
    <serverUrl>https://dummy_hostname/KiWIS/KiWIS</serverUrl>
     <parameterId>MyPar</parameterId>
      <!-- <user>dummy_username</user> -->				<!-- normally not required for OAuth2 -->
      <locationSetId>MyLocSet</locationSetId>
            <timeSeriesType>external historical</timeSeriesType><!-- <password>dummy_password</password> -->	<!-- normally not required for OAuth2 -->    
	...
 </general>
<properties>
   <string         <timeStep unit="nonequidistant"/>
            <readWriteMode>add originals</readWriteMode>key="authUrl" value="https://dummy_hostname/auth" />
   <string key="issuer" value="http://dummy_hostname_2:8080/KiWebPortal/auth" />
   <string key="clientId"  <synchLevel>1</synchLevel>value="id...." />
   <string     </timeSeriesSet>
    </import>
</timeSeriesImportRun>
key="clientSecret" value="*****" />
</properties>

WaterML2 IdMap configuration

...

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<!--NFFS EA TimeSeriesDataExchangeFormat flag conversion file for Import-->
<flagConversions xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/flagConversions.xsd">
    <flagConversion>
        <inputFlag>
            <name>External01</name>
            <value>E01</value>
        </inputFlag>
        <outputFlag>
            <name>ORIGINAL_RELIABLE</name>
            <value>0</value>
            <description>Observed value retrieved from external data source. Value is valid, marked as original reliable as validation is yet to be done</description>
        </outputFlag>
    </flagConversion>
    <flagConversion>
        <inputFlag>
            <name>External02</name>
            <value>E02</value>
        </inputFlag>
        <outputFlag>
            <name>COMPLETED_RELIABLE</name>
            <value>2</value>
            <description>Original value was missing. Value has been filled in through byteerpolation, transformation (e.g. stage discharge) or a model</description>
        </outputFlag>
    </flagConversion>
    <defaultOuputFlag>
        <name>ORIGINAL_RELIABLE</name>
        <value>0</value>
        <description>The data value is the original value retrieved from an external source and it successfully passes all validation criteria set.</description>
    </defaultOuputFlag>
    <missingValueFlag>
        <name>ORIGINAL_MISSING</name>
        <value>9</value>
    </missingValueFlag>
</flagConversions>

 


Parsing of response HRef items

...

result: GageHeight (element after last ':')