geopython/OWSLib — pull request #171 by peterataylor (2014-08-05 00:54:18+00:00)
Title: SOS 2.0 and WaterML2.0 decoder

Hi Tom,

As discussed in https://github.com/geopython/OWSLib/issues/131.

Adding a decoder for SOS2.0 GetObservation requests that marshals XML responses from O&M and WaterML2.0 formats.

Summarised again here:

* **[om.py](https://github.com/peterataylor/OWSLib/blob/master/owslib/swe/observation/om.py)** - handles O&M types. New classes:
* OM_Observation - handles base level O&M observation properties, with a result property that will vary depending on the type of observation
* OM_MeasurementObservation - specialised OM_Observation that has a Measurement result (value + uom)

* **[waterml2.py](https://github.com/peterataylor/OWSLib/blob/master/owslib/swe/observation/waterml2.py)** - handles WaterML2.0 types. New classes:
* Timeseries, MeasurementTimeseries, TimeValuePair, TVPMetadata, TVPMeasurementMetadata, MeasurementTimeseriesDomainRange - types to support timeseries. Not all implemented at this stage, but enough to parse results from SOS2.0 instances, specifically the 52North implementations.
* MeasurementTimeseriesObservation - specialised OM_Observation that has a time-series as a result.

* **[sos200.py](https://github.com/peterataylor/OWSLib/blob/master/owslib/swe/observation/sos200.py)** - added:
* SOSGetObservationResponse - container for OM_Observation objects that result from a get_observation call to a SOS.
* ObservationDecoder - decoder class to handle different OM_Observation types. Currently supports OM_MeasurementObservation & MeasurementTimeseriesObservation.

The [main test](https://github.com/peterataylor/OWSLib/blob/master/tests/doctests/sos_20_timeseries_decoder_ioos.txt) I've added shows basic usage.

I've also changed the README file to be .MD rather than .txt so it renders on the landing page (https://github.com/peterataylor/OWSLib/commit/df622c707339f8b889553a217dcfd7909188f8c7, https://github.com/peterataylor/OWSLib/commit/48ea26b5f17354f9fa2447d8f1287ce5811b793d and https://github.com/peterataylor/OWSLib/commit/3730a677c7f322aa2f55af1dea7e594bfd308355). I can take these out of the PR if you prefer.

Updated the doco to include doc tests and supported versions: https://github.com/peterataylor/OWSLib/commit/3600cc830dec643bfb9f8762616231acbea59124.