Opened 20 years ago

Closed 20 years ago

#1003 closed defect (fixed)

mapext=shapes with projected layers

Reported by: silke@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer CGI Version: 4.2
Severity: normal Keywords:
Cc:

Description

Using mapserver 4.2.3 I used 
mode=query
mapext=shapes
qlayer = <a layer with a differnt projection than the map>

querymap should hilited the selected features (status=hilite)

Apparently the right result has been found since the correct attribute values
have  been shown in my query template but the querymap has left empty since the
querymapexten has been calculated from the *unprojected* qlayer while before
drawing the map the shapes have been projected. 

The following patch should fix the problem:

-----------------------
---diff -ur mapserver-4.2.3/mapquery.c mapserver/mapquery.c
--- mapserver-4.2.3/mapquery.c  2004-03-21 07:12:16.000000000 +0100
+++ mapserver/mapquery.c        2004-10-27 12:37:55.000000000 +0200
@@ -1042,6 +1045,7 @@
 int msGetQueryResultBounds(mapObj *map, rectObj *bounds)
 {
   int i, found=0;
+  rectObj tmpBounds;
   
   for(i=0; i<map->numlayers; i++) {
     layerObj *lp;
@@ -1050,10 +1054,15 @@
     if(!lp->resultcache) continue;
     if(lp->resultcache->numresults <= 0) continue;
 
+    tmpBounds = lp->resultcache->bounds;
+    #ifdef USE_PROJ  
+    if(lp->project && msProjectionsDiffer(&(lp->projection), &(map->projection)))  
+        msProjectRect(&(lp->projection), &(map->projection), &tmpBounds);
+    #endif
     if(found == 0) {
-      *bounds = lp->resultcache->bounds;
+      *bounds = tmpBounds;
     } else {
-      msMergeRect(bounds, &(lp->resultcache->bounds));
+      msMergeRect(bounds, &tmpBounds);
     }

Change History (1)

comment:1 by sdlime, 20 years ago

Resolution: fixed
Status: newclosed
I just applied the supplied patch. That went fine and it compiles fine. I cannot
test it easily here. Can you try on you and and then confirm it here? Marking
fixed for now.

Steve
Note: See TracTickets for help on using tickets.