[mapserver-commits] r7404 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Feb 26 08:18:17 EST 2008


Author: tomkralidis
Date: 2008-02-26 08:18:16 -0500 (Tue, 26 Feb 2008)
New Revision: 7404

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/MIGRATION_GUIDE.TXT
   trunk/mapserver/mapogcsos.c
Log:
support URN scheme for components of observed property elements (#2522)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-02-26 03:30:43 UTC (rev 7403)
+++ trunk/mapserver/HISTORY.TXT	2008-02-26 13:18:16 UTC (rev 7404)
@@ -13,6 +13,8 @@
 Current Version (5.1-dev, SVN trunk):
 -------------------------------------
 
+- support URN scheme for components of observed property elements (#2522)
+
 - Fixed gdImagePtr gdPImg memory leak in msSaveImageBufferGD() (#2525)
 
 - mapogcsos.c: handle invalid POST requests (#2521)

Modified: trunk/mapserver/MIGRATION_GUIDE.TXT
===================================================================
--- trunk/mapserver/MIGRATION_GUIDE.TXT	2008-02-26 03:30:43 UTC (rev 7403)
+++ trunk/mapserver/MIGRATION_GUIDE.TXT	2008-02-26 13:18:16 UTC (rev 7404)
@@ -242,7 +242,7 @@
 ----------------------------------------------------
 OGC Sensor Observation Service (SOS)
 ----------------------------------------------------
-The format of MAP/LAYER/WEB/METADATA/sos_describesensor_url
+- The format of MAP/LAYER/METADATA/sos_describesensor_url
 has been changed such that users now must format the value
 per:
 
@@ -251,6 +251,14 @@
 This change has been made to clarify and unify the meaning of procedure
 within SOS Server's context of a DescribeSensor request.
 
+- Metadata associated with an observedProperty element's
+swe:component value have been changed to support a URN
+scheme, instead of the previous "sos_componenturl" metadata.  The
+"sos_componenturl" metadata is no longer supported.  Instead,
+"sos_observedproperty_authority" and "sos_observedproperty_version"
+should be used to format the swe:component value.
+
+
 ----------------------------------------------------
 Build Changes
 ----------------------------------------------------

Modified: trunk/mapserver/mapogcsos.c
===================================================================
--- trunk/mapserver/mapogcsos.c	2008-02-26 03:30:43 UTC (rev 7403)
+++ trunk/mapserver/mapogcsos.c	2008-02-26 13:18:16 UTC (rev 7404)
@@ -310,10 +310,12 @@
 
 void msSOSAddPropertyNode(xmlNsPtr psNsSwe, xmlNsPtr psNsXLink,xmlNodePtr psParent, layerObj *lp,  xmlNsPtr psNsGml)
 {
-    const char *pszValue = NULL, *pszFullName = NULL;
+    const char *pszValue = NULL;
+    char *pszTmpVal = NULL, *pszFullName = NULL;
     xmlNodePtr psCompNode, psNode;
     int i, j=0;
     char szTmp[256];
+    const char *pszComponentBase = "urn:ogc:def:property:";
 
     if (psParent && lp)
     {
@@ -331,32 +333,54 @@
           psNode = xmlNewChild(psCompNode, psNsGml, 
                                  BAD_CAST "name", BAD_CAST pszValue);
 
-        /* add componenets */
-        /*  Components are exposed 
-            using the metadata sos_%s_componenturl "url value" where 
-            the %s is the name of the  attribute. */
-        
+        /* add components */
+ 
         /*assuming that the layer is opened and msLayerGetItems called*/ 
         for(i=0; i<lp->numitems; i++) 
         {
-            sprintf(szTmp, "%s_componenturl", lp->items[i]);
+            pszValue = msOWSLookupMetadata(&(lp->metadata), "S", "observedproperty_authority");
+
+            if (pszValue)
+              pszTmpVal = strdup(pszValue);
+            else
+              pszTmpVal = strdup("OGC-SWE");
+
+            pszFullName = strdup(pszComponentBase);
+
+            pszFullName = msStringConcatenate(pszFullName, pszTmpVal);
+
+            free(pszTmpVal);
+
+            pszFullName = msStringConcatenate(pszFullName, ":");
+
+            pszValue = msOWSLookupMetadata(&(lp->metadata), "S", "observedproperty_version");
+
+            if (pszValue)
+              pszTmpVal = strdup(pszValue);
+            else 
+              pszTmpVal = strdup("1");
+
+            pszFullName = msStringConcatenate(pszFullName, pszTmpVal);
+
+            free(pszTmpVal);
+
+            pszFullName = msStringConcatenate(pszFullName, ":");
+
+            sprintf(szTmp, "%s_alias", lp->items[i]);
             pszValue = msOWSLookupMetadata(&(lp->metadata), "S", szTmp);
+
             if (pszValue)
-            {
-                psNode = xmlNewChild(psCompNode, psNsSwe,
-                                     BAD_CAST "component", NULL);
+              pszTmpVal = strdup(pszValue);
+            else
+              pszTmpVal = strdup(lp->items[i]);
 
-                /* check if there is an alias/full name used*/
-                sprintf(szTmp, "%s_alias", lp->items[i]);
-                pszFullName = msOWSLookupMetadata(&(lp->metadata), "S", szTmp);
-                //if (pszFullName)
-                //  xmlNewNsProp(psNode, NULL, BAD_CAST "name", BAD_CAST pszFullName);
-                //else
-                //  xmlNewNsProp(psNode, NULL, BAD_CAST "name", BAD_CAST lp->items[i]);
+            pszFullName = msStringConcatenate(pszFullName, pszTmpVal);
 
-                xmlNewNsProp(psNode, psNsXLink, BAD_CAST "href", BAD_CAST pszValue);
-                j++;
-            }
+            psNode = xmlNewChild(psCompNode, psNsSwe, BAD_CAST "component", NULL);
+
+            xmlNewNsProp(psNode, psNsXLink, BAD_CAST "href", BAD_CAST pszFullName);
+            free(pszFullName);
+            j++;
         }
         xmlNewNsProp(psCompNode, NULL, BAD_CAST "dimension", BAD_CAST msIntToString(j));
     }	
@@ -583,7 +607,7 @@
         /*assuming that the layer is open */       
         for(i=0; i<lp->numitems; i++) 
         {
-            sprintf(szTmp, "%s_componenturl", lp->items[i]);
+            sprintf(szTmp, "%s_alias", lp->items[i]);
             pszValue = msOWSLookupMetadata(&(lp->metadata), "S", szTmp);
             if (pszValue)
             {
@@ -599,7 +623,6 @@
 
                 psNode = xmlNewChild(psNode, NULL, BAD_CAST "Quantity", NULL);
 
-                /*TODO : are definition and uom manadtory?*/
                 /*get definition and uom*/
                 sprintf(szTmp, "%s_definition", lp->items[i]);
                 pszDefinition =  msOWSLookupMetadata(&(lp->metadata), "S", szTmp);
@@ -828,7 +851,7 @@
         msSOSAddGeometryNode(psNsGml, psLayerNode, lp, &sShape, pszEpsg);
 
         /*attributes */
-        /* TODO only output attributes where there is a sos_%s_componenturl (to be discussed)*/
+        /* TODO only output attributes where there is a sos_%s_alias (to be discussed)*/
         /* the first layer is the one that has to have all the metadata defined */
         lpfirst = msSOSGetFirstLayerForOffering(map, 
                                                 msOWSLookupMetadata(&(lp->metadata), "S", 
@@ -841,7 +864,7 @@
         {
             for(i=0; i<lpfirst->numitems; i++) 
             {
-                sprintf(szTmp, "%s_componenturl", lpfirst->items[i]);
+                sprintf(szTmp, "%s_alias", lpfirst->items[i]);
                 pszValue = msOWSLookupMetadata(&(lpfirst->metadata), "S", szTmp);
                 if (pszValue)
                 {
@@ -949,7 +972,7 @@
                                      "encoding_tokenSeparator");
         for(i=0; i<lpfirst->numitems; i++) 
         {
-            sprintf(szTmp, "%s_componenturl", lpfirst->items[i]);
+            sprintf(szTmp, "%s_alias", lpfirst->items[i]);
             pszValue = msOWSLookupMetadata(&(lpfirst->metadata), "S", szTmp);
             if (pszValue)
             {
@@ -993,7 +1016,7 @@
     const char *value = NULL;
 
     /*always featch the first layer that has the same offering id and observered propery.
-     This allows to only define all the attributes and componenets on the first layer if the user
+     This allows to only define all the attributes and components on the first layer if the user
     wants to present several mapserver layers as the same offering.*/
     lpfirst = msSOSGetFirstLayerForOffering(map, 
                                             msOWSLookupMetadata(&(lp->metadata), "S", 
@@ -1603,9 +1626,8 @@
                  /*observed property */
                  /* observed property are equivalent to layers. We can group 
                     sevaral layers using the same sos_observedproperty_id. The 
-                    components are the attributes. Componenets are exposed 
-                    using the metadata sos_%s_componenturl "url value" where 
-                    the %s is the name of the  attribute.We need at least one.*/
+                    components are the attributes. Components are exposed 
+                    using the metadata sos_%s_aliasl */
                  
                  nProperties = 0;
                  papszProperties = 



More information about the mapserver-commits mailing list