Is it possible to fill polygons so that they are completely transparent in MapServer? I want to have a black background that is slightly opaque, and wherever there is a polygon I want that to be completely clear with no fill. I set my background in the following way:
IMAGECOLOR 0 0 0 TRANSPARENT OFF
I've tried creating a class that is white to fill the polygon, and experimented with opacity using
TRANSPARENCY with values from 0 - 100 but it does not result in a clear polygon:
CLASS NAME "light" EXPRESSION ([max_cost] == 2000) STYLE OUTLINECOLOR 255 255 255 COLOR 255 255 255 SIZE 1 WIDTH 2.0 END END
This is results in the following type of image:
Instead of the polygon having a white fill; I want it to have a fill with no color. I found one suggestion online to define the color like this:
COLOR -1 -1 -1
but it also did not work. In this part of the documentation, the following is described:
“PALETTE=/path/to/palette.txt” is used to define the absolute path where palette colors can be found. This file must contain 256 entries of r,g,b triplets for RGB imagemodes, or r,g,b,a quadruplets for RGBA imagemodes. The expected format is one triplet (or quadruplet) per line, each value separated by commas, and each triplet/quadruplet on a single line. If you want to use transparency with a palette, it is important to have these two colors in the palette file: 0,0,0,0 and 255,255,255,255.
After reading this, I also tried using
COLOR 0 0 0 0 but this throws an error:
Unknown identifier. Parsing error near (0):(line 71)
I don't understand how I refer to a define color in
PALETTE=/path/to/palette.txt but this seems like one possible way to achieve this.