[mapserver-users] Re: quick question from mapserver beginner!

mattmendick matt.mendick at pictometry.com
Wed May 12 08:28:16 EDT 2010


You first have to make sure you are outputting the image as a png or some
other image format that supports transparency. Like this, at the base of the
mapfile:

        OUTPUTFORMAT
                        NAME mypng
                        DRIVER "GD/PNG"
                        IMAGEMODE RGB
                        FORMATOPTION "INTERLACE=false"
                        MIMETYPE "image/png"
                        EXTENSION "png"
        END
        IMAGETYPE mypng

Then, if your source image is not perfectly square, and has black in areas
that you want to be transparent, you can use the "OFFSITE [R] [G] [B]"
attribute. This tells mapserver that any color in the raster that matches
the color in your OFFSITE parameter should be rendered transparent.

ex:

LAYER
       NAME "blah"
       DATA '/path/to/raster.tiff'
       OFFSITE 0 0 0
END

This has worked for me in the past, I hope it works for you.

-Matt Mendick
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/quick-question-from-mapserver-beginner-tp5040040p5040856.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list