[mapserver-commits] r8512 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Fri Feb 6 19:06:14 EST 2009
Author: tomkralidis
Date: 2009-02-06 19:06:14 -0500 (Fri, 06 Feb 2009)
New Revision: 8512
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapogcsos.c
Log:
add gml:id to om:Observation (#2646)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-02-06 21:21:47 UTC (rev 8511)
+++ trunk/mapserver/HISTORY.TXT 2009-02-07 00:06:14 UTC (rev 8512)
@@ -12,6 +12,8 @@
Current Version (5.3-dev, SVN trunk):
------------------------------------
+- add gml:id to om:Observation (#2646)
+
- fix some XML validity issues (#2646)
- Fixed endianness issues with wide character strings for ArcSDE (#2878).
Modified: trunk/mapserver/mapogcsos.c
===================================================================
--- trunk/mapserver/mapogcsos.c 2009-02-06 21:21:47 UTC (rev 8511)
+++ trunk/mapserver/mapogcsos.c 2009-02-07 00:06:14 UTC (rev 8512)
@@ -651,6 +651,7 @@
layerObj *lpfirst = NULL;
const char *pszTimeField = NULL;
char *pszTmp = NULL;
+ char *pszOid = NULL;
char *pszTime = NULL;
char *pszValueShape = NULL;
const char *pszFeatureId = NULL;
@@ -671,6 +672,23 @@
psObsNode = xmlNewChild(psNode, NULL, BAD_CAST "Observation", BAD_CAST pszValue);
+ pszFeatureId = msOWSLookupMetadata(&(lp->metadata), "OSG", "featureid");
+
+ if(pszFeatureId && 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) {
+ pszOid = msStringConcatenate(pszOid, "o_");
+ pszOid = msStringConcatenate(pszOid, sShape.values[j]);
+ xmlNewNsProp(psObsNode, psNsGml, BAD_CAST "id", BAD_CAST pszOid);
+ msFree(pszOid);
+ }
+ }
+
/* order of elements is time, location, procedure, observedproperty
featureofinterest, result */
@@ -1684,7 +1702,6 @@
xmlFreeNs(psNsOgc);
xmlFreeNs(psNsSwe);
-
free(script_url);
free(script_url_encoded);
free(xsi_schemaLocation);
More information about the mapserver-commits
mailing list