Opened 18 years ago

Closed 17 years ago

#1754 closed defect (fixed)

[OGC:SOS] add gml_featureid to LAYER/METADATA for GetObservation output

Reported by: tomkralidis Owned by: assefa
Priority: high Milestone:
Component: SOS Server Version: unspecified
Severity: normal Keywords:
Cc:

Description

Many samples/observations have id's associated with them.

We should allow for gml_featureid in LAYER/METADATA, i.e.:

"gml_featureid" "SAMPLE_NU"

...which would be as per: http://mapserver.gis.umn.edu/docs/howto/wfs_server

...which would take the value from the record and apply it as the feature id as
per below:

<om:result>
 <gml:featureMember>
  <NS01EE0014 gml:id="some_id_value">

Attachments (1)

mapogcsos.c-bug1754.patch (962 bytes ) - added by tomkralidis 17 years ago.
patch for bug 1754

Download all attachments as: .zip

Change History (8)

comment:1 by tomkralidis, 18 years ago

Any update on this one?

comment:2 by assefa, 18 years ago

Owner: changed from mapserverbugs to assefa
reassigned.

by tomkralidis, 17 years ago

Attachment: mapogcsos.c-bug1754.patch added

patch for bug 1754

comment:3 by tomkralidis, 17 years ago

Assefa: can you check and verify the attached patch?

comment:4 by assefa, 17 years ago

Path seems correct with the following changes :

if (j<lp->numitems)

xmlNewNsProp(psNode, psNsGml, BAD_CAST "id", BAD_CAST sShape.values[j]);

and : should the featureid be only valid for SOS_featureid or is it also valid for GML_featureid and OWS_XXX. If that is the case, It should be changed to OSG and look like this :

msOWSLookupMetadata(&(lp->metadata), "OFG", "featureid");

comment:5 by tomkralidis, 17 years ago

Thanks. When I apply:

if (j<lp->numitems)

...and set the lookup to OSG, nothing ever comes out, ever. Does this work for you? I'm not sure of what this line does?

comment:6 by assefa, 17 years ago

I have tested it now locally :

pszFeatureId = msOWSLookupMetadata(&(lp->metadata), "OSG", "featureid"); works for me. (using "ows/sos/gml_featureid" "SAMPLE_NU")

the if shoudl be changed to open the layer, get items and you beed to add a layer close at the end

if(pszFeatureId && msLayerOpen(lp) == MS_SUCCESS && msLayerGetItems(lp) == MS_SUCCESS)

{ /* find the featureid amongst the items for this layer */

for(j=0; j<lp->numitems; j++) {

if(strcasecmp(lp->items[j], pszFeatureId) == 0) { /* found it */

break;

}

} if (j<lp->numitems)

xmlNewNsProp(psNode, psNsGml, BAD_CAST "id", BAD_CAST sShape.values[j]);

msLayerClose(lp);

}

if(pszFeatureId && msLayerOpen(lp) == MS_SUCCESS && msLayerGetItems(lp) == MS_SUCCESS)

comment:7 by tomkralidis, 17 years ago

Resolution: fixed
Status: newclosed

That seems to have worked. Thanks. Committed to trunk.

Note: See TracTickets for help on using tickets.