Skip to main content
1 of 4
Craig
  • 299
  • 4
  • 14

Not seeing the actual data value in getObservation response from MapServer 6

I'm experimenting with MapServer and SOS but I'm not getting back any useful data from the GetObservation call I'm doing. My .map file uses a Postgres query to get data and when I run that same query in PGAdmin I get the four columns I expect: id, geom, date and total_alkalinity_value. All the columns have the right data. Below is the getObservation response in which I see only the gml:boundedBy and ms:msGeometry values, no sign of the date, id or total_alkalinity_value.

<om:ObservationCollection xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:swe="http://www.opengis.net/swe/1.0.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sos="http://www.opengis.net/sos/1.0" xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns:om="http://www.opengis.net/om/1.0" gml:id="WQIS_TOTAL_ALKALINITY" xsi:schemaLocation="http://www.opengis.net/om/1.0 http://schemas.opengis.net/om/1.0.0/om.xsd http://mapserver.gis.umn.edu/mapserver http://wqis-sos.test.niwa.co.nz/cgi-bin/wqis-sos?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typename=total_alkalinity">
<om:member>
<om:Observation>
  <om:procedure xlink:href="urn:ogc:def:procedure:ALKALINITY_SENSOR"/>
  <om:observedProperty>
    <swe:CompositePhenomenon gml:id="total_alkalinity_value" dimension="3">
      <swe:component xlink:href="urn:ogc:def:property:OGC-SWE:1:id"/>
      <swe:component xlink:href="urn:ogc:def:property:OGC-SWE:1:date"/>
      <swe:component xlink:href="urn:ogc:def:property:OGC-SWE:1:total_alkalinity_value"/>
    </swe:CompositePhenomenon>
  </om:observedProperty>
  <om:featureOfInterest xlink:href="http://wqis-sos.test.niwa.co.nz/cgi-bin/wqis-sos?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typename=total_alkalinity"/>
  <om:result>
    <gml:featureMember>
      <ms:total_alkalinity>
        <gml:boundedBy>
          <gml:Envelope srsName="urn:ogc:crs:epsg:4326" srsDimension="2">
            <gml:lowerCorner>167.294382 -46.243591</gml:lowerCorner>
            <gml:upperCorner>167.294382 -46.243591</gml:upperCorner>
          </gml:Envelope>
        </gml:boundedBy>
        <ms:msGeometry>
          <gml:Point srsName="urn:ogc:crs:epsg:4326" srsDimension="2">
            <gml:pos>167.294382 -46.243591</gml:pos>
          </gml:Point>
        </ms:msGeometry>
      </ms:total_alkalinity>
    </gml:featureMember>
  </om:result>
</om:Observation>
</om:member>
</om:ObservationCollection>

And here is the relevant stuff from the layer part of the .map file

TYPE POINT
STATUS ON
NAME "total_alkalinity"
DUMP TRUE
DEBUG 0

CONNECTIONTYPE POSTGIS
CONNECTION XXXXX
DATA "geom from (
    SELECT se.id AS id,
         l.geom AS geom,
         CASE WHEN COALESCE ((se.start_date).month, 0) = 0
              THEN
                (se.start_date).year::CHAR(4)
              WHEN COALESCE ((se.start_date).day, 0) = 0
              THEN
                (se.start_date).year || '-' || (se.start_date).month || '-01'
              ELSE
                (se.start_date).year || '-' || (se.start_date).month || '-' || (se.start_date).day
         END::DATE AS date,
         av.value::NUMERIC AS total_alkalinity_value
    FROM XXXXXXXX
) AS se USING UNIQUE id USING SRID=4326"

So my question is: How do I get date, id and total_alkalinity_value in my getObservation response?

Craig
  • 299
  • 4
  • 14