GIS WORKFLOW AUTOMATION

QGIS Project Builder

Builds a ready-to-edit QGIS project from standard layers, styles and layouts, so a same-day map request no longer starts from a blank project.

PythonQGIS XMLPyQGISLayout configuration
  • Half a day → 5 minset-up per map
  • 10+regional offices served
  • 40projects audited
  • 1,835layers
  • 59%layers pointed to a retired drive

More than a dozen regional offices send map requests, and most of them are due the same day. Each map used to start from a blank QGIS project, with layers added and styled one by one, and whoever picked up the request had to set their planned work aside.

To find what could be reused, I audited the 40 projects that had been built by hand, 1,835 layers in total, and found that 59% of the layers pointed to a drive that no longer existed. Those old projects were hard to reuse as they were. So I turned the common layers, styles and layouts into one spec and wrote a generator around it in Python and PyQGIS. Pick an area, and you get a .qgz project that is already set up and ready to edit in QGIS.

Turn common settings into a spec

I split the setup into three files. A layer index records what each layer contains and where it comes from. A project config decides which area to map and which layers to include. A shared spec keeps styles, labels and layouts consistent. The generator reads all three and assembles a .qgz file, so colleagues receive a project they can keep editing in QGIS.

The generator only assembles the project. PNG or PDF export comes later, from QGIS or from a separate PyQGIS rendering script. That way a colleague can open the project, check it and adjust it before producing the final map.

  1. Prepare shared inputsGet the common datasets, the layer index and the style spec ready first.
  2. Choose the contentPick the area, layers, labels and layout.
  3. Assemble the .qgz projectThe generator fills in data sources, layer order, styles and layout elements.
  4. Finish in QGISOpen the project, check and adjust it, then export the map.

Layers and layout on one screen

The desktop app keeps layer, area and layout settings on one screen. The web version below follows that interface using synthetic data, and its export button produces an SVG preview only. Further down, a comparison built from public data shows the same styling approach applied to real terrain.

Python / XML builds the project → edit in QGIS → PyQGIS renders the output. On a phone, scroll the map sideways.

Same data, different styling

This comparison uses NLSC open data. Both versions share the same extent and geometry. I changed only the styling, labels and layout, and no feature was moved. After the change, rivers, roads and school points are easier to tell apart than before.

Cartography comparison using NLSC open geographic data
The map contains 3 district areas, 113 water areas, 627 roads, 25 waterway lines and 21 elementary-school points, identical in both versions. Points sit on top, lines in the middle and areas at the bottom, and only a few labels are kept so they do not cover each other. On a phone, scroll the figure sideways or tap it to open the full SVG.

Public sources and license

The map uses open data from the National Land Surveying and Mapping Center (NLSC), Ministry of the Interior. The topographic data comes from the 2024 Zhongli sheet and the district boundaries from the 2023 file version, adapted under the Open Government Data License v1.0.

NLSC open-data downloads · Topographic dataset · District boundaries · Open Government Data License v1.0

What was delivered

Besides generating the project, the tool lets you choose which layers to include and adjust the layout. After a project is generated, it checks the project structure and the source path of every layer, so a layer with a broken link is caught right away. I also packaged the whole tool as an offline version and tested it in a local environment.

The public-data comparison on this page is a separate cartography example, and its districts, waterways and schools only illustrate the method, with no connection to irrigation boundaries or operational facilities.

What the project called for

GIS workflow design

Kept the data index, project settings and final rendering separate, so colleagues can pick up a project and keep editing.

Cartographic standardisation

Turned the styles, labels and layout elements people already used into a reusable spec.

Project assembly and delivery

Generated .qgz files from config, checked every layer source and packaged the tool for offline use.