[mapserver-users] mapscript php with agg rendering?

Gregor at HostGIS gregor at hostgis.com
Tue Feb 15 11:09:04 EST 2011


Hey there. I had some issues with the imagetype settings using PHP 
MapScript, but we do use PNG24. For what it's worth, here's the 
outputformat section of our PHP:

$map->imagecolor->setRGB(255,255,255);
$map->outputformat->set('name','gif');
$map->outputformat->set('mimetype','image/png; mode=24bit');
$map->outputformat->set('driver','AGG/PNG');
$map->outputformat->set('imagemode',MS_IMAGEMODE_RGBA);
$map->outputformat->set('transparent',MS_OFF);
$map->outputformat->set('extension','png');
$map->outputformat->setOption('INTERLACE','OFF');
//$map->outputformat->setOption('QUANTIZE_FORCE','ON');
//$map->outputformat->setOption('QUANTIZE_COLORS',256);

For reasons which now elude my memory (this was written some 3 years 
ago) we had to use 'gif' as the output format, then simply reconfigure 
what 'gif' means. This may have been a bug specific to our own version 
of MapServer back in the day, but if it helps, I'm glad.

-- 
HostGIS, Open Source solutions for the global GIS community
Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
    Network+   Server+   A+   Security+   Linux+
    PHP   PostgreSQL   MySQL   DHTML/JavaScript/AJAX

"No one cares if you can back up — only if you can recover."


More information about the mapserver-users mailing list