[mapserver-commits] r7194 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Dec 20 09:51:06 EST 2007
Author: Assefa
Date: 2007-12-20 09:51:06 -0500 (Thu, 20 Dec 2007)
New Revision: 7194
Modified:
trunk/mapserver/mapogcfilter.c
Log:
Set the layer to be queryable when applying simple filters (#2450)
Modified: trunk/mapserver/mapogcfilter.c
===================================================================
--- trunk/mapserver/mapogcfilter.c 2007-12-20 14:44:56 UTC (rev 7193)
+++ trunk/mapserver/mapogcfilter.c 2007-12-20 14:51:06 UTC (rev 7194)
@@ -914,14 +914,19 @@
/* TODO: Doesn't this code leak the contents of any pre-existing class
* in the layer???
*/
- if (lp->numclasses == 0 &&
- msGrowLayerClasses(lp) == NULL)
- return MS_FAILURE;
- lp->numclasses = 1; /* set 1 so the query would work */
- initClass(lp->class[0]);
- lp->class[0]->type = lp->type;
- lp->class[0]->template = strdup("ttt.html");
+ /* make sure that the layer can be queried*/
+ if (!lp->template)
+ lp->template = strdup("ttt.html");
+ /* if there is no class, create at least one, so that query by rect
+ would work*/
+ if (lp->numclasses == 0)
+ {
+ if (msGrowLayerClasses(lp) == NULL)
+ return MS_FAILURE;
+ initClass(lp->class[0]);
+ }
+
bConcatWhere = 0;
bHasAWhere = 0;
if (lp->connectiontype == MS_POSTGIS || lp->connectiontype == MS_ORACLESPATIAL)
More information about the mapserver-commits
mailing list