[MapProxy] Force PNG24 on single cache
Just van den Broecke
just at justobjects.nl
Wed May 13 03:38:16 PDT 2015
Hi Oliver,
Was just posting when I saw your reply. Solved as follows:
caches:
opentopo_file_cache:
grids: [geonovum_grid, opentopo_extent_grid]
sources: [opentopo_wms]
format: png8
relief_struct_file_cache:
grids: [geonovum_grid, opentopo_extent_grid]
sources: [relief_struct_wms]
format: png24
.
.
globals:
image:
resampling_method: bilinear
paletted: true # or false, see below
formats:
png24:
format: image/png
colors: 0
png8:
format: image/png
colors: 256
.
.
This setup allows to explicitly set either PNG8 or PNG24 per cache with
PNG24 WMS-sources.
Remaining issue is to let the client choose either PNG24 or PNG8 on the
MapProxy WMS, like:
wms:
srs: ['EPSG:4326', 'EPSG:900913', 'EPSG:28992']
image_formats: ['image/jpeg', 'image/png', 'image/png; mode=24bit']
Though the latter does not seem to work. With the
globals.image.paletted: true or false the MP WMS gives PNG8 or PNG24
repectively. Caches seem not affected by globals.image.paletted:
true|false as long as the the above globals.image.formats.png8 or .png24
are set with each cache.
But glad that the initial issue is solved and may be of help to others.
Best,
Just
On 13-05-15 11:03, Oliver Tonnhofer wrote:
> Hi Just,
>
> hard to tell with a complete configuration. But looking at the code it looks like MapProxy does not force an encoding to PNG24. It does this only for paletted image formats.
>
>
> Regards,
> Oliver
>
More information about the MapProxy
mailing list