Opened 20 years ago

Closed 19 years ago

#541 closed defect (fixed)

WMS Transparency problem

Reported by: mtperry78@… Owned by: mapserverbugs
Priority: high Milestone: 4.4 release
Component: WMS Client Version: 4.0
Severity: normal Keywords:
Cc:

Description

I am unable to use transparency on any WMS layer. Here is my original message, 
followed by Frank's response which hopefully illuminates the issue....

> I've been trying to get mapserver to display a
> partially transparent shaded relief over a DRG. Both
> layers are WMS and display correctly individually. I
> have tried many combinations of image types and
> various mapfile settings but no luck. Am I
> understanding TRANSPARENCY correctly.. that it makes
> all pixels semi-transparent? Or does it make certain
> classes of pixels completely transparent? Is
> TRANSPARENCY set to work with WMS layers or just local
> images??

Matthew,

I see your problem.  You have setup your mapfile properly, but it seems
there is an "issue" internally in mapserver.  The msDrawLayer() 
function
is responsible for applying the layer level transparency (ie. 
TRANSPARENCY 50)
but for WMS, layers msDrawLayer() is not used ... instead msDrawMap() 
calls
msDrawWMSLayer() directly.  I am not exactly clear why it is that way, 
but
the result is any of the "generic" logic in msDrawLayer() is missed.

I would suggest you file a bug in bugzilla and hopefully one of the WMS
rascals will step forward to resolve the problem.  Ideally by actually
putting WMS layers through msDrawLayer() somehow.

Best regards,
Frank Warmerdam

Change History (3)

comment:1 by assefa, 19 years ago

Milestone: 4.4 release
Matthew, Is this still an issue with recent versions ? 

comment:2 by assefa, 19 years ago

e-mail from Matthew

 The problem still persits... WMS layers do not show
transparency. I have the following version installed:

MapServer version 4.4.0-beta2 OUTPUT=PNG OUTPUT=JPEG
OUTPUT=WBMP OUTPUT=PDF SUPPORTS=PROJ SUPPORTS=FREETYPE
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG

comment:3 by assefa, 19 years ago

Resolution: fixed
Status: newclosed
Fixed according to my tests. msDrawWMSLayerLow calls now msDrawLayer instead 
of sDrawRasterLayerLow directly ensuring that the transparency logic that is 
msDrawLayer is applied.

Matthew, could you please do some tests on this and reopen the bug if there 
are issues.


I have tested this using these 2 wms client layers where the 2nd one has it's 
transparency set:

 LAYER
  NAME bathymetry
  METADATA
    "wms_title" "Elevation/Bathymetry"
    "wms_name" "bathymetry"
    "wms_server_version" "1.1.1"
    "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?
map=c:/msapps/gmap-ms40/htdocs/gmap75_wms.map&"
    "wms_format" "png"
    "wms_force_separate_request" "1"
  END
  TYPE RASTER
  STATUS DEFAULT
  CONNECTIONTYPE WMS
  CONNECTION "http://localhost/cgi-bin/mapserv.exe?map=c:/msapps/gmap-
ms40/htdocs/gmap75_wms.map&"
  PROJECTION
    "init=epsg:42304"
  END
END



LAYER
  NAME park
  TRANSPARENCY 50
  METADATA
    "wms_title" "park"
    "wms_name" "park"
    "wms_server_version" "1.1.1"
    "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?
map=c:/msapps/gmap-ms40/htdocs/gmap75_wms.map&"
#    "wms_format" "png"
    "wms_format" "image/tiff"
    "wms_force_separate_request" "1"
  END
  TYPE RASTER
  STATUS DEFAULT
  CONNECTIONTYPE WMS
  CONNECTION "http://localhost/cgi-bin/mapserv.exe?map=c:/msapps/gmap-
ms40/htdocs/gmap75_wms.map&"
  PROJECTION
    "init=epsg:42304"
  END
END


Note: See TracTickets for help on using tickets.