Maybe this will save someone time/confusion…
I wasn’t having much luck with TileMill etc. so I wrote a simple Python script to render a Mapnik XML file to PNGs of different resolutions.
So, say I am rendering the following resolutions:
resolutions = [0.125, 0.25, 0.5, 1, 2, 4]
They output individual files, named like this:
* my-map-0.125.png * my-map-0.25.png * my-map-[...].png * my-map-4.png
Examples of issues:
- Sometimes files will have the wrong resolution rendered
- Sometimes Min/Max Scale Denominator is not respected
There may be other issues but these are the only ones I have notice so far. It seems that scale/resolution values are not isolated between the threads in my pool of four.
I do not know whether this is a problem with Mapnik, just the Python bindings or a problem with how “multithreading” is implemented in CPython. I going to restructure the code so that each render uses its own process.
For the record I am using Python 3.5 and Mapnik 3.0.