[MapProxy] Using meta buffer with Mapnik Source

Just van den Broecke just at justobjects.nl
Thu Apr 11 05:52:41 PDT 2024


Hi,

I am using MapProxy with Mapnik Sources using PostGIS for generating a 
topomap of The Netherlands [1]. Sometimes, especially at lower zooms, 
labels, mostly place names, are cut-off. I use MapProxy metatiling and 
metabuffering, for example:

   map5topo_seed_gpkg_cache:
     grids: [ dutch_grid_lev13, webmerc_grid_lev19 ]
     sources: [ map5topo_source ]
     disable_storage: false
     format: image/jpeg
     meta_buffer: 64
     meta_size: [ 4,4 ]
     cache:
       type: geopackage
       levels: true
       directory: /var/map5/mapproxy/cache/gpkg/map5topo_seed
.
.
map5topo_source:
     type: mapnik
     mapfile: /mapnik/map5topo.xml
     coverage:
       bbox: [ -20000.0,275000.0,300000.0,650000.0 ]
       srs: 'EPSG:28992'

My questions:
- puzzled in general about the concept of the buffer/gutter, as is 
usually associated with WMS Sources. Is 'buffer' actually forwarded to a 
WMS source? What happens with the buffer area when storing in the cache? 
Is the buffer pasted on neighbouring tiles? What if there are none? Or 
is the whole metatile stored and cut at tile-fetch time?

- Mapnik configuration also supports buffer/gutter, I just found out, 
"buffer-size", both at Map and (override) at Layer level in Mapnik XML 
config [2]. This allows to set buffer only for relevant, mostly label-, 
layers. But my feeling is that this would not integrate well with 
MapProxy, who would be unaware. Maybe we could pass a buffer-value to 
Mapnik in future? (I still have another auto-reload Mapnik PR to do [3]...).

Anyway, looking for best practice, ideas, hopefully others deal with 
meta-tiling/-buffering in this setup as well. We can add to MapProxy 
config docs. Mapnik is still a great renderer also in combination with 
MapProxy!

[1] https://map5topo.nl/
[2] 
https://github.com/mapnik/mapnik-reference/blob/gh-pages/3.0.22/reference.json
[3] 
https://github.com/justb4/docker-mapproxy-mapserver-mapnik/blob/main/patches/README.md

Kind regards

--Just

Just van den Broecke



More information about the MapProxy mailing list