steve.lime at DNR.STATE.MN.US
Fri Aug 5 14:08:27 EDT 2005
There is enough information in a style to know when a vector
symbol is transparent. Basically no background color. I suppose that
could be used to trigger the same effect as TRANSPARENCY ALPHA.
>>> Sean Gillies <sgillies at FRII.COM> 08/04/05 5:40 PM >>>
On Aug 4, 2005, at 4:17 PM, Frank Warmerdam wrote:
> On 8/4/05, Richard Greenwood <richard.greenwood at gmail.com> wrote:
>> Since Mapserver 4.4, when I want to output jpegs, if I want a simple
>> vector hatch to be transparent (for underlying layer to show thru) I
>> have to set IMAGEMODE PC256:
>> NAME jpeg
>> DRIVER "GD/JPEG"
>> MIMETYPE "image/jpeg"
>> IMAGEMODE PC256
>> EXTENSION "jpg"
>> If I use IMAGEMODE RGB, the space between the vector lines is opaque
>> My symbol definition:
>> NAME 'Diag_NE_SW'
>> TYPE VECTOR
>> 0 1
>> 1 0
>> And my class definition:
>> NAME "FEMA 500 Year Flood Zone SHX"
>> EXPRESSION 'SHX'
>> COLOR 112 186 248
>> OUTLINECOLOR 0 0 255
>> SYMBOL 'Diag_NE_SW'
>> SIZE 20
>> Am I overlooking anything? I would prefer to use IMAGEMODE RGB.
> Try adding a "TRANSPARENT ALPHA" line in your layer definition.
> Amoung other things this enables the alpha blending needed for
> raster symbols with transparency. =20
> I'm not really satisfied with this requirement, though it is organized
> this way partly to avoid extra work in the common case where there
> is no transparency.
Originally I thought this was a different issue, but indeed MapServer's
vector type symbols are first rendered into pixmaps. Pixmap
transparency for RGB imagemodes was on in versions prior to 4.2, and
then was broken in 4.2, presumably in an attempt to increase
performance. I restored it in 4.4.2 and 4.6, controlled by the layer
transparency keyword instead of adding another transparency keyword to
the symbol definition. It might be better to define transparency for
symbols instead of layers, but this would require a fair amount of
sgillies at frii dot com
More information about the mapserver-users