# SensorML 2.0 Examples

## Simple Multiplexed Streaming

Previous examples illustrated the continuous streaming a values for a given data record. It is also possible to support a data stream consisting of a collection of different messages (i.e. records), each with their own data fields. These messages can occur in any order and any frequency and thus require the ability to distinguish one message type from the others. This is accomplished in SensorML by using the SWE Common DataChoice element within a DataStream.

In the example below, there are two message types: one for temperature measurements and one for wind measurements. Each are defined as a DataRecord and are items within a DataChoice element. In the resulting data stream, the first item of each message must be the item name, in order to distinguish the message type (this is similar to the "sentence type" used in the NMEA format.

An example of the stream data is given after the SensorML examaple.

NOTE: SensorML 2.0 is not yet approved by the Open Geospatial Consortium (OGC). Examples are provided for evaluation and are subject to change during the standards review and approval process. Contact mike.botts@botts-inc.net for questions or recommendations.

The encoding of this data stream is specified in the SensorML description as TextEncoding with a comma separating tokens (or fields) and a space separating blocks (or records). A stream of multiplexed measurements returned by the URL might look like:

TEMP,2009-05-23T19:36:15Z,25.5 TEMP,2009-05-23T19:37:15Z,25.6 WIND,2009-05-23T19:37:17Z,56.3,226.3 TEMP,2009-05-23T19:38:15Z,25.5 WIND,2009-05-23T19:38:16Z,58.4,225.1 ...