mapproxy icon indicating copy to clipboard operation
mapproxy copied to clipboard

transparent_color and transparent_color_tolerance do not work on sources other than wms

Open docmcfreckles opened this issue 4 years ago • 1 comments

Context

for tile sources other than wms mapproxy does not handle selective image transparency. ie. you cannot combine multiple tile sources that overlap without them being inherently transparent. I reviewed the code and only the wms.py has the code to handle the transparent_color and transparent_color_tolerance flags.

Expected Behavior

specifying

image:
    transparent_color: #ffffff
    transparent_color_tolerance: 15

on a tile source is treated the same as on a wms source

Actual Behavior

the mapproxy-util throws an error:

mapproxy.config - WARNING - unknown 'transparent_color' in sources.[source].image
mapproxy.config - WARNING - unknown 'transparent_color_tolerance' in sources.[source].image

Possible Fix

copy the code from the wms.py to the other sources or abstract it to a reusable code block

Steps to Reproduce

  1. create a mapproxy.yaml file with 2 sources, 1 wms, 1 tile
  2. in both include a config block with
    image:
        transparent_color: [some color]
        transparent_color_tolerance: [some value] 
3. save the file and start mapproxy-util serve-develop mapproxy.yaml [optional flags]
4. observe error for the tile source config

Context

in order to combine tile sources, I have to create wms server wrappers and route the tile caches through them locally instead of being able to merge them in a cache. this is much less performant than directly referencing the internal caches for the tile sources.

Your Environment

  • Version used: 1.13.0
  • Environment name and version (e.g. Python 2.7.5 with mod_wsgi 4.5.9): python 3.5.3
  • Server type and version:
  • Operating System and version: Proxmox 6.x host w/ lxc container running debian 9.13

docmcfreckles avatar Jun 04 '21 20:06 docmcfreckles

I just ran into the same issue. I wonder if this is an option that would be easy to basically copy and paste to the other source types or if it is dependent (or surrounded by) some more complex handling?

kannes avatar Jun 28 '22 13:06 kannes