FOSS4GNL 2026 - 8 & 9 juli - Groningen

From polygons to AI: defensive patterns from a five-city PPGIS pipeline
9-7-2026 , Brunsemazaal
Taal: English

AccessCity4All is a research project comparing objective, perceived, and actualized accessibility across five EU cities. Within the project, WP5 collects PPGIS data via Maptionnaire: respondents draw their perceived neighborhood on a map and mark home, work, and activity locations as points. This talk is about the R pipeline that turns those surveys into reproducible analytic datasets.
Below the survey layer everything is open: R + sf for geometry, r5r / OSRM / OpenRouteService for routing, GeoPackage and GeoJSON for interchange, and a Mistral-driven step for multilingual free-text reclassification.
What it actually taught us is what happens when around 5,000 respondents across five cities draw their own neighborhoods, around 18,000 trips need real routed distances, and free-text responses arrive in five languages. This talk walks through three defensive patterns the codebase grew over five years:

  • a geometry-repair pipeline that turns freehand citizen drawings into valid analytic polygons, with home-inside verification that catches its own cache mistakes;
  • a dual-mode activity-space classifier built on routed distances and pure-R clustering, with a Euclidean fallback when the routing engine is flaky;
  • an audit-logged AI workflow that's defensible in peer review.

If you write geospatial R that has to survive contact with real data, this talk is for you.


Here's the Description, sized for the optional pretalx field at about 600 words, structured to track the abstract's three patterns and back each one with a concrete war story:

The problem. AccessCity4All is a JPI/DUT-funded research project comparing objective, perceived, and actualized accessibility across five EU cities (Groningen, Münster, Ankara, Vienna, Lisbon). Within the project, WP5 collects Public Participation GIS data through Maptionnaire. Respondents draw their own perceived neighborhood as a polygon, mark home, work, study, leisure, and healthcare locations as points, and answer 70+ Likert and numeric items. The pipeline this talk is about (roughly 60,000 lines of R in a single monolithic script, by design so researchers without a software-engineering background can read it end to end) processes those exports into reproducible analytic datasets that downstream researchers can compare across cities.
Why it's hard. Citizens draw self-intersecting polygons, polygons with antenna spikes, polygons with stray holes, polygons where their home sits just outside the boundary. Five cities use four CRSes, three routing engines, and five languages of free text. Re-running anything from scratch costs hours, so caching is non-negotiable, which means cache invalidation matters too.
Three defensive patterns walked through in the talk:

A geometry-repair pipeline for freehand citizen drawings. Around 5,000 respondents drew their perceived neighborhood freehand on a Maptionnaire map. The result is a catalogue of topology defects: self-intersections, antenna spikes, donut holes, off-home centers, even occasional polygons where the home falls a kilometer outside the drawn boundary. We built a 14-stage repair pipeline (validity repair, buffer(0), antenna-spike removal, morphological open and close, compactness check, home-inside verification with 200 m tolerance) that outputs both the cleaned geometry and a status code downstream code can branch on. The home-inside verification is also our last line of defense against a cache mistake: an early polygon-cache key used a checksum that collided in bulk on real Maptionnaire WKT, and 150 of 936 valid neighborhoods ended up attached to the wrong respondent, with home-to-polygon distances up to 59 km. Fix: key the cache by Respondent ID, and on every cache hit re-verify that the cached geometry still contains this row's home. Costs nothing, catches everything.
A dual-mode activity-space classifier built on routed distances. Around 18,000 home-to-activity trips need routing across five city networks. We dispatch through r5r, OSRM, or OpenRouteService depending on configuration. The output has a unified schema, so downstream code does not care which engine was used. The classifier then runs each respondent's activity space through single-linkage clustering at a 15-minute isochrone threshold (1.2 km for walking, 3.1 km for cycling), separately per mode, producing Monocentric, Bicentric, and Polycentric labels. When the routing API is flaky (which it is, when you hit a public ORS endpoint at city scale), the cluster-cohesion test falls back to a Euclidean approximation: defensible enough that the run finishes.
An audit-logged AI workflow that is defensible in peer review. Free-text "Other" answers arrive in five languages (Dutch, German, Turkish, Portuguese, English). We use Mistral to reclassify them against the survey's coded categories. The pattern matters more than the model: every reclassification event is logged to a per-context CSV that preserves the original free-text alongside the reclassified code and a confidence score, the cache verifies the stored text on every hit so a key collision cannot return the wrong category, and the request layer rotates keys on 429 with Retry-After. Every AI decision is traceable to its input. The same pattern transfers to open-weight local models (Llama, local Mistral 7B), the obvious next step toward a fully-open pipeline.

What you'll take away. Concrete patterns, all FOSS, for building geospatial R that survives contact with real survey data. A worked example of where the rough edges of sf, GeoPackage, and the R routing ecosystem actually bite. And a frame for using AI in research code without compromising reproducibility.
This talk is not a research-results talk. The cross-city accessibility findings live in a separate paper. The pipeline is the artefact under discussion. The goal is for the audience to leave with patterns they can apply to their own geo-R code.
Prerequisites. Intermediate R users who have used sf for anything non-trivial. Familiarity with PPGIS or accessibility research is helpful but not required. Nothing to install: this is a talk, not a workshop.

I have been a GIS specialist for the last 15 years, seeking to broaden my GISc-related knowledge both academically and practically. Currently a postdoctoral researcher in FSS/RUG, focusing on different aspects of accessibility.