[mapserver-dev] PHP Mapscript rendering incorrect/old? images

lisa lisa at renci.org
Tue Jan 22 14:31:00 PST 2019


Hello - I have been trying to solve an this issue for about a week now and I
am hoping someone can give me some ideas on how to solve it.
Here is the setup:
Centos 6
Apache 2.2.15
PHP 5.3.3
Mapserver 6.4.3

I have an old website that serves up weather related data. A crontab process
downloads radar images from the national weather service and saves a sliding
window of 3 hrs worth of them them as gifs (ex: n0r_t_m000.gif for the most
current radar image). These gifs are defined as data sources for layers in a
.map file like this:
LAYER
   NAME 'Radar_000'
   TYPE RASTER
   STATUS ON
   DATA ../../../cache/radar/n0r/n0r_t_m000.gif
   OFFSITE 255 255 255
 END

A php script reads this map file and changes it, to turn on the layers it
wants to display:
$map = ms_newMapObj("../../mapserver/radar/radar.map");
$radar_layer = $map->getLayerByName("Radar_000");
$radar_layer->set("status", MS_ON);

It uses mapObj draw() to create an imageObj and then saveWebImage() to store
that image in a temp file, like this:
$image = $map->draw();
$image_name = $image->saveWebImage();

The problem is that the temp file that is created IS NOT ALWAYS the correct
image, as specified as the source data for that layer. It is sometimes an
older version of the gif. I have double and triple checked that the source
data is correct. I also printed out the map file, from the mapObj in the php
script and used shp2img to generate an image, and that image IS ALWAYS
CORRECT. I have also turned on Mapserver level 5 debugging, and CPL_DEBUG,
but that did not help either.

Does anyone know what might be causing this or where else I can look to
debug the problem?
I can provide more info if needed.

Thanks very much!  - lisa 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/Mapserver-Dev-f4252683.html


More information about the mapserver-dev mailing list