WaterML: Encoding Hydrological Observations in XML

This article provides an overview of WaterML, an open standard developed to exchange hydrological data, and explains how it uses XML to structure and encode time-series observations. You will learn about the standard’s origin under the Open Geospatial Consortium (OGC), its core structural components, and how key elements—such as observation points, measurement procedures, and time-value pairs—are represented within an XML schema.


What Is the WaterML Standard?

WaterML (primarily deployed as WaterML 2.0) is an international standard developed jointly by the Open Geospatial Consortium (OGC) and the World Meteorological Organization (WMO). It defines an information model and XML encoding for the representation and exchange of hydrological observation data.

Before WaterML, water management agencies, research institutions, and environmental monitoring networks relied on fragmented, proprietary formats. WaterML standardizes how time-series data—such as river discharge, groundwater levels, water quality parameters, and precipitation—are structured, shared, and integrated across different software systems and geographic boundaries.

WaterML 2.0 is built on top of existing OGC foundational standards, specifically: * Geography Markup Language (GML): For representing geographic features and locations. * Observations and Measurements (O&M): For defining the relationship between what was observed, who or what observed it, and the resulting data.


How WaterML Encodes Hydrological Data in XML

WaterML organizes hydrological data into a structured XML hierarchy. An individual observation is typically captured under an XML root element that maps directly to the OGC Observations and Measurements framework: wml2:MeasurementTimeseriesObservation.

Inside this structure, the data is broken down into four essential components:

1. Feature of Interest (<wml2:featureOfInterest>)

This element defines the physical entity or location where the measurement took place, such as a gauging station, river cross-section, or monitoring well. It commonly incorporates GML elements to specify geographic coordinates, station names, and unique identifiers.

<wml2:featureOfInterest>
  <wml2:MonitoringPoint gml:id="station_101">
    <gml:name>Colorado River Gauge at Site A</gml:name>
    <gml:sampledFeature xlink:href="http://example.org/rivers/colorado"/>
    <wml2:shape>
      <gml:Point gml:id="p1" srsName="urn:ogc:def:crs:EPSG::4326">
        <gml:pos>36.0544 -112.1401</gml:pos>
      </gml:Point>
    </wml2:shape>
  </wml2:MonitoringPoint>
</wml2:featureOfInterest>

2. Observed Property (<wml2:observedProperty>)

This tag specifies the physical phenomenon being measured (e.g., water level, streamflow, pH). It typically links to a standardized concept or controlled vocabulary URI to ensure semantic consistency across systems.

<wml2:observedProperty xlink:href="http://vocabulary.example.org/parameters/discharge" xlink:title="Streamflow Discharge"/>

3. Observation Process and Procedure (<wml2:procedure>)

The procedure element provides metadata about the measurement method, sensor type, or calculation technique used to obtain the data. It can reference specific sensor models, data loggers, or rating curve methods.

4. The Result Time Series (<wml2:result>)

The core data is contained within the <wml2:MeasurementTimeseries> block. The time series consists of individual measurement points (<wml2:MeasurementTVP>), where each point represents a Time-Value Pair (TVP) along with relevant quality and interpolation metadata:

<wml2:result>
  <wml2:MeasurementTimeseries gml:id="ts_discharge_001">
    <wml2:defaultPointMetadata>
      <wml2:DefaultTVPMeasurementMetadata>
        <wml2:uom code="m3/s"/>
        <wml2:interpolationType xlink:href="http://www.opengis.net/def/waterml/2.0/interpolationType/Continuous"/>
      </wml2:DefaultTVPMeasurementMetadata>
    </wml2:defaultPointMetadata>
    <wml2:point>
      <wml2:MeasurementTVP>
        <wml2:time>2024-01-15T08:00:00Z</wml2:time>
        <wml2:value>45.2</wml2:value>
      </wml2:MeasurementTVP>
    </wml2:point>
    <wml2:point>
      <wml2:MeasurementTVP>
        <wml2:time>2024-01-15T09:00:00Z</wml2:time>
        <wml2:value>46.1</wml2:value>
      </wml2:MeasurementTVP>
    </wml2:point>
  </wml2:MeasurementTimeseries>
</wml2:result>

Summary of Benefits

By wrapping time-series observations in this standardized XML structure, WaterML ensures that: * Context is Preserved: Values are never separated from their units of measure, coordinates, or timestamps. * Data Quality is Transparent: Data qualifiers and processing levels are codified natively within the schema. * Systems Are Interoperable: Automated data services (such as OGC Sensor Observation Services) can parse, validate, and visualize water data from any provider without custom parsers.