Discussion:
[MapProxy] Problems using transparent PNGs from mapproxy in mapproxy
Paul Norman
2012-09-04 08:14:26 UTC
Permalink
I've been having some ongoing problems getting a layer working that combines
two TMS layers where the original TMS layers have transparency and are
produced by mapproxy.

I eventually reduced it the following testcase (grids and a couple hundred
lines of unrelated config omitted). ### was either bc_gvrd_west_2009_tms or
sred. I cleared out the cache when switching.

layers:
- name: bc_mosaic
title: BC Mosaic
sources: [bc_mosaic_cache]
caches:
bc_mosaic_cache:
grids: [z20]
sources: [bc_gvrd_east_2009_tms,###]
format: image/png
cache:
type: file
directory_layout: tms
sources:
bc_gvrd_west_2009_tms:
type: tile
grid: z20
transparent: true
url: Loading Image...
coverage:
polygons: 'wkt/bc_gvrd_west_2009.wkt'
polygons_srs: 'EPSG:4326'
sred:
type: tile
grid: z19
transparent: true
url: Loading Image...

sred is an image where the south half is red and the north half is
transparent, created in GIMP.
11226 is an image pulled from mapproxy and copied to a location to serve
staticly.

When using sred, it correctly uses the transparency and the gvrd_east layer
can be seen in the north half. When using 11226 the gvrd_east layer cannot
be seen in the transparent parts of 11226.

I looked at the files with pngcheck and the only difference I can see that I
could imagine being relevant is that one is palleted and the other is 32-bit
RGB+alpha.

I believe the solution in my case is to switch from 8-bit to RGBA since I
didn't realize I was on 8-bit and want to switch away for quality reasons.
Oliver Tonnhofer
2012-09-04 09:09:48 UTC
Permalink
Post by Paul Norman
[...]
When using sred, it correctly uses the transparency and the gvrd_east layer
can be seen in the north half. When using 11226 the gvrd_east layer cannot
be seen in the transparent parts of 11226.
I looked at the files with pngcheck and the only difference I can see that I
could imagine being relevant is that one is palleted and the other is 32-bit
RGB+alpha.
I believe the solution in my case is to switch from 8-bit to RGBA since I
didn't realize I was on 8-bit and want to switch away for quality reasons.
Yes, the LayerMerge in MapProxy only supports RGBA at the moment.
Can you create a ticket at GitHub for this issue?
https://github.com/mapproxy/mapproxy/issues/new


Regards,
Oliver
--
Oliver Tonnhofer | Omniscale GmbH & Co KG | http://omniscale.de
http://mapproxy.org | https://github.com/olt | @oltonn
Loading...