[MapProxy] Multi-layer transparency problem

Dejan Gambin dejan.gambin at coin.hr
Fri Jan 13 06:33:28 EST 2012


Hi,

Since I gave you only mapproxy requests to MapServer, here is something better, and you can try it yourself so no attachments needed :-)

My client application sends request like this to Mappproxy service:

http://www.coin.hr:54322/service?FORMAT=image/png&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=namjena,uza_namjena&SRS=EPSG:900913&BBOX=1533632.5353003,5620873.3111963,1536078.5202051,5623319.2961011&WIDTH=256&HEIGHT=256

The same request directly to MapServer WMS is this:

http://www.coin.hr/cgi-bin/mywms6?FORMAT=image/png&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=namjena,uza_namjena&SRS=EPSG:900913&BBOX=1533632.5353003,5620873.3111963,1536078.5202051,5623319.2961011&WIDTH=256&HEIGHT=256

You can see the difference. I hope this helps a little more

regards, dejan
On 13. sij. 2012., at 12:00, Dejan Gambin wrote:

> Hi Oliver
> 
> First, thank you very much for the help
> 
> About your guess - I have paletted: false set in globals section. All the used layers don't have any image colors set to 256. So this shouldn't be the problem
> 
> 
> Here are some parts of my configuration regarding two layers, although it is happening with all the overlayed layers, if any of them have some TRANSPARENCY set in MapServer mapfile
> 
> Mapproxy.yaml ->
> 
> ...
> layers:
> 
>  - name: uza_namjena
>    title: Uza namjena - CoinGIS
>    sources: [cgc_uza_namjena]
> 
>  - name: namjena
>    title: Namjena - CoinGIS
>    sources: [cgc_namjena]
> ...
> 
> caches:
> 
>  cgc_uza_namjena:
>    grids: [grid_full_example]
>    sources: ['coingis_wms:uza_namjena']
>    request_format: image/png
>    format: image/png
>    link_single_color_images: true
>    image:
>      mode: RGBA
> 
>  cgc_namjena:
>    grids: [grid_full_example]
>    sources: ['coingis_wms:namjena']
>    request_format: image/png
>    format: image/png
>    link_single_color_images: true
>    image:
>      mode: RGBA
> ...
> 
> sources:
> 
>  coingis_wms:
>    type: wms
>    supported_srs: ['EPSG:31275', 'EPSG:900913']
>    req:
>      url: http://localhost/cgi-bin/mywms6?
>      transparent: true
> ...
> 
> globals:
> 
>  image:
>      resampling_method: nearest
>      paletted: false
> ...
> 
> Requests ->
> 
> sample request when turning on the layer "namjena":
> 
> GET /service?FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=namjena&SRS=EPSG%3A900913&BBOX=1526294.5805859,5620873.3111963,1528740.5654907,5623319.2961011&WIDTH=256&HEIGHT=256 HTTP/1.1
> 
> sample request when turning on the second layer "uza_namjena" (both are turned on):
> 
> GET /service?FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=namjena%2Cuza_namjena&SRS=EPSG%3A900913&BBOX=1526294.5805859,5620873.3111963,1528740.5654907,5623319.2961011&WIDTH=256&HEIGHT=256 HTTP/1.1
> 
> sample images for requests are attached. Just look the difference in the same area (for example labeled with "Š1") in two requests
> 
> Thanks very much
> 
> dejan
> 
> <request2.png><request1.png>
> 
> On 13. sij. 2012., at 08:49, Oliver Tonnhofer wrote:
> 
>> Hi,
>> 
>> On 12.01.2012, at 13:32, Dejan Gambin wrote:
>>> I have mapproxy set up with MapServer as WMS server/source. Everything seems to be fine except when requesting two layers that are overlayed one above the other. The first layer is a polygon layer with TRANSPARENCY parameter set to 70 (this is indeed the opacity). The other layer is line layer, with no transparency set.
>>> 
>>> Now, when I show them separately, they are ok, but if I put (turn on) the second layer above the first one, the first layer changes its color and becomes more "blurred" (like more transparency is added to it). It doesn't happen with direct MapServer WMS GetMap request, so I suppose it is related to mapproxy.
>>> 
>>> Btw, I am using mapproxy 1.2 on debian machine.
>>> 
>>> Thanks very much for any useful information
>> 
>> It's hard to help you without more information. Can you post some configuration, requests and result images (keep them small)?
>> 
>> Just one guess: You are using an updated version of PIL with paletted PNGs and the colors change because the color space (256 colors) is too small for your images.
>> 
>> Regards,
>> Oliver
>> 
>> -- 
>> Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.de
>> http://mapproxy.org | https://bitbucket.org/olt | @oltonn
>> 
>> 
> 



More information about the MapProxy mailing list