[mapserver-users] Transparent PNG

Balázs Bámer bamerbalazs at gmail.com
Tue May 26 05:29:47 EDT 2009


Hi All,

I use Mapserver 5.2.2 and would like to produce transparent PNGs such
that if there is a red polygon, its red fill and stroke would be for
example 50% transparent. I need this to let an other layer's polygon
appear at the same location. I tried the following way:
  CLASS
    NAME "Fekves"
    STYLE
      COLOR 27 158 119
      OUTLINECOLOR 27 158 119
      OPACITY 50
    END
  END
in the layer descriptions

and a format part in the MAP section:
OUTPUTFORMAT
  NAME png32
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE RGBA
  EXTENSION "png"
END

and a corresponding line
IMAGETYPE png32

but not succeeded, everything is totally opaque. Mapserver is compiled using
./configure --with-oci \
 --with-oraclespatial=/usr/local/instantclient_11_1 \
 --with-proj --with-threads --with-gdal --with-ogr \
 --with-jpeg --with-png=/usr/lib --with-php=/usr/include/php5
--with-wmsclient --with-wfsclient

I tried adding the option --with-experimental-png but it missed some
libraries I coudln't find.

I know it is possible to generate such output using Geoserver, but now
I need to use Mapserver.
What is the solution?

Thank you in advance, best regards: Balázs Bámer


More information about the mapserver-users mailing list