[mapserver-commits] r9356 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Sep 29 17:34:13 EDT 2009
Author: assefa
Date: 2009-09-29 17:34:13 -0400 (Tue, 29 Sep 2009)
New Revision: 9356
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapogr.cpp
trunk/mapserver/mapwfslayer.c
Log:
WFS Client seg fault (OGR layer not opened) (#3136)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-09-29 15:29:34 UTC (rev 9355)
+++ trunk/mapserver/HISTORY.TXT 2009-09-29 21:34:13 UTC (rev 9356)
@@ -14,9 +14,11 @@
Current Version (SVN trunk):
----------------------------
+- WFS Client seg fault (OGR layer not opened) (#3136)
+
- Reduce use of sqrt() calls when determining distances (#3134)
-- support axis odering for WFS 1.1 (#2899)
+- support axis ordering for WFS 1.1 (#2899)
- const changes to avoid warnings with msLoadProjectionString()
Modified: trunk/mapserver/mapogr.cpp
===================================================================
--- trunk/mapserver/mapogr.cpp 2009-09-29 15:29:34 UTC (rev 9355)
+++ trunk/mapserver/mapogr.cpp 2009-09-29 21:34:13 UTC (rev 9356)
@@ -2262,6 +2262,13 @@
#ifdef USE_OGR
msOGRFileInfo *psInfo =(msOGRFileInfo*)layer->layerinfo;
+ if (psInfo == NULL || psInfo->hLayer == NULL)
+ {
+ msSetError(MS_MISCERR, "Assertion failed: OGR layer not opened!!!",
+ "msOGRLayerGetItems()");
+ return(MS_FAILURE);
+ }
+
if( layer->tileindex != NULL )
{
if( psInfo->poCurTile == NULL
Modified: trunk/mapserver/mapwfslayer.c
===================================================================
--- trunk/mapserver/mapwfslayer.c 2009-09-29 15:29:34 UTC (rev 9355)
+++ trunk/mapserver/mapwfslayer.c 2009-09-29 21:34:13 UTC (rev 9356)
@@ -331,7 +331,8 @@
if (strncmp(pszVersion, "0.0.14", 6) != 0 &&
- strncmp(pszVersion, "1.0.0", 5) != 0 )
+ strncmp(pszVersion, "1.0.0", 5) != 0 &&
+ strncmp(pszVersion, "1.1", 3) != 0)
{
msSetError(MS_WFSCONNERR, "MapServer supports only WFS 1.0.0 or 0.0.14 (please verify the version metadata wfs_version).", "msBuildWFSLayerGetURL()");
return NULL;
@@ -779,6 +780,11 @@
(psInfo->pszGMLFilename && pszGMLFilename &&
strcmp(psInfo->pszGMLFilename, pszGMLFilename) == 0) )
{
+ if (lp->layerinfo == NULL)
+ {
+ if (msWFSLayerWhichShapes(lp, psInfo->rect) == MS_FAILURE)
+ return MS_FAILURE;
+ }
return MS_SUCCESS; /* Nothing to do... layer is already opened */
}
else
@@ -975,8 +981,9 @@
msProjectRect(&(lp->map->latlon), &(lp->projection), &ext);
if (!msRectOverlap(&rect, &ext))
{
- /* No overlap... nothing to do */
- return MS_DONE; /* No overlap. */
+ /* No overlap... nothing to do. If layer was never opened, go open it.*/
+ if (lp->layerinfo)
+ return MS_DONE; /* No overlap. */
}
}
More information about the mapserver-commits
mailing list