[mapserver-commits] r9162 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Jul 11 09:16:42 EDT 2009
Author: sdlime
Date: 2009-07-11 09:16:41 -0400 (Sat, 11 Jul 2009)
New Revision: 9162
Modified:
trunk/mapserver/maplayer.c
trunk/mapserver/mapserver.h
Log:
Changed default function for msLayerGetItems() to return MS_SUCCESS instead of MS_FAILURE. No items is legitimate. Part of #3069 implementation.
Modified: trunk/mapserver/maplayer.c
===================================================================
--- trunk/mapserver/maplayer.c 2009-07-10 21:57:41 UTC (rev 9161)
+++ trunk/mapserver/maplayer.c 2009-07-11 13:16:41 UTC (rev 9162)
@@ -352,13 +352,10 @@
*/
rv = msLayerGetItems(layer);
- if(rv != MS_SUCCESS) {
- if(layer->connectiontype == MS_INLINE)
- return MS_SUCCESS; /* no items fine for inline layers (TODO: re-examine this) */
- else
- return rv;
- }
+ if(rv != MS_SUCCESS) return rv;
+ if(layer->numitems == 0) return MS_SUCCESS; /* nothing to do but not an error */
+
items = layer->items; /* save for later */
numitems = layer->numitems;
@@ -919,7 +916,7 @@
int
LayerDefaultGetItems(layerObj *layer)
{
- return MS_FAILURE;
+ return MS_SUCCESS; /* returning no items is legit */
}
int
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2009-07-10 21:57:41 UTC (rev 9161)
+++ trunk/mapserver/mapserver.h 2009-07-11 13:16:41 UTC (rev 9162)
@@ -379,7 +379,8 @@
enum MS_JOIN_CONNECTION_TYPE {MS_DB_XBASE, MS_DB_CSV, MS_DB_MYSQL, MS_DB_ORACLE, MS_DB_POSTGRES};
enum MS_JOIN_TYPE {MS_JOIN_ONE_TO_ONE, MS_JOIN_ONE_TO_MANY};
-enum MS_QUERY_TYPES {MS_QUERY_BY_POINT, MS_QUERY_BY_POINT_UNIQUE, MS_QUERY_BY_RECT, MS_QUERY_BY_SHAPE, MS_QUERY_BY_FEATURES, MS_QUERY_BY_OPERATOR};
+enum MS_QUERY_MODE {MS_QUERY_SINGLE, MS_QUERY_MULTIPLE};
+enum MS_QUERY_TYPE {MS_QUERY_BY_POINT, MS_QUERY_BY_RECT, MS_QUERY_BY_SHAPE, MS_QUERY_BY_FEATURES, MS_QUERY_BY_OPERATOR};
enum MS_ALIGN_VALUE {MS_ALIGN_LEFT, MS_ALIGN_CENTER, MS_ALIGN_RIGHT};
@@ -568,6 +569,23 @@
#define MS_NOOVERRIDE -1111
/************************************************************************/
+/* queryObj */
+/* */
+/* encapsulates the information necessary to perform a query */
+/************************************************************************/
+typedef struct {
+ int type; /* MS_QUERY_TYPE */
+ int mode; /* MS_QUERY_MODE */
+ int qlayer;
+
+ pointObj point; /* by point */
+ rectObj rect; /* by rect */
+ shapeObj *shape;
+
+ int slayer;
+} queryObj;
+
+/************************************************************************/
/* queryMapObj */
/* */
/* used to visualize query results */
More information about the mapserver-commits
mailing list