I'm trying to make some map tiles (with a transparent background) showing the speed limit in different areas of the UK. I've successfully managed to do this using the QGIS GUI on Windows 10, but I'd now like to automate the process so I can easily keep the tiles up to date with changes to OpenStreetMap.
I've managed to get the process running in a docker container and it all runs through without any errors, but all of the generated tiles are blank (unlike when I run it with the QGIS GUI). The way the script works (after producing a bunch of
.osm files for different speed limits), is to load the project (
.qgs) that I had previously created in the QGIS GUI on Windows 10 and then run the
qgis:tilesxyzdirectory process with the same parameters that were used in the GUI.
I suspect that the problem is in loading the project; I found a bit of code in the processing algorithm that creates a list of layers. The result of
findLayers() is a list of
QgsLayerTreeLayers, whereas the result of
layerOrder() is a list of
QgsVectorLayers, so the check that the entries in
layerOrder appear in the visible list produces no results and hence
self.layers gets set to
. Of course I might be completely wrong about the problem and, even if I'm right, I have no idea what to do about it. I'd like to be able to load a QGIS project as it allows me to use the GUI for styling.
The complete project containing the docker container details and all the generation scripts is on bitbucket here. After building with
docker-compose build, I run it using
docker-compose up. The actual python script for generating the tiles from the project is here.
The bash script that runs the overall process is here.
Can anyone see what I'm doing wrong?