[mapserver-commits] r8672 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sun Mar 8 15:25:29 EDT 2009


Author: assefa
Date: 2009-03-08 15:25:29 -0400 (Sun, 08 Mar 2009)
New Revision: 8672

Modified:
   trunk/mapserver/mapwfs.c
Log:
Set the map projection using the srsname for wfs1.1

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2009-03-08 19:03:45 UTC (rev 8671)
+++ trunk/mapserver/mapwfs.c	2009-03-08 19:25:29 UTC (rev 8672)
@@ -277,7 +277,7 @@
    }
    else
    {
-       msIO_printf("<!-- WARNING: Optional LatLongBoundingBox could not be established for this layer.  Consider setting LAYER.EXTENT or wfs_extent metadata. Also check that your data exists in the DATA statement -->\n");
+       msIO_printf("<!-- WARNING: Optional LatLongBoundingBox could not be established for this layer.  Consider setting the EXTENT in the LAYER object, or wfs_extent metadata. Also check that your data exists in the DATA statement -->\n");
    }
 
    msOWSPrintURLType(stdout, &(lp->metadata), "FO", "metadataurl", 
@@ -1074,6 +1074,7 @@
     else
       msFreeCharArray(tokens, n);
 
+   
     pszMapSRS = msOWSGetEPSGProj(&(map->projection), &(map->web.metadata), "FO", MS_TRUE);
 
     /* Keep only selected layers, set to OFF by default. */
@@ -1167,6 +1168,32 @@
     }
   }
 
+  /*
+      srs is defined for wfs 1.1. If it is available. If it used to set 
+      the map projection. For EPSG codes between 4000 and 5000 
+      that coordinates order follow what is defined  in the ESPG database
+      see #2899
+  */
+  if (strncmp(paramsObj->pszVersion,"1.1",3) == 0 && paramsObj->pszSrs && pszOutputSRS)
+  {     
+      /*check if the srs passed is valid. Assuming that it is an EPSG:xxx format.
+       TODO: do we accept urn type projection strings*/
+      if (strncasecmp(paramsObj->pszSrs, "EPSG:", 5) == 0)
+      {
+          if (strcasecmp(paramsObj->pszSrs, pszOutputSRS) != 0)
+          {
+              msSetError(MS_WFSERR, 
+		       "Invalid GetFeature Request: SRSNAME value should be valid for all the TYPENAMES. Please check the capabilities and reformulate your request.",
+                         "msWFSGetFeature()");
+              return msWFSException(map, "typename", "InvalidParameterValue", paramsObj->pszVersion);
+          }
+          /*we load the projection sting in the map and possibly 
+            set the axis order*/
+          msLoadProjectionStringEPSG(&(map->projection), paramsObj->pszSrs);
+      }
+  }
+ 
+
   /* Validate outputformat */
   if (paramsObj->pszOutputFormat) {
     /* We support only GML2 and GML3 for now. */



More information about the mapserver-commits mailing list