Opened 20 years ago
Closed 20 years ago
#1003 closed defect (fixed)
mapext=shapes with projected layers
Reported by: | 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); }
Note:
See TracTickets
for help on using tickets.