[MapProxy] transparency projected/cached layers

André Pirard A.Pirard.Papou at gmail.com
Fri May 16 13:23:48 PDT 2014


On 2014-05-06 22:37, André Pirard wrote :
> On 2014-05-05 14:46, Thorsten Hildebrand wrote :
>> Hi,
>>
>> I have a problem with transparency in projected layers. Only a direct access (without cache/ without projection) keep the transparency. I use a WMS from Berlin "Karte von Berlin 1:5000 (K5)"
> If what you say is that Mapproxy receives transparent data from the
> source and serves opaque data, that is indeed what I'm experimenting
> and I'm surprised there is no follow-up to what is very akin to a bug
> report.
> I captured the png images at various places and I ran pngcheck.
>
> site (4326) -> JOSM: transparent OK: 51.9 m_52.515_13.392.png
> (500x500, 24-bit RGB, non-interlaced, 93.4%).
> site -> Mapproxy: transparent OK: (501x500, 24-bit RGB,
> non-interlaced, 93.5%).
> site -> Mapproxy -> JOSM: opaque OK: /home/p/w/service.png (500x500,
> 8-bit palette, non-interlaced, 57.2%)
> site -> Mapproxy cache: opaque: OK:  (256x256, 8-bit palette,
> non-interlaced, 63.8%).
> site -> Mapproxy cache -> JOSM: opaque OK: (500x500, 8-bit
> palette+trns, non-interlaced, 54.5%).
>
> In short, both JOSM and Mapproxy receive 24-bit transparent images and
> Mapproxy converts them to 8-bit opaque.
>
> I have tried to force the source to serve 8-bit but the
> Mapproxy:source: documentation is less than clear about how to do that
> and it seems that a Berlin's WMS version higher than 1.1.1 is needed
> anyway.
> Conversely, I wanted to try to make the cache 24-bit, but I'll let
> those who know what the doc should say do it.
>
> But be happy, I myself can't get JOSM to display transparently what
> it's got transparent in its cache :-(  :-)
>
> I'm sure that I have had Mapproxy serve and JOSM display transparent
> images in the past, but I don't remember if they were cached and I
> didn't have to go into details.
>
> All that for B/W ;-)
>
> Best regards,
>
> André.
>
>
I'm surprised to see no follow-up but mine to what Thorsten Hildebrand
described as a problem.
I contacted JOSM <http://josm.openstreetmap.de/ticket/9984> about their
non-transparent display of those layers and they made a nice working fix.
I wrongly generalized the problem. According to patch writer Don-vip, it
was specific to "WMS tiles defining a transparent color in RGB space
(tRNS PNG chunk for example), instead of a proper alpha channel".

I hope this info might help Mapproxy too.
Cheers,

André.


>> My workaround is to set "transparent_color" and "transparent_color_tolerance" (see comments in config). I have tested with Mapproxy 1.6.0 on Linux and Windows. Can you give me a hint to fix my config so I can use the origin transparency, please?
>>
>>
>> Sample WMS-image from server with transparency: http://fbinter.stadt-berlin.de/fb/wms/senstadt/k5?styles=&format=image%2Fpng&height=512&bbox=15798.1766833,23489.0564695,15985.4492364,23675.8691852&transparent=True&layers=0&service=WMS&width=513&request=GetMap&srs=EPSG%3A3068&version=1.1.1
>>
>> Sample Mapproxy URL (cache, no transparency): http://localhost:8080/service?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=15741.14359397656880901,23447.16088805999970646,16150.58630272754999169,23623.10880490613999427&SRS=EPSG:3068&WIDTH=1238&HEIGHT=532&LAYERS=k5&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE
>>
>> Sample Mapproxy URL (direct, transparency): http://localhost:8080/service?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=15741.14359397656880901,23447.16088805999970646,16150.58630272754999169,23623.10880490613999427&SRS=EPSG:3068&WIDTH=1238&HEIGHT=532&LAYERS=k5_direct&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE
>>
>>
>> Thank you and greetings from Berlin,
>> Thorsten
>>
>>
>>
>>
>> small working mapproxy.yaml:
>>
>> services:
>>   demo:
>>   wms:
>>     srs: ['EPSG:3068', 'EPSG:4326', 'EPSG:3857']
>>     image_formats: ['image/png', 'image/jpeg']
>>     md:
>>       title: MapProxy WMS Proxy
>>       abstract: This is a minimal MapProxy example.
>>
>> layers:
>>   - name: k5
>>     title: Berlin K5
>>     sources: [berlin_k5_cache]
>>   - name: k5_direct
>>     title: Berlin K5 direct
>>     sources: [berlin_k5_wms]
>>
>> caches:
>>   berlin_k5_cache:
>>     grids: [webmercator]
>>     sources: [berlin_k5_wms]
>>     meta_size: [2, 2]
>>     meta_buffer: 0
>>     format: image/png
>>     link_single_color_images: true
>>
>> sources:
>>   berlin_k5_wms:
>>     type: wms
>>     supported_srs: ['EPSG:3068']
>>     coverage:
>>       bbox: [13.079, 52.3284, 13.7701, 52.6877]
>>       srs: EPSG:4326
>>     req:
>>       url: http://fbinter.stadt-berlin.de/fb/wms/senstadt/k5?
>>       layers: '0'
>>       transparent: true
>>       format: image/png
>>     image:
>>       #transparent_color: '#ffffff'
>>       #transparent_color_tolerance: 20
>>       transparent: true
>>         
>> grids:
>>     webmercator:
>>         base: GLOBAL_WEBMERCATOR
>> _______________________________________________
>> MapProxy mailing list
>> MapProxy at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapproxy
>
>
>
> _______________________________________________
> MapProxy mailing list
> MapProxy at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapproxy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20140516/bd53bd7c/attachment.html>


More information about the MapProxy mailing list