Skip to content

Instantly share code, notes, and snippets.

@dstuebe
Last active December 12, 2015 12:28
Show Gist options
  • Save dstuebe/4771961 to your computer and use it in GitHub Desktop.
Save dstuebe/4771961 to your computer and use it in GitHub Desktop.
Proposed resolution for reference frame
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================
** COMMENTS on namespace specifications:
- gml: using an unversioned namespace has been confirmed to be ok;
the om 1.0 schema defines GML 3.1.1 as the version used
================================================== -->
<om:ObservationCollection
xmlns:om="http://www.opengis.net/om/1.0"
xmlns:gml="http://www.opengis.net/gml"
xmlns:swe="http://www.opengis.net/swe/1.0.1"
xmlns:swe2="http://www.opengis.net/swe/2.0"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- ==================================================================
TOP-LEVEL METADATA
=============================================================== -->
<!-- DISCLAIMER -->
<gml:metaDataProperty xlink:title="disclaimer">
<gml:GenericMetaData>
<gml:description>DISCLAIMER</gml:description>
</gml:GenericMetaData>
</gml:metaDataProperty>
<!-- IOOS SOS VERSION -->
<gml:metaDataProperty xlink:title="ioosTemplateVersion" xlink:href="http://code.google.com/p/ioostech/source/browse/#svn%2Ftrunk%2Ftemplates%2FMilestone1.0">
<gml:version>1.0</gml:version>
</gml:metaDataProperty>
<!-- COMMENT: MAKE THIS MANDATORY FOR NETWORK OFFERINGS, B/C THE RESPONSE
MAY SPAN >1 FEATURE TYPE?
BUT THEN REMOVE IT FROM om:featureOfInterest ?? -->
<gml:boundedBy>
<gml:Envelope srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
<gml:lowerCorner>34.7 -72.73</gml:lowerCorner>
<gml:upperCorner>34.7 -72.73</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<!-- ===========================================================
- For a station offering, the response will return one CF feature type,
corresponding to one om:member/om:Observation block.
- For a network offering, the response may return multiple stations
(features) spanning up to 3 CF feature types; each unique CF feature
type will be encoded in a separate om:member/om:Observation block
that may contain multiple stations.
=========================================================== -->
<om:member>
<om:Observation>
<!-- ==================================================================
=====================================================================
******* START OF "METADATA" BLOCK *******
=====================================================================
===================================================================== -->
<!-- ===========================================================
gml:description
Intended as fairly free-form text for human eyeballs.
COMMENTS: COME UP WITH USAGE GUIDELINE FOR THIS ELEMENT'S CONTENT
============================================================== -->
<gml:description>Observations at point station urn:ioos:station:wmo:41001,
150 NM East of Cape HATTERAS</gml:description>
<!-- ===========================================================
samplingTime
Includes all temporal response metadata, encoded as an iso8601 string.
Currently only UTC is supported/advocated.
============================================================== -->
<om:samplingTime>
<gml:TimePeriod>
<gml:beginPosition>2009-05-23T00:00:00Z</gml:beginPosition>
<gml:endPosition>2009-05-23T02:00:00Z</gml:endPosition>
</gml:TimePeriod>
</om:samplingTime>
<!-- ===========================================================
procedure
=========================================================== -->
<!-- additional stations returned by a network offering will be listed
as additional gml:member elements -->
<om:procedure>
<om:Process>
<gml:member xlink:href="urn:ioos:station:wmo:41001"/>
</om:Process>
</om:procedure>
<!-- ===========================================================
observedProperty
This block contains a list of *scalar* properties only, referencing the
MMI CF or IOOS parameter vocabularies; see the wiki documentation on the
topic for the choice of vocabularies. Requests constructed using composite
(vector) phenomena such as "winds" will return the scalar components only.
This scheme accommodates both true composite phenomena like winds, and
ad-hoc requests for multiple properties (eg, water and air temperature).
The general swe:CompositePhenomenon element is used even when the response
returns a single observed property.
============================================================== -->
<om:observedProperty>
<swe:CompositePhenomenon dimension="5" gml:id="observedproperties1">
<gml:name>Response Observed Properties</gml:name>
<swe:component xlink:href="http://mmisw.org/ont/cf/parameter/air_temperature"/>
<swe:component xlink:href="http://mmisw.org/ont/cf/parameter/wind_speed"/>
<swe:component xlink:href="http://mmisw.org/ont/cf/parameter/wind_direction"/>
<swe:component xlink:href="http://mmisw.org/ont/cf/parameter/sea_water_temperature"/>
<swe:component xlink:href="http://mmisw.org/ont/ioos/parameter/dissolved_oxygen"/>
</swe:CompositePhenomenon>
</om:observedProperty>
<!-- ===========================================================
featureOfInterest
Encompasses *all* spatial and feature-type response metadata.
============================================================== -->
<om:featureOfInterest>
<gml:FeatureCollection>
<!-- CF Feature Type (discrete-sampling-geometry). COMMENT: Why vers. 1.6 specifically? -->
<gml:metaDataProperty>
<gml:name codeSpace="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.6/cf-conventions.html#discrete-sampling-geometries">timeSeries</gml:name>
</gml:metaDataProperty>
<!-- Geographic (lat lon) Bounding Box -->
<gml:boundedBy>
<gml:Envelope srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
<gml:lowerCorner>34.7 -72.73</gml:lowerCorner>
<gml:upperCorner>34.7 -72.73</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<!-- Feature geographic location (lat & lon only, no z) -->
<!-- Always use epsg 4326.
Use gml:location/gml:MultiPoint/gml:pointMembers as a generalized way to
also handle Network-offering responses that include multiple points (stations).
This is analogous to our use of om:observedProperty/swe:CompositePhenomenon
even for single-property responses. -->
<gml:location>
<gml:MultiPoint srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
<gml:pointMembers>
<gml:Point>
<gml:name>urn:ioos:station:wmo:41001</gml:name>
<gml:pos>34.7 -72.73</gml:pos>
</gml:Point>
</gml:pointMembers>
</gml:MultiPoint>
</gml:location>
</gml:FeatureCollection>
</om:featureOfInterest>
<!-- Define Compound Coordiant Reference System -->
<gml:CompoundCRS gml:id="IOOS_Buoy_CRS">
<gml:validArea>
<gml:description> World wide for any floating sensor or platform </gml:description>
</gml:validArea>
<gml:includesCRS>
<GeographicCRS xlink:href="urn:ogc:def:crs:EPSG::4326" xlink:title="WGS 84"/>
</gml:includesCRS>
<gml:includesCRS>
<gml:VerticalCRS gml:id="IOOS_Vertical_CRS">
<gml:usesVerticalCS>
<gml:VerticalCS gml:id="EPSG6499" xlink:href="urn:ogc:def:cs:EPSG::6499" xlink:title="Vertical CS. Axis: height (H). Orientation: up. UoM: m."/>
</gml:usesVerticalCS>
<gml:usesVerticalDatum>
<gml:VerticalDatum gml:id="EPSG5113" xlink:href="urn:ogc:def:crs:EPSG::5113" xlink:title="Instantaneous Water Level"/>
</gml:usesVerticalDatum>
</gml:VerticalCRS>
</gml:includesCRS>
</gml:CompoundCRS>
<!-- ==================================================================
=====================================================================
******* END OF "METADATA" BLOCK *******
=====================================================================
===================================================================== -->
<!-- ===========================================================
om:result (THE "DATA" BLOCK)
=========================================================== -->
<om:result>
<swe2:DataStream>
<!-- EMILIO, 9/12/2012: IT'D BE USEFUL FOR PARSING TO DISTINGUISH BETWEEN
*SCALAR* AND *AGGREGATED* FIELDS.
The attribute xlink:type apparently can only have a fixed value of "simple".
Maybe xlink:role="aggregated" vs xlink:role="scalar" ?? -->
<swe2:elementType name="components">
<swe2:DataRecord>
<!-- ==================== PLATFORM-WIDE FIELDS ======================= -->
<!-- stationID
For consistency, "stationID" should always be spelled out this way,
(and never as, say, "station_id") using the same case, for readability. -->
<swe2:field name="stationID">
<swe2:Text definition="http://mmisw.org/ont/ioos/definition/stationID">
<swe2:value>urn:ioos:station:wmo:41001</swe2:value>
</swe2:Text>
</swe2:field>
<!-- The location of the platform relative to WGS 84 (Horizontal) and Instantaneous Water Level (Vertical) -->
<swe2:field name="platformLocation">
<swe2:Vector definition="http://www.opengis.net/def/property/OGC/0/PlatformLocation"
referenceFrame="#IOOS_Buoy_CRS"
localFrame="#PlatformFrame">
<swe2:coordinate name="latitude">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/latitude" axisID="Lat">
<swe2:uom code="deg"/>
<swe2:value>32.5</swe2:value>
</swe2:Quantity>
</swe2:coordinate>
<swe2:coordinate name="longitude">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/longitude" axisID="Lon">
<swe2:uom code="deg"/>
<swe2:value>-78.5</swe2:value>
</swe2:Quantity>
</swe2:coordinate>
<swe2:coordinate name="height">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/height" axisID="Z">
<swe2:uom code="m"/>
<swe2:value>0</swe2:value>
</swe2:Quantity>
</swe2:coordinate>
</swe2:Vector>
</swe2:field>
<!-- date-time -->
<swe2:field name="time">
<swe2:Time definition="http://www.opengis.net/def/property/OGC/0/SamplingTime">
<swe2:uom xlink:href="http://www.opengis.net/def/uom/ISO-8601/0/Gregorian"/>
</swe2:Time>
</swe2:field>
<!-- ==================== SENSOR-SPECIFIC FIELDS ======================= -->
<swe2:field name="sensorData">
<swe2:DataChoice>
<!-- ===========================================================
sensorID urn
COMMENTS:
- The sensorID urn may use a meaningful "component" name (eg, "sbe16"); or,
if not available, a simple, constant string followed by an integer counter
such as "sensor1", "sensor2", "salt1", etc.
- swe:item name attribute should be globally unique within this response,
at the very least within each om:member/om:Observation block.
=========================================================== -->
<!-- ===========================================================
custom swe:item field definitions
The swe:item@name value should be the same as the sensor urn "component"
(the last urn element) below
=========================================================== -->
<swe2:item name="sensor1">
<swe2:DataRecord>
<!-- sensorID and the "Z" dimension (eg, altitude) -->
<swe2:field name="sensorID">
<swe2:Text definition="http://mmisw.org/ont/ioos/definition/sensorID">
<swe2:value>urn:ioos:station:wmo:41001:sensor1</swe2:value>
</swe2:Text>
</swe2:field>
<!-- The location of the sensor relative to the platform -->
<swe2:field name="height">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/height" referenceFrame="#PlatformFrame">
<swe2:uom code="m"/>
<swe2:value>5</swe2:value>
</swe2:Quantity>
</swe2:field>
<!-- ===========================================================
We don't currently have enough information about orientation and relative position
of sensors on a platform to define a sensor reference frame, but it is certainly
possible to do if and when that is needed.
=========================================================== -->
<!-- The "data" fields follow (measured quantities/properties) -->
<swe2:field name="air_temperature">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/air_temperature">
<swe2:uom code="Celsius"/>
</swe2:Quantity>
</swe2:field>
<swe2:field name="wind_speed">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/wind_speed">
<swe2:uom code="m/s"/>
</swe2:Quantity>
</swe2:field>
<swe2:field name="wind_to_direction">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/wind_to_direction">
<swe2:uom code="degrees"/>
</swe2:Quantity>
</swe2:field>
</swe2:DataRecord>
</swe2:item>
<!-- ===========================================================
custom swe:item field definitions
=========================================================== -->
<swe2:item name="sensor2">
<swe2:DataRecord>
<!-- sensorID and the "Z" dimension (eg, altitude) -->
<swe2:field name="sensorID">
<swe2:Text definition="http://mmisw.org/ont/ioos/definition/sensorID">
<swe2:value>urn:ioos:station:wmo:41001:sensor2</swe2:value>
</swe2:Text>
</swe2:field>
<!-- The location of the sensor relative to the platform -->
<swe2:field name="depth">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/depth" referenceFrame="#PlatformFrame">
<swe2:uom code="m"/>
<swe2:value>2</swe2:value>
</swe2:Quantity>
</swe2:field>
<!-- The "data" fields follow (measured quantities/properties) -->
<swe2:field name="sea_water_temperature">
<swe2:Quantity definition="http://mmisw.org/ont/cf/parameter/sea_water_temperature">
<swe2:uom code="Celsius"/>
</swe2:Quantity>
</swe2:field>
<swe2:field name="dissolved_oxygen">
<swe2:Quantity definition="http://mmisw.org/ont/ioos/parameter/dissolved_oxygen">
<swe2:uom code="mg/L"/>
</swe2:Quantity>
</swe2:field>
</swe2:DataRecord>
</swe2:item>
</swe2:DataChoice>
</swe2:field>
</swe2:DataRecord>
</swe2:elementType>
<!-- ===========================================================
SWE encoding and data values
swe:encoding *must* be always specified exactly as described below,
to avoid the need to have fully general parsers that interpret
swe:TextEncoding. That is, parsers may hard-code this particular
swe:TextEncoding specification.
=========================================================== -->
<swe2:encoding>
<swe2:TextEncoding decimalSeparator="." tokenSeparator="," blockSeparator="\n"/>
</swe2:encoding>
<swe2:values>
2009-05-23T00:00:00Z,sensor1,15.4,2.0,280
2009-05-23T01:00:00Z,sensor1,15.8,1.8,121
2009-05-23T02:00:00Z,sensor1,15.6,1.0,1.42
2009-05-23T00:00:00Z,sensor2,5.6,8.0
2009-05-23T01:00:00Z,sensor2,5.8,8.2
2009-05-23T02:00:00Z,sensor2,5.7,8.5
</swe2:values>
</swe2:DataStream>
</om:result>
</om:Observation>
</om:member>
</om:ObservationCollection>
@dstuebe
Copy link
Author

dstuebe commented Feb 12, 2013

Search for EPSG stuff here: http://www.epsg-registry.org/

@dstuebe
Copy link
Author

dstuebe commented Feb 12, 2013

Search for EPSG stuff here: http://www.epsg-registry.org/

@dstuebe
Copy link
Author

dstuebe commented Feb 18, 2013

Realized that 5113 is a datum, not a crs and should not be used in the way that I have in the current version:
https://gist.github.com/dstuebe/4771961#file-go-station-singleft-timeseries-multisensor-xml-L158

Adding update shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment