[mapserver-commits] r10637 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Oct 20 10:42:59 EDT 2010
Author: assefa
Date: 2010-10-20 07:42:59 -0700 (Wed, 20 Oct 2010)
New Revision: 10637
Modified:
trunk/mapserver/mapfile.c
trunk/mapserver/mapwfs.c
Log:
Axis not swapping when srs is not given #3574
Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c 2010-10-20 01:30:57 UTC (rev 10636)
+++ trunk/mapserver/mapfile.c 2010-10-20 14:42:59 UTC (rev 10637)
@@ -1248,6 +1248,9 @@
/************************************************************************/
int msLoadProjectionStringEPSG(projectionObj *p, const char *value)
{
+#ifdef USE_PROJ
+ if(p) msFreeProjection(p);
+
p->gt.need_geotransform = MS_FALSE;
if (strncasecmp(value, "EPSG:", 5) == 0)
@@ -1271,6 +1274,12 @@
}
return msLoadProjectionString(p, value);
+
+#else
+ msSetError(MS_PROJERR, "Projection support is not available.",
+ "msLoadProjectionStringEPSG()");
+ return(-1);
+#endif
}
Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c 2010-10-20 01:30:57 UTC (rev 10636)
+++ trunk/mapserver/mapwfs.c 2010-10-20 14:42:59 UTC (rev 10637)
@@ -302,6 +302,9 @@
queries layers
*/
pszMapSRS = msOWSGetEPSGProj(&(map->projection), &(map->web.metadata), "FO", MS_TRUE);
+ if(pszMapSRS && nVersion > OWS_1_0_0)
+ msLoadProjectionStringEPSG(&(map->projection), pszMapSRS);
+
if (srs == NULL || nVersion == OWS_1_0_0)
{
for (i=0; i<map->numlayers; i++)
@@ -2362,19 +2365,23 @@
{
layerObj *lp;
rectObj ext;
+ int status;
lp = GET_LAYER(map, j);
if (lp->status == MS_ON)
{
if (msOWSGetLayerExtent(map, lp, "FO", &ext) == MS_SUCCESS)
{
- char szBuf[32];
if (pszMapSRS != NULL && strncmp(pszMapSRS, "EPSG:", 5) == 0) {
- sprintf(szBuf, "init=epsg:%.10s", pszMapSRS+5);
- if (msLoadProjectionString(&(map->projection), szBuf) != 0) {
+ if( msOWSParseVersionString(paramsObj->pszVersion) >= OWS_1_1_0 )
+ status = msLoadProjectionStringEPSG(&(map->projection), pszMapSRS);
+ else
+ status = msLoadProjectionString(&(map->projection), pszMapSRS);
+
+ if (status != 0) {
msSetError(MS_WFSERR, "msLoadProjectionString() failed: %s",
- "msWFSGetFeature()", szBuf);
+ "msWFSGetFeature()", pszMapSRS);
return msWFSException(map, "mapserv", "NoApplicableCode",
paramsObj->pszVersion);
}
@@ -2390,8 +2397,10 @@
{
if (strncmp(pszLayerSRS, "EPSG:", 5) == 0)
{
- sprintf(szBuf, "init=epsg:%.10s", pszLayerSRS+5);
- msLoadProjectionString(&(lp->projection), szBuf);
+ if( msOWSParseVersionString(paramsObj->pszVersion) >= OWS_1_1_0 )
+ msLoadProjectionStringEPSG(&(lp->projection), pszLayerSRS);
+ else
+ msLoadProjectionString(&(lp->projection), pszLayerSRS);
}
}
}
More information about the mapserver-commits
mailing list