POLYGON layers not transparent with imagetype JPEG

Toomas Aas Toomas.Aas at RAAD.TARTU.EE
Thu Dec 2 08:22:04 EST 2004


Hello!

Until recently, we were using Mapserver 3.6.6 to run our web applications.
Now we installed a new web server with all new software, including
Mapserver 4.2.5:

MapServer version 4.2.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=EPPL7 INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE

We noticed an interesting problem with our applications: when we use some
layer of type POLYGON which is filled with some kind of SYMBOL, this layer
is not transparent. Here's an example snippet of a .map file (I omitted
most of the layers for brevity):

------------------------------ CUT ------------------------------
NAME tartu
SIZE 420 420
STATUS OFF
IMAGECOLOR 255 255 255
IMAGETYPE JPEG
EXTENT 6000 3000 15000 12000
UNITS METERS
SHAPEPATH "/home/httpd/html/www.tartu.ee/mapserv/data"
SYMBOLSET "/home/httpd/html/www.tartu.ee/mapserv/symbols/symbol.sym"
FONTSET "/home/httpd/html/www.tartu.ee/mapserv/symbols/fonts.list"

LAYER
  NAME krundipiirid
  TYPE POLYGON
  STATUS off
  DATA tartu_region
  CLASSITEM 'aadress'
  CLASS
    NAME 'Krundid'
    EXPRESSION /./
    SYMBOL cross
    SIZE 4
    OUTLINECOLOR 151 170 119
    COLOR 235 255 211
  END
  HEADER "krundipiirid_header.html"
  FOOTER "krundipiirid_footer.html"
  TEMPLATE "krundipiirid.html"
END

LAYER
  NAME T2000
  GROUP pilt
  STATUS OFF
  TILEINDEX t2000
  TYPE RASTER
  MAXSCALE 1500
  MINSCALE 100
  OFFSITE 255 255 255
END
------------------------------ CUT ------------------------------

Symbol cross is defined like this in the SYMBOLSET:

------------------------------ CUT ------------------------------
SYMBOL
  NAME "cross"
  TYPE vector
  POINTS
    2 0
    2 4
    -99 -99
    0 2
    4 2
  END
END
------------------------------ CUT ------------------------------

Now, if we display both layers 'krundipiirid' and 'T2000' simultaneously,
the objects in 'krundipiirid' layer completely cover the raster layer,
whereas on our old server the raster could be seen through the objects in
'krundipiirid'.

After a lot of hair-pulling, I noticed that this only happens if I specify
IMAGETYPE JPEG. When specifying IMAGETYPE PNG (or not specifying IMAGETYPE
at all), the layers behave as on our old server.

In some cases, I could work around the problem by adding TRANSPARENCY to
the polygon layer, but in some cases even this didn't help.

I also tried briefly with Mapserver 4.4.0, but the behaviour seemed to be
the same there. Since our .map files had other problems with 4.4.0, I went
back to 4.2.5 for now.

I am actually not an web/application developer but merely a server
administrator, so I apologize in advance if I'm missing something blatantly
obvious. I've been forced to deal with this since the developers are
currently unreachable. A fun week this has been.

--
Toomas Aas



More information about the mapserver-users mailing list