[mapserver-users] two mapserver speed-optimization questions

Frank Warmerdam warmerdam at pobox.com
Wed Mar 16 07:47:31 EDT 2011


On Tue, Mar 15, 2011 at 5:03 PM, Vince Miller <vincentpmiller at yahoo.com> wrote:
> 1. The following two lines of PHP from my application transform an php image object into a raster map layer:
>
> imagepng($rmap, __MAPS_PATH__ . "resource.png");
> $map->getLayerByName("resource")->set("data", __MAPS_PATH__ . "resource.png");
>
> The imagepng call is a major bottleneck when the extent of the layer is large.
> Can the data in image "$rmap" be accessed for layer "resource" directly, without the file write/read? If so, how? FYI, the following lines appear in my mapfile:


Vince,

There are no mechanisms to utilize a PHP image object as the
data in a mapserver raster layer without first writing to disk.  I
gather PHP image resources are actually a handle to a gdImage
object, so if you needed it badly enough it should be possible to
write a PHP function that turn that gdImage into something that
was accessable to GDAL as a raster but that would be quite
involved and not something likely to go back into the core
distribution.

Best regards,



--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


More information about the mapserver-users mailing list