Closed tbonfort closed 12 years ago
Author: sdlime Date: 2003/12/04 - 20:28
Boy, I dunno. I changed code in some of the shape handling stuff to avoid
passing around the shape path, but that's about it. I don't know about the
projection code. Frank would have to comment. Do you know if panning works fine
when not projected?
Steve
Author: fwarmerdam Date: 2003/12/04 - 20:51
Hmm,
I don't see how this could be happening. It doesn't look like leaving
the scope should change anything.
I haven't done much work with tiled raster maps lately, but as far as I
know it mostly works ... at least when the rasters aren't being reprojected.
Can you provide a smallish example that we can use to reproduce the problem?
Author: kafka@email.cz Date: 2003/12/05 - 10:29
The error reveals only (?) when projected. Here is the URL to WMS service
providing the map of Czech republic:
http://www.premathmod.cz/cgi-bin/mapserv?map=../bnh/cechy/cr_wms_en.map
(It can be viewed in common WMS viewer like www.wmsviewer.com or directly in
our one:
http://mapserv.netart.cz/mapserv/palm/pda_wms02.phm?
wms=add&newserver=http://www.premathmod.cz/cgi-bin/mapserv?
map=../bnh/cechy/cr_wms_en.map )
It contains the Forest layer (raster). When panning across the map in the eg.
1:200000 scale only one forest tile is seen. I can prepare also demonstration
project and data to send, if it is possible, but it requires some work (next
week?).
Stepan Kafka
Author: fwarmerdam Date: 2003/12/10 - 22:47
Stepan,
I don't expect to dig into this bug unless you, or someone, can produce
a map and supporting data that demonstrate the problem. I've spent most of
today trying to reproduce another mapserver bug report with no success and it
has somewhat turned me off the "experiment" to reproduce approach.
Best regards,
Author: kafka@email.cz Date: 2004/02/02 - 16:14
Steve, Frank, excuse me to trouble you again but I need some information about
this bug status before my own research :) Thank you very much.
Stepan Kafka
Author: fwarmerdam Date: 2004/02/02 - 18:23
Stepan,
I applogise. This fell through the cracks during my time away in December
and I never returned to it to realize you had excellent data to reproduce the
problem.
It turns out the problem is that existing pen ids were being reused on
subsequent tiles. With resampling turned on, the subsequent renders were
actually into different gdImg objects (the temporary input to the resampler)
which didn't actually have the colors allocated but because the pen was set in
the layerObj classes it was assumed they were.
The fix is to clear the pen values in the layerObj->class entries before
color allocation in msDrawRasterLayerGDAL().
The change looks like this:
warmerda@gdal2200[124]% cvs diff mapdrawgdal.c
Index: mapdrawgdal.c
===================================================================
RCS file: /data2/cvsroot/mapserver/mapdrawgdal.c,v
retrieving revision 1.14
diff -r1.14 mapdrawgdal.c
443c443,455
<
---
>
> /*
> * Wipe pen indicators for all our layer class colors if they exist.
> * Sometimes temporary gdImg'es are used in which case previously allocated
> * pens won't generally apply. See Bug 504.
> */
> if( gdImg && !truecolor )
> {
> int iClass;
> for( iClass = 0; iClass < layer->numclasses; iClass++ )
> layer->class[iClass].styles[0].color.pen = MS_PEN_UNSET;
> }
>
The new code goes in before the comment about "Get colormap for this image.",
and it should be trivially retrofittable back into any MapServer 4.xish
version of mapdrawgdal.c.
Note, the bug does not occur if not using classes, or if resampling is
not used. The problem turns out not to have been related to tile selection
at all. They were all being loaded and rendered. The problem was just that
the colors of some tiles (all after the first in this case!) were being
treated as transparent due to the pen issues.
The fix has been committed to the current development version of mapserver.
Reporter: kafka@email.cz Date: 2003/12/03 - 11:37