This post shows how to use QGIS and python to automate map exports to PDF.
I needed to create create standardised PDF maps on a regular basis. For this I usually use a template set up in QGIS then export PDFs using the atlas feature. However… I found this can be entirely automated so you don’t even need to open the QGIS program to export the product. This can be used to automate map production as a scheduled job or batch produce maps when new data is available.
Using python the QGIS libraries can be imported and executed. This process can be triggered in windows using a batch file which runs the python script. There’s some guidance for linux too in the super useful qgis cookbook.
I modified the python script from Tim Sutton to be specific to my qpt template. I also added a way to specify coords to focus the map canvas on and apply a filter to a layer. Layers which are added to the
.qgs project will be exported in the PDF.
I thought this was worth saving and sharing so the files are available here with an explanation of how to get these example files working on windows in the readme.
.qgsfile or load and style the directly in the script. They will be printed to the PDF.
In 2012, Northumberland County Council made a submission to GeoPlaces’ Citizen Award for their work in identifying properties. While there submission did not win, it was highly commended, and it certainly caught my eye. I was particularly interested in how they used building polygons in the OS MasterMap Topographic Layer to determine tertiary BLPU classification. This outcome is achieved in two phases. First, determine the relationship between the building polygons, then assign these polygons with a UPRN.Read more
…so at Surrey Heath, we (the GIS team…all two of us) find ourselves in the nice position of knowing a bit about data and how to handle it. By handle it I mean how to obtain it, how to transform or do something with it and how to put it somewhere else or publish it.Read more
This post shows how we have used lidar data to calculate the aspect and estimate the south facing area of a rooftop.Read more
In July 2015, Ordnance Survey published new styling options for its MasterMap Topographic Layer. These new styles complemented the backdrop styles for the VectorMap products, Meridian2 and Strategi very well. The stylesheets can be downloaded here:Read more