[mapserver-commits] r11078 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Mar 5 00:20:03 EST 2011


Author: sdlime
Date: 2011-03-04 21:20:03 -0800 (Fri, 04 Mar 2011)
New Revision: 11078

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapserv.c
   trunk/mapserver/mapserv.h
   trunk/mapserver/maptemplate.h
Log:
Remove map-oriented query modes (e.g.QUERYMAP). Use qformat parameter instead. (#3712)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-03-04 21:38:28 UTC (rev 11077)
+++ trunk/mapserver/HISTORY.TXT	2011-03-05 05:20:03 UTC (rev 11078)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Remove map-oriented query modes (e.g. QUERYMAP). Use qformat parameter instead. (#3712)
+
 - Implement single-pass query handling in mssql2008 driver as per RFC 65.
 
 - Fixed Sql Server 2008 key column name truncation (#3654)

Modified: trunk/mapserver/mapserv.c
===================================================================
--- trunk/mapserver/mapserv.c	2011-03-04 21:38:28 UTC (rev 11077)
+++ trunk/mapserver/mapserv.c	2011-03-05 05:20:03 UTC (rev 11078)
@@ -1566,8 +1566,6 @@
         switch(mapserv->Mode) {
         case ITEMFEATUREQUERY:
         case ITEMFEATURENQUERY:
-        case ITEMFEATUREQUERYMAP:
-        case ITEMFEATURENQUERYMAP:
           if((SelectLayerIndex = msGetLayerIndex(mapserv->map, SelectLayer)) == -1) { /* force the selection layer on */
             msSetError(MS_WEBERR, "Selection layer not set or references an invalid layer.", "mapserv()"); 
             writeError();
@@ -1592,7 +1590,7 @@
           mapserv->map->query.rect = mapserv->map->extent;
 
           mapserv->map->query.mode = MS_QUERY_MULTIPLE;
-          if(mapserv->Mode == ITEMFEATUREQUERY || mapserv->Mode == ITEMFEATUREQUERYMAP)
+          if(mapserv->Mode == ITEMFEATUREQUERY)
             mapserv->map->query.mode = MS_QUERY_SINGLE;
 
           mapserv->map->query.layer = QueryLayerIndex;
@@ -1600,15 +1598,13 @@
           break;
         case FEATUREQUERY:
         case FEATURENQUERY:
-        case FEATUREQUERYMAP:
-        case FEATURENQUERYMAP:
           if((SelectLayerIndex = msGetLayerIndex(mapserv->map, SelectLayer)) == -1) { /* force the selection layer on */
             msSetError(MS_WEBERR, "Selection layer not set or references an invalid layer.", "mapserv()"); 
             writeError();
           }
           GET_LAYER(mapserv->map, SelectLayerIndex)->status = MS_ON;
       
-          if(mapserv->Mode == FEATUREQUERY || mapserv->Mode == FEATUREQUERYMAP) {
+          if(mapserv->Mode == FEATUREQUERY) {
             switch(QueryCoordSource) {
             case FROMIMGPNT:
               mapserv->map->extent = mapserv->ImgExt; /* use the existing map extent */    
@@ -1630,7 +1626,7 @@
 
             mapserv->map->query.layer = QueryLayerIndex;
 	    mapserv->map->query.slayer = SelectLayerIndex; /* this will trigger the feature query eventually */
-          } else { /* FEATURENQUERY/FEATURENQUERYMAP */
+          } else { /* FEATURENQUERY */
             switch(QueryCoordSource) {
             case FROMIMGPNT:
               mapserv->map->extent = mapserv->ImgExt; /* use the existing map extent */    
@@ -1660,8 +1656,6 @@
           break;
         case ITEMQUERY:
         case ITEMNQUERY:
-        case ITEMQUERYMAP:
-        case ITEMNQUERYMAP:
           if(QueryLayerIndex < 0 || QueryLayerIndex >= mapserv->map->numlayers) {
             msSetError(MS_WEBERR, "Query layer not set or references an invalid layer.", "mapserv()"); 
             writeError();
@@ -1686,10 +1680,9 @@
 	  mapserv->map->query.rect = mapserv->map->extent;
 
 	  mapserv->map->query.mode = MS_QUERY_MULTIPLE;
-          if(mapserv->Mode == ITEMQUERY || mapserv->Mode == ITEMQUERYMAP) mapserv->map->query.mode = MS_QUERY_SINGLE;
+          if(mapserv->Mode == ITEMQUERY) mapserv->map->query.mode = MS_QUERY_SINGLE;
           break;
         case NQUERY:
-        case NQUERYMAP:
           mapserv->map->query.mode = MS_QUERY_MULTIPLE; /* all of these cases return multiple results */
           mapserv->map->query.layer = QueryLayerIndex;
 
@@ -1787,7 +1780,6 @@
 	  }
           break;
         case QUERY:
-        case QUERYMAP:
           switch(QueryCoordSource) {
           case FROMIMGPNT:
             setCoordinate();
@@ -1812,7 +1804,6 @@
           mapserv->map->query.buffer = mapserv->Buffer;          
           break;
         case INDEXQUERY:
-        case INDEXQUERYMAP:
           mapserv->map->query.type = MS_QUERY_BY_INDEX;
           mapserv->map->query.mode = MS_QUERY_SINGLE;
           mapserv->map->query.layer = QueryLayerIndex;
@@ -1831,32 +1822,13 @@
       if(mapserv->UseShapes)
         setExtentFromShapes();
 
-      /* just return the image, should be able to depricate these */
-      if(mapserv->Mode == QUERYMAP || mapserv->Mode == NQUERYMAP || mapserv->Mode == ITEMQUERYMAP || mapserv->Mode == ITEMNQUERYMAP || mapserv->Mode == FEATUREQUERYMAP || mapserv->Mode == FEATURENQUERYMAP || mapserv->Mode == ITEMFEATUREQUERYMAP || mapserv->Mode == ITEMFEATURENQUERYMAP || mapserv->Mode == INDEXQUERYMAP) {
-
-        checkWebScale(mapserv);
-
-        img = msDrawMap(mapserv->map, MS_TRUE);
-        if(!img) writeError();
-
-        if(mapserv->sendheaders) {
-          const char *attachment = msGetOutputFormatOption(mapserv->map->outputformat, "ATTACHMENT", NULL ); 
-          if(attachment) msIO_printf("Content-disposition: attachment; filename=%s\n", attachment);
-          msIO_printf("Content-type: %s%c%c",MS_IMAGE_MIME_TYPE(mapserv->map->outputformat), 10,10);
-         }
-        status = msSaveImage(mapserv->map, img, NULL);
-        if(status != MS_SUCCESS) writeError();
-        msFreeImage(img);
-
-      } else { /* process the query through templates */
-        if(msReturnTemplateQuery(mapserv, mapserv->map->web.queryformat, NULL) != MS_SUCCESS) writeError();
+      if(msReturnTemplateQuery(mapserv, mapserv->map->web.queryformat, NULL) != MS_SUCCESS) writeError();
           
-        if(mapserv->savequery) {
-          snprintf(buffer, sizeof(buffer), "%s%s%s%s", mapserv->map->web.imagepath, mapserv->map->name, mapserv->Id, MS_QUERY_EXTENSION);
-          if((status = msSaveQuery(mapserv->map, buffer, MS_FALSE)) != MS_SUCCESS) return status;
-        }
+      if(mapserv->savequery) {
+        snprintf(buffer, sizeof(buffer), "%s%s%s%s", mapserv->map->web.imagepath, mapserv->map->name, mapserv->Id, MS_QUERY_EXTENSION);
+        if((status = msSaveQuery(mapserv->map, buffer, MS_FALSE)) != MS_SUCCESS) return status;
       }
-
+      
     } else if(mapserv->Mode == COORDINATE) {
       setCoordinate(); /* mouse click => map coord */
       returnCoordinate(mapserv->mappnt);

Modified: trunk/mapserver/mapserv.h
===================================================================
--- trunk/mapserver/mapserv.h	2011-03-04 21:38:28 UTC (rev 11077)
+++ trunk/mapserver/mapserv.h	2011-03-05 05:20:03 UTC (rev 11078)
@@ -57,13 +57,11 @@
 /*
 ** Enumerated types, keep the query modes in sequence and at the end of the enumeration (mode enumeration is in maptemplate.h).
 */
-int numModes = 30;
-static char *modeStrings[30] = {"BROWSE","ZOOMIN","ZOOMOUT","MAP","LEGEND","LEGENDICON","REFERENCE","SCALEBAR","COORDINATE",
-                                "QUERY","QUERYMAP","NQUERY","NQUERYMAP",
-			        "ITEMQUERY","ITEMQUERYMAP","ITEMNQUERY","ITEMNQUERYMAP",
-				"FEATUREQUERY","FEATUREQUERYMAP","FEATURENQUERY","FEATURENQUERYMAP",
-				"ITEMFEATUREQUERY","ITEMFEATUREQUERYMAP","ITEMFEATURENQUERY","ITEMFEATURENQUERYMAP",
-				"INDEXQUERY","INDEXQUERYMAP","TILE","OWS", "WFS"};
+int numModes = 21;
+static char *modeStrings[21] = {"BROWSE","ZOOMIN","ZOOMOUT","MAP","LEGEND","LEGENDICON","REFERENCE","SCALEBAR","COORDINATE",
+                                "QUERY","NQUERY","ITEMQUERY","ITEMNQUERY",
+				"FEATUREQUERY","FEATURENQUERY","ITEMFEATUREQUERY","ITEMFEATURENQUERY",
+				"INDEXQUERY","TILE","OWS", "WFS"};
 
 /*
 ** Global variables

Modified: trunk/mapserver/maptemplate.h
===================================================================
--- trunk/mapserver/maptemplate.h	2011-03-04 21:38:28 UTC (rev 11077)
+++ trunk/mapserver/maptemplate.h	2011-03-05 05:20:03 UTC (rev 11078)
@@ -43,11 +43,9 @@
 enum coordSources {NONE, FROMIMGPNT, FROMIMGBOX, FROMIMGSHAPE, FROMREFPNT, FROMUSERPNT, FROMUSERBOX, FROMUSERSHAPE, FROMBUF, FROMSCALE, FROMTILE};
 
 enum modes {BROWSE, ZOOMIN, ZOOMOUT, MAP, LEGEND, LEGENDICON, REFERENCE, SCALEBAR, COORDINATE, 
-            QUERY, QUERYMAP, NQUERY, NQUERYMAP, 
-            ITEMQUERY, ITEMQUERYMAP, ITEMNQUERY, ITEMNQUERYMAP, 
-            FEATUREQUERY, FEATUREQUERYMAP, FEATURENQUERY, FEATURENQUERYMAP, 
-            ITEMFEATUREQUERY, ITEMFEATUREQUERYMAP, ITEMFEATURENQUERY, ITEMFEATURENQUERYMAP,
-            INDEXQUERY, INDEXQUERYMAP, TILE, OWS, WFS};
+            QUERY, NQUERY, ITEMQUERY, ITEMNQUERY, 
+            FEATUREQUERY, FEATURENQUERY, ITEMFEATUREQUERY, ITEMFEATURENQUERY, 
+            INDEXQUERY, TILE, OWS, WFS};
 
 
 /* struct mapservObj



More information about the mapserver-commits mailing list