[MapProxy] Layer merging problem

deduikertjes deduikertjes at xs4all.nl
Wed Mar 22 01:26:15 PDT 2017


Travis,

Thanks for the pointer. Really usefull.

It leads me to some very usefull insights, but I'm not sure that all 
behavior is as expected.

Adding to the source:
     image:
       opacity: 1
AND setting the image format on the cache to image/png:
      format: image/png

does something very usefull: it merges all layers as wished as long as 
there is no fully opaque (as served from the source wms) layer in the 
mix. If so, the fully opaque layer will off course prevent all layers 
below to be shown. That I'd like to solve by giving some opacity to that 
layer. Preferably via a generic option on the cache like:

Adding an opacity setting to the cache on top of the settings above like:
     image: {opacity: 0.8}

But ... this does something odd. The opacity setting is applied with 
each layer added, so the bottom most layer in the resulting image is 
barely visible. I think that is not as it should be. Opacity should only 
be applied to the layer added to the stack of layers, not the stack it self.

If I use a setting on a fully opaque (as served from the source wms) 
layer source like:
     image:
       opacity: 0.8
The layers below this one are not visible at all. I do not think that is 
as it should be.

Do I have found two issues or am I missing some advanced config trick 
again? Again any help appreciated.

MArco

On 21-03-17 22:14, Travis Kirstine wrote:
>
> does this help:
>
>
> https://github.com/mapproxy/mapproxy/blob/master/mapproxy/test/system/fixture/combined_sources.yaml
>
> On 21 March 2017 at 11:15, deduikertjes <deduikertjes at xs4all.nl 
> <mailto:deduikertjes at xs4all.nl>> wrote:
>
>     Travis,
>
>     Thanks. I tried. Mapproxy reports:
>
>     mapproxy.config - WARNING - unknown 'opacity' in globals.image.formats.my_format
>
>     Seems logical as opacity is not mentioned in the docs as an option
>     for an image format
>     On 21-03-17 14:50, Travis Kirstine wrote:
>>     I added a new global my_format with the opacity defined and used
>>     it for the caches - does that work?
>>     On 21 March 2017 at 07:03, deduikertjes <deduikertjes at xs4all.nl
>>     <mailto:deduikertjes at xs4all.nl>> wrote:
>>
>>         Layer merging problem Hi List, When (vertically) merging
>>         layers (mapproxy 1.9) results are not as expected. Merging
>>         two layers which have fully transparent areas show only the
>>         topmost layer. The bottom layer is not shown as should (not
>>         at all). If the top layer has no fully transparent areas but
>>         is completely opaque and opacity is set to eg 0.8 the bottom
>>         layer is shown as should. Did I make a config error or did I
>>         run into a bug? Any help greatly appreciated, MArco An
>>         excerpt from my config: services:   tms:     # needs no
>>         arguments   wms:     srs: ['EPSG:28992']     image_formats:
>>         ['image/png', 'png'] globals:   cache:    
>>         minimize_meta_requests: true     meta_size: [1, 1]    
>>         meta_buffer: 0   image:     paletted: false     formats:
>>               image/png:         mode: RGBA         transparent: true
>>         *my_format: *
>>         *format: image/png:         mode: RGBA         transparent: true*
>>
>>     *          opacity: 0.8*
>>
>>         sources:   wms_source1:     type: wms     wms_opts:      
>>         featureinfo: true       legendgraphic: true    
>>         supported_srs: ['EPSG:28992']     req:       url:
>>         'http://myservice.nl/geoserver/gwc/service/wms
>>         <http://myservice.nl/geoserver/gwc/service/wms>?'      
>>         layers: 'layer1'       transparent: true   wms_source2:    
>>         type: wms     wms_opts:       featureinfo: true      
>>         legendgraphic: true     supported_srs: ['EPSG:28992']    
>>         req:       url:
>>         'http://myservice.nl/geoserver/gwc/service/wms
>>         <http://myservice.nl/geoserver/gwc/service/wms>?'      
>>         layers: 'layer2'       transparent: true caches:   _source1:
>>              sources: [wms_source1]      link_single_color_images:
>>         true      disable_storage: true
>>         *format: my_format*
>>           _source2:      sources: [wms_source2]     
>>         link_single_color_images: true      disable_storage: true
>>         *format: my_format*
>>         layers:   - name: 'layer1'     sources: [_source1]     title:
>>         'layer 1'   - name: 'layer2'     sources: [_source2]    
>>         title: 'Layer 2'
>>         _______________________________________________ MapProxy
>>         mailing list MapProxy at lists.osgeo.org
>>         <mailto:MapProxy at lists.osgeo.org>
>>         https://lists.osgeo.org/mailman/listinfo/mapproxy
>>         <https://lists.osgeo.org/mailman/listinfo/mapproxy> 
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20170322/28955ae0/attachment.html>


More information about the MapProxy mailing list