<div align="center">

# QToolbox

### Post-processing tools for GeoAI workflows in QGIS

<p>
  <img src="https://img.shields.io/badge/QGIS-3.40%20LTE-589632?style=for-the-badge&logo=qgis&logoColor=white" alt="QGIS"/>
  <img src="https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python"/>
  <img src="https://img.shields.io/badge/Release-0.9.0-blue?style=for-the-badge" alt="Release"/>
  <img src="https://img.shields.io/badge/License-GPLv2+-green?style=for-the-badge" alt="License"/>
</p>

<p>
  <a href="https://qgeoai.nextelia.fr">📚 Documentation</a> •
  <a href="https://github.com/nextelia/qgeoai_server">🖥️ Server</a>
</p>

<img src="resources/logo.png" alt="QToolbox" width="1024"/>

---

</div>

## Key Features

<div align="center">
<table>
<tr>
<td width="33%">

**Raster Resampler**
- Multiple interpolation methods
- Bilinear, nearest, cubic
- Preserve or change resolution
- Auto-generated output names

</td>
<td width="33%">

**Building Regulariser**
- Orthogonalise building polygons
- Adjust angles and edges
- Parallel edge merging
- Simplification control

</td>
<td width="33%">

**Polygon Smoother**
- Chaikin's corner-cutting algorithm
- Auto-detect segment length
- Merge adjacent geometries
- Area preservation for polygons

</td>
</tr>
</table>
</div>


## Interface

<div align="center">
<img src="resources/qtb_ui.png" alt="QPredict ui" width="1024"/>
</div>

## Quick Start

### Prerequisites

- **QGIS 3.40 LTE** or higher
- **[QGeoAI Server](https://github.com/nextelia/qgeoai_server)** (required for all tools)
- QPredict predictions or other vector/raster data

### Installation

1. Download the plugin from [Releases](../../releases) or clone this repository
2. Copy `qtoolbox/` to your QGIS plugins directory:
```bash
   # 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/
```
3. Restart QGIS and enable the plugin via `Plugins` → `Manage and Install Plugins`

**Full documentation**: [qgeoai.nextelia.fr](https://qgeoai.nextelia.fr)

## Tools Overview

### 🔲 Raster Resampler

Change raster resolution in just a few clicks.

**Use cases**:
- Match resolution between datasets
- Downsample high-resolution imagery
- Prepare data for model training

**Parameters**:
- Target resolution (in map units)
- Resampling method: bilinear (default), nearest, cubic

---

### 🏢 Building Regulariser

Regularise building footprints from model predictions.

**Uses the building-regulariser package**:  
https://github.com/DPIRD-DMA/Building-Regulariser

**Use cases**:
- Clean up predicted building polygons
- Create orthogonal building footprints
- Post-process instance segmentation results

**Parameters**:
- Parallel threshold (meters)
- Simplification tolerance (meters)

---

### 🔄 Polygon Smoother

Smooth jagged polygons and polylines using Chaikin's algorithm.

**Uses the smoothify package**:  
https://github.com/lollia/smoothify

**Use cases**:
- Smooth raster-to-vector conversions
- Reduce staircase effects from pixelated geometries
- Post-process semantic segmentation results

**Parameters**:
- Segment length (auto-detect or manual)
- Smooth iterations (3-5 recommended)
- Merge adjacent geometries
- Preserve polygon area

---

## Workflow

### Typical Post-Processing Pipeline

1. **Run inference** with QPredict
2. **Vectorize results** (if needed)
3. **Apply QToolbox**:
   - Raster Resampler → Change resolution
   - Building Regulariser → Orthogonalise buildings
   - Polygon Smoother → Smooth edges
4. **Export** final clean geometries

## Why QToolbox?

- ✅ **Server-based**: Leverage GPU/CPU via QGeoAI Server
- ✅ **Production-ready**: Proven algorithms, robust processing
- ✅ **Integrated**: Works seamlessly with QAnnotate, QModel Trainer, QPredict
- ✅ **No dependencies**: All processing handled by QGeoAI Server
- ✅ **Open source**: GPLv2+ license, fully auditable

## Support & Contribution

### Community Support

**Documentation**: [qgeoai.nextelia.fr](https://qgeoai.nextelia.fr)

### Professional Support

For operational support, custom integrations, or training:

- **Email**: [hello@nextelia.fr](mailto:hello@nextelia.fr)
- **Website**: [nextelia.fr](https://www.nextelia.fr)

The suite is free and open-source. Professional services ensure sustainable development.

### Contributing

This project is developed as an open, production-grade GeoAI platform for QGIS.

We welcome:
- Bug reports with reproducible steps
- Documentation improvements
- Real-world feedback

For larger changes, new features or architectural modifications, please open an issue first to discuss alignment with the project roadmap.

The roadmap is maintained by the core team to ensure long-term stability, consistency and production readiness.

---

<div align="center">

**Part of [QGeoAI Tools](https://qgeoai.nextelia.fr)** suite

**Copyright** © 2026 Nextelia® • **Version** 0.9.0 • **Updated** January 16, 2026

</div>