A QGIS plugin that delineates settlement boundaries by partitioning spatial datasets based on building footprints.
This is a companion plugin to IB-Tool 3:
its output (a PART_<id> polygon layer) is the Partitions input IB-Tool 3
expects — see IB-Tool 3's
docs/input-data.md → Part
and
docs/quickstart.md
for how it fits into IB-Tool 3's own workflow.
IB-Tool 3 needs four more input layers. Its sibling plugin
Data Wizard produces the
HU / RN / Aux layers from raw ATKIS Basis-DLM data — the building
footprints it outputs can be fed straight into this plugin as input.
The plugin generates partition polygons from building footprint data. The algorithm uses kernel density estimation on building centroids to identify settlement clusters, then derives partition boundaries via Voronoi tessellation and line processing.
Processing pipeline:
- Building footprints → centroids
- Kernel density raster (heatmap) from centroids
- Raster → point grid
- Voronoi polygons from point grid
- Polygon to lines → explode line segments
- Remove line segments within dense cluster areas
- Polygonize remaining lines → partition polygons
- Add
NAMEfield (PART_<id>)
The result is a set of polygons that partition the study area into settlement units, each named PART_<id>.
- QGIS 3.0 or later
- Python 3.x (bundled with QGIS)
- No external Python packages required — all processing uses QGIS native algorithms
- Download or clone this repository
- Open QGIS → Plugins → Manage and Install Plugins → Install from ZIP
- Select the
.zipfile and click Install Plugin
Copy or symlink the ibtoolpartion/ directory into your QGIS plugin folder:
| Platform | Plugin folder |
|---|---|
| Windows | %APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\ |
| Linux | ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ |
| macOS | ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ |
Then activate the plugin in QGIS via Plugins → Manage and Install Plugins.
- Open QGIS and activate the plugin
- Click the IB-Tool (Partitioning) icon in the toolbar or use the Plugins menu
- In the dialog, set:
- Building footprints — polygon layer (
.shpor.gpkg) - Cell size (metres) — raster resolution and density radius (default:
150) - Output file — destination for the partition polygon layer (
.shpor.gpkg)
- Building footprints — polygon layer (
- Click OK — the output layer is written to the specified file
| Parameter | Type | Default | Description |
|---|---|---|---|
| Building footprints | Polygon layer | — | Input building footprint features |
| Cell size (metres) | Integer | 150 |
Raster cell size; controls density estimation radius (2 × cell_size) |
| Output file | File path | — | Output partition polygon layer (.shp or .gpkg) |
git clone <repo-url>
cd ibtoolpartion
python -m venv .venv
.venv\Scripts\activate # Windows
pip install flake8 bandit detect-secrets pylint pytest pytest-cov# All tests (requires a running QGIS environment)
pytest test/ -v
# Unit tests only (no QGIS required)
pytest test/ -v -m unitdocker build -t qgis-plugin-test .
docker run --rm -v $(pwd):/plugins/ibtoolpartion qgis-plugin-testpython scripts/create_release_zip.pyProduces dist/ibtoolpartion.<version>.zip. See
docs/contributing.md → Release Process
for the full checklist.
python ci/qgis_plugin_validate.py --auto
flake8 .
bandit -r . -ll
detect-secrets scan --force-use-all-plugins| Marker | When to use |
|---|---|
@pytest.mark.unit |
No processing.run() calls — no QGIS required |
@pytest.mark.integration |
Calls processing.run() — requires QGIS |
@pytest.mark.edge_case |
Boundary or degenerate inputs |
@pytest.mark.slow |
Runtime > 1 s or large datasets |
| Workflow | Trigger | Purpose |
|---|---|---|
ci.yml |
Push to master/main, PRs |
Docker-based tests + Codecov coverage |
qgis-plugin-ci.yml |
Push to master/main, PRs |
Lint (flake8), security scan (bandit), plugin validation |
This plugin is based on the following published toolset:
Oliver Harig (2021). Toolset for the delineation of settlements on the basis building footprints, road network and land use data (v1.0). https://doi.org/10.26084/IOERFDZ-SOFT-001
This plugin is released under the GNU General Public License v2 (or later).
See LICENSE for the full license text.
Oliver Harig — ottmar.hittzfeld@web.de