feat: add source-grounded evolution and Ollama assistant
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 06:45:56 +02:00
parent 0baa9b069c
commit beacdf2560
37 changed files with 2246 additions and 58 deletions
+42 -1
View File
@@ -1585,7 +1585,8 @@ source/layer identity, first and last observations and ordered datasets.
{
"earlier_dataset_id": "uuid",
"later_dataset_id": "uuid",
"bbox": {"west": 5.0, "south": 51.0, "east": 5.2, "north": 51.2},
"bbox": {"min_x": 5.0, "min_y": 51.0, "max_x": 5.2, "max_y": 51.2, "crs": "EPSG:4326"},
"area_id": "optional persisted Area uuid",
"preview_limit": 500
}
```
@@ -1594,6 +1595,46 @@ Both datasets must belong to the project and the same temporal series, with
the earlier observation preceding the later one. The response contains source
snapshot references, selection bbox, earlier/later metric values,
absolute/percentage change, estimate status, warnings and GeoJSON evidence.
`metric` remains the backwards-compatible primary measurement. `metrics`
contains every aggregation that is compatible between both snapshots and
`timeline` contains the same persisted metric for every dated snapshot in the
series. When `area_id` is supplied it must belong to the project and the exact
persisted Area geometry is used; the bbox remains only the bounded map extent.
Added/removed/modified object changes are calculated only when source
provenance declares stable feature identities; otherwise
`object_changes.available=false` and no object history is inferred.
## Local GeoIntel assistant
The assistant is an optional read-only language interface over persisted
GeoIntel measurements. The browser never connects to Ollama directly and does
not choose an arbitrary provider URL.
### GET `/api/v1/assistant/status`
Returns `configured`, `not_configured` or `unavailable`, the configured default
model and the number of locally installed models. It never downloads a model.
### GET `/api/v1/assistant/models`
Returns the models reported by Ollama `GET /api/tags` in the canonical
envelope. A chat request can only select a model from this list.
### POST `/api/v1/projects/{project_id}/assistant/query`
```json
{
"question": "Hoe evolueerde de bosoppervlakte?",
"model": "qwen3.5:9b",
"bbox": {"min_x": 5.0, "min_y": 51.0, "max_x": 5.2, "max_y": 51.2, "crs": "EPSG:4326"},
"area_id": "optional persisted Area uuid",
"history": []
}
```
The backend validates project/Area ownership, calculates current semantic
metrics from PostGIS and includes dated observations only for persisted
temporal series. Geometry is not sent to Ollama. The response contains the
answer, used model, scope label, context metrics, discovered temporal series,
source dataset ids and warnings. Missing measurements remain unavailable;
specifically, no water volume is inferred from 2D water geometry.
+41
View File
@@ -8365,3 +8365,44 @@ Known limitation:
Next:
- Validate the semantic metrics against live Mol PostGIS data and then continue
the audited regional historical buildings/water/roads import.
## Sprint 202 - Source intelligence, complete evolution metrics and Ollama (2026-07-15)
Implemented:
- Audited the current regional PostGIS inventory: current GRB buildings, roads,
water and parcels; Statbel population 2021-2025; and modern forest
2013/2016/2019/2022/2025.
- Extended temporal comparison additively with optional exact persisted-Area
geometry, every compatible semantic metric and a complete observation
timeline. Bbox-only rectangle comparison remains supported.
- Expanded the official 10 m land-use operator with water, built-function and
transport surfaces. All themes reuse one retained source raster per year;
their measurements remain separate from current GRB geometry semantics.
- Added a Sources inventory for loaded themes and audited follow-up sources.
- Added an optional local Ollama assistant with status/model/query endpoints,
installed-model validation, compact persisted GIS context and strict missing-
data behavior. The browser never addresses Ollama directly.
- Added editable Docker/Unraid Ollama settings and automatic host-gateway
mapping for the server runtime.
Validation evidence:
- Focused temporal, source, Ollama, navigation and Unraid regression tests
passed, including direct coverage for multi-metric history and DockerMan host
mapping.
- Full readiness passed 612 backend tests, backend compilation, 91 documented
API routes, one Alembic head, frontend TypeScript typecheck/build and all
shell syntax gates.
- Local Docker validation was deferred to the live Tower deployment because
Docker is not installed on the Windows development host.
Known limitations:
- Water volume remains unavailable until a governed depth/bathymetry source is
integrated. VMM station water levels or flows alone do not establish volume
for every selected polygon.
- Available follow-up sources are catalogued but are not labelled as loaded
until a controlled import and provenance validation have completed.
Next:
- Integrate Waterinfo/VMM station observations as point time series and add
historical orthophoto acquisition, while preserving their spatial and
methodological limitations.
+35 -3
View File
@@ -151,8 +151,15 @@ GET query, which the public gateway rejects.
`scripts/provision_official_landuse_timeseries.py` uses the public Departement
Omgeving/MercatorNet WCS to retrieve the harmonized version 3 land-use maps for
2013, 2016, 2019, 2022 and 2025. The source is a categorical 10 m GeoTIFF in
Belgian Lambert 72 (`EPSG:31370`) with 19 documented classes. GeoIntel currently
derives only class `12` (`Bos`) as the operational forest theme.
Belgian Lambert 72 (`EPSG:31370`) with 19 documented classes. GeoIntel derives
four explicitly labelled, methodologically comparable surfaces from one
retained source raster per year:
- `forest`: class 12, bosoppervlakte;
- `water`: class 17, wateroppervlakte (not water volume);
- `built`: classes 1-4 and 6-8, surface used by built functions, not GRB
building footprints;
- `transport`: class 5, transport-infrastructure surface, not GRB road length.
Every source raster is clipped against the explicit official boundary,
validated for integer classes, CRS and resolution, checksummed and retained in
@@ -180,7 +187,7 @@ modern forest operators to the approved 28-municipality
boundary and writes to `Kempen Regional Workbench` through the normal dataset
API. Regional keys are
`statbel:population-statistical-sector:kempen-transport-region` and
`department-omgeving:land-use:forest:kempen-transport-region`, so Mol datasets
`department-omgeving:land-use:{theme}:kempen-transport-region`, so Mol datasets
remain independent observations rather than aliases.
The command is explicit and operator-triggered. No source fetch happens during
@@ -201,6 +208,31 @@ Official catalogues:
- https://www.vlaanderen.be/datavindplaats/catalogus/landgebruik-vlaanderen-toestand-2025
- https://www.vlaanderen.be/statistiek-vlaanderen/ruimtegebruik/landgebruik/metadata-landgebruik
## Audited official follow-up sources
These sources are available from their public authorities but are not silently
treated as loaded GeoIntel data. The Source inventory labels them separately
until a governed operator import, provenance record and validation pass exist.
- Historical orthophotos (Digitaal Vlaanderen): 1971 and 1979-1990 through
the `OKZ` WMS, with additional dated mosaics as separate products. Suitable
for visual/image evolution after a bounded acquisition contract is added.
- Biologische Waarderingskaart / Natura 2000 (INBO), state 2025: suitable for
habitat, biotope and ecological-value analysis, not a continuous annual
series.
- Agricultural-use parcels (Agentschap Landbouw en Zeevisserij): annual files
suitable for crop and agricultural-surface evolution after schema/version
harmonization.
- Buildings and Addresses Register (Digitaal Vlaanderen): continuously updated
building status, life cycle and address linkage; complementary to GRB
geometry and not yet imported.
- DHMV II DTM/DSM (Digitaal Vlaanderen): 1 m/5 m elevation based on 2013-2015
LiDAR, suitable for elevation, slope and drainage. It does not provide water
depth.
- Waterinfo/VMM: station time series for water level, flow and precipitation.
These can describe hydrological state, but do not provide area-wide water
volume without a compatible bottom profile/bathymetry model.
## OSM
- Naam: OpenStreetMap
+7
View File
@@ -17,7 +17,14 @@
- [x] Extend official population and land-use time series from Mol to the approved 28-municipality regional scope.
- [x] Make Evolution automatically open an available regional series and distinguish historical themes from current-only snapshots.
- [x] Replace object-count-only map results with semantic PostGIS metrics for hectares, kilometres and inhabitants while retaining counts as supporting evidence.
- [x] Show complete comparable observation timelines and all compatible semantic metric deltas for exact persisted Areas.
- [x] Expand the modern 2013-2025 land-use operator with water, built-function and transport surfaces from the retained official raster.
- [x] Add a source inventory that separates loaded data from audited official follow-up sources.
- [x] Add a local Ollama question window grounded in persisted GeoIntel metrics and installed server models.
- [ ] Add a governed depth/bathymetry source before exposing water volume; never infer volume from 2D GRB water geometry.
- [ ] Integrate one governed hydrology source (Waterinfo/VMM station series) without presenting point measurements as area-wide water volume.
- [ ] Add bounded historical orthophoto acquisition and visual change analysis after validating layer/year coverage.
- [ ] Add BWK/Natura 2000 and annual agricultural-use parcels through explicit provider/operator contracts.
- [ ] Extend the official 1778/1873/1969 historical buildings, water and roads series from Mol to the approved regional scope with partitioned source audits.
- [x] Connect a drawn rectangle to bounded official orthophoto acquisition, local configured-YOLO detection and persisted GRB QA.