[mapserver-commits] r7479 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Mar 24 21:01:02 EDT 2008


Author: tomkralidis
Date: 2008-03-24 21:01:02 -0400 (Mon, 24 Mar 2008)
New Revision: 7479

Modified:
   trunk/mapserver/mapwfs11.c
Log:
change wfs:Keywords to ows:Keywords and add wfs:MetadataURL support (#2547)


Modified: trunk/mapserver/mapwfs11.c
===================================================================
--- trunk/mapserver/mapwfs11.c	2008-03-24 21:48:30 UTC (rev 7478)
+++ trunk/mapserver/mapwfs11.c	2008-03-25 01:01:02 UTC (rev 7479)
@@ -96,7 +96,7 @@
 {
     rectObj ext;
    
-    xmlNodePtr   psRootNode, psNode, psSubNode;
+    xmlNodePtr psRootNode, psNode;
     const char *value    = NULL;
 
     psRootNode = xmlNewNode(NULL, BAD_CAST "FeatureType");
@@ -121,26 +121,13 @@
       psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "Abstract", BAD_CAST value);
 
 
-    value = msOWSLookupMetadata(&(lp->metadata), "O", "keywordlist");
+    value = msOWSLookupMetadata(&(lp->metadata), "FO", "keywordlist");
 
-    if (value) 
-    {
-        char **tokens = NULL;
-        int n = 0;
-        int i = 0;
+    if (value)
+        msLibXml2GenerateList(
+            xmlNewChild(psRootNode, psOwsNs, BAD_CAST "Keywords", NULL),
+            NULL, "Keyword", value, ',' );
 
-        psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "Keywords", NULL);
-
-        tokens = msStringSplit(value, ',', &n);
-        if (tokens && n > 0) 
-        {
-            for (i=0; i<n; i++) 
-              psSubNode = xmlNewChild(psNode, NULL, BAD_CAST "Keyword", BAD_CAST tokens[i]);
-          
-            msFreeCharArray(tokens, n);
-        }
-    }
-
     /*srs only supposrt DefaultSRS with the same logic as for wfs1.0
       TODO support OtherSRS*/
     value = msOWSGetEPSGProj(&(map->projection),&(map->web.metadata),"FO",MS_TRUE);
@@ -179,13 +166,30 @@
         xmlNewChild(psRootNode, psOwsNs, BAD_CAST "WGS84BoundingBox", NULL);
         xmlAddSibling(psNode,
                       xmlNewComment(BAD_CAST "WARNING: Mandatory WGS84BoundingBox could not be established for this layer.  Consider setting LAYER.EXTENT or wfs_extent metadata."));
+    }
 
-        
+    value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_href");
+
+    if (value)
+    {
+        psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", BAD_CAST value);
+
+        value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_format");
+
+        if (!value)
+          value = strdup("text/html"); // default
+
+        xmlNewProp(psNode, BAD_CAST "format", BAD_CAST value);
+
+        value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_type");
+
+        if (!value)
+          value = strdup("FGDC"); // default
+
+        xmlNewProp(psNode, BAD_CAST "type", BAD_CAST value);
     }
 
     return psRootNode;
-
-
 }
 
 /************************************************************************/



More information about the mapserver-commits mailing list