[mapguide-users] WMS Transperancy

Thomas M. Tuerke thomas.m.tuerke at autodesk.com
Wed Dec 6 17:03:56 EST 2006


According to WMS specs, transparency is governed by 

 

TRANSPARENT=TRUE

BGCOLOR=(color to assign “transparency” to, in hex RGB notation)

FORMAT=(image format that supports transparency, such as GIF or PNG; JPEG doesn’t.)

 

Here are examples straight from the OGC specs:

 

(WMS 1.0.0)

http://a-map-co.com/mapserver.cgi?WMTVER=1.0.0&REQUEST=map& SRS=EPSG%3A4326&BBOX=-97.105,24.913,78.794,36.358& WIDTH=560&HEIGHT=350&LAYERS=AVHRR-09-27%3AMIT-mbay&STYLES=default&FORMAT=PNG&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE&QUALITY=MEDIUM 

(WMS 1.1.1)

http://a-map-co.com/mapserver.cgi?VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-97.105,24.913,78.794,36.358&WIDTH=560&HEIGHT=350&LAYERS=AVHRR-09-27&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage

 

Depending on the WMS version you’re transacting under, FORMAT is either a keyword (GIF, PNG) or mime type (image/gif, image/png)

 

UseTransparency is a non-standard extension, though some few servers may, for various reasons, require it.

 

HTH,

 

- Thomas

 

PS: Experimenting with the server you refer to, it seems like TRANSPARENT is on by default, and requesting a PNG comes through Okay – (but remember that MSIE has problems showing PNG transparency and needs special DHTML to render it properly, if that’s likely to be an issue.)  

 

http://maps.customweather.com/image?request=GetMap&layers=state_borders&srs=EPSG:4326&bbox=-180.0,-90.0,180.0,90.0&width=500&height=250&format=image/png

 

BTW, this default transparent behavior is contrary to the OGC spec:

 

7.1.4.6.3 Opaque vs. transparent layers

…

This attribute describes only the Layer’s data content, not the picture format of the map

response. Whether or not a Layer is listed as opaque, a server shall still comply with the

GetMap operation specified below: that is, the server shall send an image with a

transparent background if and only if the client requests TRANSPARENT=true and a

picture FORMAT that supports transparency.

 

7.2.2 GetMap Request Overview

 

Table 8 — The Parameters of a GetMap Request

Request Parameter                             Required/Optional

Description

TRANSPARENT=TRUE|FALSE       O             Background transparency of map

(default=FALSE).

 

Furthermore, the image doesn’t seem to be rendered properly for GIF unless transparent=false. This can be verified by the following:

 

http://maps.customweather.com/image?request=GetMap&layers=state_borders,contour_jet_stream&srs=EPSG:4326&bbox=-180.0,-90.0,180.0,90.0&width=500&height=250&format=image/gif&transparent=false&bgcolor=0xffffff

 

where the background color is forced to white, and transparency is forced to off.

 

Thus selecting PNG instead of GIF as a format may get you something useful, but you might also want to refer further questions regarding peculiarities of this server to Mr. Flint of CustomWeather.  His contact information is found within the getcapabilities document provided by the WMS.

 

  _____  

From: Scott Hameister [mailto:ScottH at mPower-tech.com] 
Sent: Wednesday, December 06, 2006 12:40 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] WMS Transperancy

 

Am I missing something in the consumption of WMS layers and transparency?

When I connect to http://maps.customweather.com/image as a data source in Studio, And bring in the RADAR schema….

…I get no transparency but in every other WMS viewer the white is transparent (Except Map2007 another story).

I’ve even tried making the datasource WMS connector String Longer in Studio to look like http://maps.customweather.com/image?TRANSPARENT=true&UseTransparency=true&ImageFormat=image/gif and nothing...Please <http://maps.customweather.com/image?TRANSPARENT=true&UseTransparency=true&ImageFormat=image/gif%20and%20nothing...Please>  help?

 

 

  _____  

From: Haris Kurtagic [mailto:haris at sl-king.com] 
Sent: Wednesday, December 06, 2006 8:59 AM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Fdo2Fdo v0.4.1 for FDO 3.2

 

Hi,

 

New version of Fdo2Fdo tool is available at: www.sl-king.com/fdo2fdo

 

Support for FDO 3.2. Comes with SHP, SDF and King.Oracle provider but you can add and use other FDO providers build for FDO 3.2.

 

 

Haris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide_users/attachments/20061206/302c0422/attachment.html


More information about the Mapguide_users mailing list