Skip to content

feat(karte): Lagekarte on lagebuch-geodata packs with Hydranten and address search - #798

Merged
DeepDiver1975 merged 16 commits into
mainfrom
feat/lagekarte-geodata
Oct 29, 2026
Merged

DeepDiver1975 merged 16 commits into
mainfrom
feat/lagekarte-geodata

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #789 and #790. Closes #794, closes #795, closes #796 (distance from a route to a hydrant and elevation stitching move to #587). Both were built on the old CodeForFire/lagebuch-regions packs. This PR carries their five commits unchanged, rebased onto current main, and adds commits on top: the move to lagebuch-geodata format 2 (release ffb-v1), the water points and address search that data makes possible, and every installed pack drawn as one map. Review everything after the first five commits, which were reviewed in #789/#790.

What it does

  • Stammdaten → Karten (from feat(karte): download offline Kartenpakete and show them as a map #789) now loads packs.json from lagebuch-geodata. The list shows "Stand 27.10.2026 · Version 1 · 253 MB". A pack counts as current when its version and SHA-256 match.

  • KARTE tab in Führung (from feat(fuehrung): mark the Einsatzort and the units on a Lagekarte #790): mark the Einsatzort, place and drag units. Unchanged.

  • Hydranten and other water points (feat(karte): show water points and offer offline address search #795): from zoom 15 the map draws the pack's water.geojson, one symbol per kind — red dot = Hydrant, blue ring = Saugstelle, blue square = Löschwasserbehälter, blue diamond = Löschteich. A key in the corner explains them. From zoom 17 each point gets a label in the style of its Hinweisschild ("UH 100", "ÜH 150", a name or a Nummer). Tapping a water point while nothing is picked for placing opens its card, with Bauart, Durchmesser, Druck, Kupplungen, Lage, Nummer, OSM id and so on. Well-known values are said in German, anything else is shown as OSM spells it. A HYDRANTEN switch turns the layer off. The card and the attribution both say that OSM is not the Wasserversorger's register. Everything is drawn on the canvas, not created as controls, because a Landkreis has thousands of points (FFB: 7 534).

  • Offline address search on the map: "Hauptstr 12a Maisach" is read as street, house number and place, and Str./Strasse/Straße count as the same word in the query and in the data. An exact house number and a confirmed place rank first. Picking a hit marks the Einsatzort there with the usual ETB entry; on a read-only Einsatz it only centres the map. While no Einsatzort is marked, the search box starts with the address already recorded for the Einsatz. Search uses the pack only, never an online service.

  • Every installed pack is one map (for feat(karte): allow more than one installed Kartenpaket #796, tiles only): a tile comes from the first pack that has it, so the FFB/STA border is a seam rather than the edge of the map. The attribution lists each distinct licence line once, and hydrants come from every pack. Opening KARTE re-reads the installed packs, so a pack downloaded during an Einsatz appears without reopening the incident. Stitching elevation across packs is left for the DGM sampler in feat(wasserfoerderung): map mode salvage from #164 with pump markers and GeoJSON/GPX export #587, which is the first code that reads elevation.tif.

Format 2, checked end to end

What arrives over the network is untrusted, so:

  • the catalogue is refused unless formatVersion == 2 ("Lagebuch aktualisieren"). An entry is skipped when its SHA-256 is not 64 lower-case hex digits, its slug does not match FORMAT.md's ^[a-z0-9]+(-[a-z0-9]+)*$ (at most 32 characters), its bounds lie off the globe, or its zoom is out of range;
  • the zip is hashed while it downloads and compared with FixedTimeEquals before it is unpacked;
  • the pack's own pack.json is unpacked first, and every other file is read only up to the size it declares, so a zip bomb behind a valid outer checksum stops after its first chunk rather than at the 2 GB cap (fix(wasserfoerderung): harden the Kartenpaket installer #794); a truncated zip is refused and leaves the older copy;
  • the zip must hold exactly the seven files FORMAT.md names, the area boundary.geojson among them. A path-traversal name, an extra file, a missing file or a duplicate refuses the whole pack (before, such entries were skipped);
  • the pack's own pack.json (capped at 64 KB) must name the same slug and declare the size and SHA-256 of each of the five data files exactly as unpacked;
  • the area is read from the zip only, never fetched from the catalogue's boundaryUrl, and it must parse as a Polygon or MultiPolygon of at most 1 MB before the pack is installed;
  • pack.json is now the publisher's file, so the app's record of the catalogue entry moves to installed.json;
  • addresses.sqlite is opened read-only. Every value is bound, LIKE wildcards in the query are escaped, the query is capped at 100 characters, and a cell of the wrong type or a position off the globe costs only that row. water.geojson is capped at 32 MB and 200 000 features, and only Points with one of FORMAT.md's four emergency values are read.

Each of these has a test that replays it.

elevation.tif (DGM5) is installed and checked but not yet read; it is for the Wasserförderung (#587).

Also

MapCanvasControlTests had three plain [Fact]/[Theory] tests that touch Avalonia types. Once more acceptance classes ran together, they raced the headless thread's InputElement type initialiser (TypeInitializationException, 44 failures). They now run as [AvaloniaFact]/[AvaloniaTheory].

Merge order

Merge only after every pack is rebuilt with boundary.geojson and packs.json lists the new editions. A zip without its area, such as today's ffb-v1, is refused as "unerwarteter Inhalt".

Renumber at merge

Migration V36 and protocol 26/26 (from #790) still sit directly above main (V35 / 25). Renumber them if main moves first.

Screenshots

Before — Führung has no KARTE tab (from #790):

Before Führung

Before — no Karten section in Stammdaten (from #789):

Before Stammdaten

After — the Einsatzort and units on the KARTE tab (fictional pack):

After KARTE

After — Hydranten and a Saugstelle at zoom 17, the HYDRANTEN switch at top right, the OSM note bottom right:

After Hydranten

After — address search with the hits listed; clicking one marks the Einsatzort:

After Adresssuche

After — Stammdaten → Karten with the format-2 detail line:

After Stammdaten

All fixtures are fictional: Musterstraße in Musterstadt, made-up hydrants, generated tiles.

Verification

  • make clean ci: 0 warnings, 0 errors, every test assembly passed (Domain 72, … Acceptance 897), no Test Run Failed. make format-check passed.
  • New tests: catalogue v2 parsing, library checksum and manifest attacks, WaterPointsGeoJsonTests, AddressIndexTests, Lagekarte VM water and address tests, hydrant pixel tests, and an address search driven by a real click in the view.
  • Against the real release (diagnostic run, not committed): the live packs.json parsed; ffb-v1.zip (SHA-256 138a8f4a… matches) installed in 0.6 s with all six files (before the area moved into the zip); 7 534 water points read in 0.1 s; a search on 75 760 addresses takes about 8–30 ms.
  • Not run: the Android head (no workload here). Android only needs MainActivity wiring, which is unchanged from feat(karte): download offline Kartenpakete and show them as a map #789.

🤖 Generated with Claude Code

DeepDiver1975 and others added 7 commits October 27, 2026 21:30
Groundwork for the Lagekarte in Führung. Stammdaten gains a Karten
section that lists the packs published in CodeForFire/lagebuch-regions,
downloads one per Landkreis onto the device, and shows it as a map that
pans by dragging and zooms by wheel, pinch or keyboard.

The map code is salvaged from #164, which never reached main, and moved
out of the Wasserförderung: MapCanvasControl, the MBTiles reader, the
Web-Mercator math and the pack installer. The #152 review findings that
apply to it are fixed: decoded tiles are cached instead of re-decoded on
every frame, failures surface as German status text, and a pack can be
removed while nothing holds its file open.

A pack belongs to the device, not to the Stammdaten: the Stammdaten
travel to every joined client, and a folder on the host means nothing on
a tablet. So the section acts at once and never marks the editor dirty.

Downloads cross a trust boundary and are treated that way: https only,
the body is cut off at the size the catalogue declared, only
region.mbtiles and region.dem are unpacked under fixed names, and a
failed update leaves the older copy in place. The privacy page lists the
pack download as the fifth way data leaves the device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Addresses CodeQL alerts 291-296 on #789.

- WebMercator.CenterOfTiles summed tile indices as int before widening.
  The indices come from an MBTiles file that caps the zoom but not the
  columns, so a tampered pack could wrap the int and open the map on the
  wrong side of the world. The arithmetic now runs in double; a test
  replays such a range.
- MapDrawing does the same multiplication in double. The viewport's
  zoom clamp keeps it from overflowing today, but Draw is public.
- RegionPackLibrary's best-effort cleanup catches IOException and
  UnauthorizedAccessException only, with the reason in the block, as
  SessionPdfExport.DeleteQuietly does, instead of an empty catch-all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
The mutation gate failed on Domain (72.7 %), Persistence (62.1 %) and
AppLogic (70.3 %). Locally it now reads 100 %, 94.7 % and 94.8 %.

- Boundary tests for GeoPoint, the MBTiles zoom and tile range, and the
  catalogue's caps, field types and bounding box.
- The off-world tile test now stores a tile at the address an unchecked
  lookup would read, so it fails if the guard goes.
- The oversized-body test claimed "no Content-Length" but its
  StreamContent computed one, so the byte-counting cut-off never ran.
  It now sends a body of unknown length; a second test sends a lying one.
- Progress, leftovers of an interrupted install, timeout, an
  undeletable pack, the catalogue address, and the section's selection
  and catalogue rows after install and remove.
- RegionPackInfo.Covers had no caller; removed until address search
  needs it.
- Equivalent mutants carry a Stryker disable with the reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Führung gains a KARTE tab beside ORGANISATION, FUNKTIONEN and KRÄFTE.
The Lagebuchführer picks the Einsatzort or a unit and taps the map to
place it, or places it in the middle of the map from the keyboard; a
mark already on the map is dragged to move it. Picking and tapping works
the same on a desk and a tablet, where drag and drop does not.

Positions live in the incident, not in the Kartenpaket: Incident.Location
and ForceUnit.Position, saved in four nullable REAL columns (migration
V36, declared in SchemaGuard). A file that stores something other than a
position there loses the mark, not the Einsatz.

The ETB records the Einsatzort being set, moved and removed, with its
coordinates, and a unit's first placement and removal. Moving a unit
already on the map writes nothing: that is tidying the picture, and an
entry per drag would bury the ones that matter.

Two new commands a client may send, setIncidentLocation and
placeForceUnit, so the protocol and its floor rise to 26. Coordinates
cross the wire as plain numbers and are checked on arrival; a half-given
or impossible pair is refused, never read as "take it off".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…ck with it

#789 dropped Covers while nothing there called it. The Lagekarte does: it
shows the installed pack whose box holds the Einsatzort. Restored with a
test of the box edges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
The catalogue moves to CodeForFire/lagebuch-geodata's packs.json. A pack
is now checked end to end before it is installed: the zip's SHA-256
against the catalogue, its entries against the six files FORMAT.md
names (anything else refuses the pack rather than being skipped), and
each data file's size and SHA-256 against the pack's own pack.json.
The app's record of the catalogue entry moves to installed.json, since
pack.json is now the publisher's. A pack is current when its version
and checksum match, and the list shows "Stand <Tag> · Version n".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
A Kartenpaket from lagebuch-geodata carries water.geojson and
addresses.sqlite, and the KARTE tab now uses both.

- Hydranten, Saugstellen, Löschwasserbehälter and Löschteiche are drawn
  over the map from zoom 15 (red dot / blue square, "UH 100" labels
  from 17), behind a HYDRANTEN switch, with "Hydranten aus OpenStreetMap
  – nicht amtlich." under the attribution. Drawn, not controls: a
  Landkreis has thousands.
- An address search over the map reads "Hauptstr 12a Maisach" as
  street, number and place, treats Str./Strasse/Straße alike, ranks the
  exact number and a confirmed place first, and a picked hit marks the
  Einsatzort with the usual ETB entry (read-only: it only centres). It
  starts from the Einsatz's recorded address while nothing is marked.
- Both files are read off the UI thread through IRegionPackLibrary;
  addresses.sqlite is opened read-only with every value bound and LIKE
  wildcards escaped, water.geojson is size- and feature-capped.

The pure map tests in MapCanvasControlTests now run on the Avalonia
thread: touching MapCanvasControl from an xUnit thread raced the
headless thread's InputElement initialisation once more test classes
ran together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Windows MSI for this pull request: lagebuch-pr798-b94adf1-x64.msi — built from b94adf1

  • Kept for 14 days. Downloading needs a GitHub login, and the MSI arrives inside a .zip.
  • Built on 0.9.1, so it installs over that release, and the next release replaces it.
  • Not signed: SmartScreen → Weitere Informationen → Trotzdem ausführen.

Remove the build-msi label to stop building on every push.

DeepDiver1975 and others added 4 commits October 27, 2026 22:02
CodeQL's cs/loss-of-precision flagged 2 * radius as an int product cast to double. The radius is 5 or 7 and cannot overflow, but double literals keep the drawing math in one type, as the tile math already is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
The KARTE tab showed one pack at a time and switched only when
something was placed or centred, so with FFB and STA installed,
panning across the Landkreis border ran off the edge into blank land.
It also read the installed packs once, when the incident was opened.

- CombinedMapTileSource serves a tile from the first pack that has it,
  so a border is a seam; the attribution lists each distinct licence
  line once.
- Hydranten come from every pack; an unreadable water file costs only
  that pack's points and is reported with its name.
- Opening the KARTE tab re-reads the installed packs, so a pack
  downloaded or deleted under Stammdaten during an Einsatz shows up
  without reopening the incident. The view stays where it was.

Refs #796 (tiles; stitching elevation belongs to the DGM sampler, #587)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
A pack's edge tiles are only partly map: its OSM data is cut to the
Landkreis plus 3 km before rendering, so the rest of an edge tile is
empty land. Taking a whole tile from the first pack that had one let
FFB's empty margin cover STA's streets, as a cream band across the
Ammersee and the Landkreis Starnberg.

Each pack is now a MapTileLayer drawn clipped to its area (even-odd,
so holes stay holes); in the overlap both packs show the same streets.
The area comes from the zip when a pack carries boundary.geojson, then
declared in pack.json and checked like any data file, and otherwise
from the catalogue's boundaryUrl, fetched once at install over https,
capped at 1 MB and refused unless it is a Polygon or MultiPolygon on
the globe. A pack without a known area is drawn whole, underneath the
others; packs installed before this need AKTUALISIEREN once to get
theirs.

The tile cache is keyed by pack as well, sharing its capacity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
A pack installed before the catalogue named its boundaryUrl has no area to be clipped to, but matched the catalogue's version and checksum and so showed as INSTALLIERT with no way to fetch it. A different boundaryUrl now makes it outdated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
AKTUALISIEREN appeared on a pack with the same version number and no explanation (a pack installed before its area was stored). The row now says why: a new version, a rebuild of the same version on another day, or the area still to fetch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

DeepDiver1975 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Three fixes since the description was written, from trying the branch against real FFB and STA packs. In the screenshots below, the first two pictures are your real FFB and STA packs rendered by a throwaway test from this branch; the third is the committed render test with a fictional pack.

Every installed pack is one map, each drawn only within its own area. A pack's edge tiles are only partly map: outside the Landkreis plus 3 km they show empty land, because the OSM data is cut to that area before rendering. Taking a whole tile from the first pack that has one let FFB's empty margin cover STA's streets.

The area comes from boundary.geojson in the zip when a pack carries it (CodeForFire/lagebuch-geodata#14). The app then checks it against pack.json like any other data file. When the zip doesn't carry it, the app fetches the catalogue's boundaryUrl once at install, over https, capped at 1 MB and validated.

Before — tiles taken from the first pack (real FFB + STA):

Before

After — each pack clipped to its area:

After

Opening KARTE re-reads the installed packs, so a pack downloaded during an Einsatz appears without reopening the incident.

AKTUALISIEREN now says why it is offered. A pack installed before its area was stored shows version 1 both before and after the update. The row explains the update: a new version, a rebuild of the same version on a later day, or the area still to fetch.

Update reason

Local make clean ci passed (exit 0, no Test Run Failed) with the clipping commits; the update-reason commit came after that run, and I ran the targeted tests and make format-check for it. CI covers the rest.

DeepDiver1975 added a commit to CodeForFire/lagebuch-geodata that referenced this pull request Oct 27, 2026
A pack's edge tiles are only partly map: the OSM data is cut to the
Landkreis plus 3 km before rendering, so outside that area a tile shows
empty land. An app that shows two neighbouring packs at once has to
draw each clipped to its area, or one pack's empty margin covers the
other's streets (CodeForFire/lagebuch#798).

The area was only published through the manifest's boundaryUrl, which
is not covered by the zip's SHA-256. The zip now carries the same
simplified polygon as boundary.geojson, listed in pack.json with its
size and SHA-256 like every data file. validate_pack.py checks that it
is a Polygon or MultiPolygon Feature with closed rings, inside the
pack's bounds and at most 1 MB, the cap the app enforces.

formatVersion stays 2: the app accepts a zip with or without the file
and falls back to boundaryUrl for packs built before this.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#795 asked for a symbol per kind and a detail view. Hydranten stay red
dots; a Saugstelle is now a blue ring, a Löschwasserbehälter a blue
square and a Löschteich a blue diamond, with a key in the map's corner
whenever they are drawn.

A tap on the map with nothing picked to place opens the card of the
water point under the finger (within a fingertip, only where symbols
are drawn) and rings it; a tap beside it closes the card. The card
lists what OSM holds from FORMAT.md's allowlist -- Bauart, Durchmesser,
Druck, Förderleistung, Volumen, Kupplungen, Lage, Wasser aus, Nummer,
Name, Betreiber, OSM id -- saying the well-known values in German
("Überflur", "DN 150", "Trinkwassernetz") and showing anything else as
OSM spells it, and repeats that OSM is not the Wasserversorger's
register. An OSM reference that is no object id is left off.

WaterPointLayer holds the zoom thresholds and the hit test, so a point
can be tapped exactly when it can be seen.

Closes #795

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

DeepDiver1975 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

#795: one symbol per kind, a key, and a card for each water point.

When nothing is picked for placing, tapping a water point opens its card and rings the point on the map; tapping beside it closes the card. The card lists the OSM tags FORMAT.md allows. Well-known values are said in German ("Überflur", "DN 150", "Trinkwassernetz"), and anything else is shown as OSM spells it.

After — fictional pack, the ÜH 150 clicked:

Hydrant card

Distance from a route to the nearest hydrant, the open question in #795, belongs with routes in #587.

#794 listed what a Kartenpaket installer has to withstand. Two pieces
were still missing:

- A single entry was read until the whole pack reached the 2 GB cap and
  only compared with its declared size afterwards. pack.json is now
  unpacked first (capped at 64 KB), and every other file is read only up
  to the size pack.json declares for it, then checked against its
  declared SHA-256. A zip bomb behind a valid outer checksum stops after
  its first chunk.
- A truncated zip had no test. It is refused as "beschädigt" and leaves
  the older copy in place.

A declared size that is negative or not a number, or a checksum that is
not 64 hex digits, refuses the pack before anything else is unpacked.

Closes #794

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Claude finished @DeepDiver1975's task in 39s —— View job


Review of #798

I read RegionPackLibrary, AddressIndex, CombinedMapTileSource and MapDrawing. I did not read the view models, the views or the sync and migration changes, and I ran no build or tests. Nothing below blocks merging.

Security (pack install and address search)

  • The install path holds up. The checks I looked for are all there:
    • the zip is hashed while it downloads, and FixedTimeEquals compares it before unpacking;
    • the zip must hold exactly the named files, so a duplicate, extra or traversal entry refuses the whole pack;
    • every entry is written under a fixed name;
    • pack.json is unpacked first and capped at 64 KB, and each file is read only up to its declared size;
    • the total unpacked size is capped, and the swap to .previous can restore the old copy.
  • Address search binds every value, escapes the LIKE wildcards, caps the query at 100 characters and opens the file read-only. A bad cell costs only that row, and a SqliteException reads as "nothing found".
  • The boundary fetch is https-only and capped at 1 MB. Parse must succeed before the pack is installed.

Findings, none blocking

  1. AddressIndex.cs:73, the CandidateLimit of 2000 applies in SQL, before Matches filters by place. A short stem such as "Am" or "Haupt" on a large pack can fill the 2000 rows with other places' streets, so the street the user typed never reaches Matches. The ORDER BY street, … makes the cutoff alphabetical rather than relevant. Consider adding the place words to the SQL as a city/suburb/postcode prefix pre-filter, or raising the limit. A test with more than 2000 same-prefix streets would pin it down.
  2. AddressIndex.cs:141, GetValue(5) is double. A lat/lon stored as a SQLite INTEGER (for example 48 rather than 48.0) comes back as long and drops the row. An OSM-derived file would normally store REAL, so this is rare. reader.GetValue(5) is double or long with a conversion would be more tolerant.
  3. AddressIndex.cs, LIKE case folding. SQLite LIKE is case-insensitive for ASCII only, so "ärztehaus" and "Ärztehaus" differ. Normalize folds case in C# afterwards, but the SQL prefilter has already dropped the row. The same applies to "Österreicher …". A fix is to prefilter on the first ASCII-safe characters only, or to store a normalised column in the pack format.
  4. RegionPackLibrary.cs:219, SearchAddressesAsync. Task.Run(…, cancellationToken) only cancels before the work starts. A slow query on a large file then runs to the end after the user types again. Typing is probably debounced in the view model, so this is minor, but Search could take the token and check it in the read loop.
  5. RegionPackLibrary.cs:169, the IOException catch in InstallAsync. Reading a corrupt zip entry can throw IOException. That is reported as "…konnte nicht gespeichert werden. Freien Speicher prüfen." The hint is wrong for a damaged file. Minor, since InvalidDataException already covers most corrupt zips.
  6. CombinedMapTileSource.GetTile returns the first pack's tile and so reintroduces the margin problem for any caller that uses it. The remarks document this. If only Layers is drawn today, consider limiting its visibility or adding a test that nothing in the app calls it.

CodeQL alerts (#297, #298)
Both are on the MapDrawing.cs revision from the original diff, with radius as an int and 2 * radius passed to a double parameter. At HEAD radius is double (MapDrawing.cs:139), and the tile arithmetic casts an operand, not the product. I expect the alerts to close on the next scan, but I could not check the scan result. If they stay open, look at lines 69–70.

Checklist from AGENTS.md

  • The description says the changelog entry exists (changelog.d/+lagekarte.added.md). I did not open it, so check it is one English sentence with no PR link.
  • I did not check docs/master-data.example.json, because the PR does not appear to touch MasterDataSet.
  • The V36 and protocol 26/26 renumber note is correct. Confirm main's current CurrentVersion before merging.

The SQL prefilter capped its candidates at 2000 rows before the street
and place were compared, so a short stem such as "Haupt" filled the cap
with other streets that sort first. The cap now counts matched hits.

SQLite's LIKE folds ASCII only, so "ölmühlweg" never reached Normalize.
The prefix now stops before the first non-ASCII letter and binds the
first letter in both cases.

Search also takes the cancellation token and checks it per row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Each finding checked against the branch:

  1. CandidateLimit applied before Matches. Real, and fixed in f939e64. The SQL no longer has a LIMIT. The cap now counts rows that passed the street and place comparison, so a short stem like "Haupt" can no longer fill it with other streets. The index has BINARY collation, so it never served the case-insensitive LIKE; the query was a table scan already and costs the same. Test: 2 100 "Haupt Allee" rows in Olching sorting before "Hauptstraße 12 Maisach", which is still found.
  2. INTEGER lat/lon. No change. FORMAT.md declares both columns REAL, and REAL affinity converts a stored integer back to floating point on read, so a conforming pack never returns a long. Only a table declared some other way does, and skipping its rows is what Row is for.
  3. LIKE folds ASCII only. Real, and fixed in f939e64. The SQL prefix stops before the first non-ASCII letter. A street starting with Ä/Ö/Ü is matched in both cases (street LIKE 'Ölm%' OR street LIKE 'ölm%'), and Normalize still does the full comparison. Test: "ölmühlweg 4", "Ölmühlweg 4" and "ÖLMÜHLWEG 4" each find "Ölmühlweg 4", and "MÜHLWEG 4" finds "Mühlweg 4".
  4. Cancellation. Fixed in f939e64. AddressIndex.Search takes the token and checks it once per row, and SearchAddressesAsync passes it on. In the app this could not overlap anyway, because SearchAddressCommand is an AsyncRelayCommand and does not run twice at once.
  5. IOException reported as "Freien Speicher prüfen". No change. ZipArchive and DeflateStream report corrupt data, a CRC mismatch and an unsupported method as InvalidDataException, which Unpack already reports as "beschädigt". An IOException there comes from the file system, where the storage hint fits.
  6. CombinedMapTileSource.GetTile. No change. MapDrawing.cs:38 draws combined.Layers, each clipped to its own area, and MapTileCache calls GetTile per layer. The only callers of the combined GetTile are its own tests. IMapTileSource requires the member, and the remarks say what it returns.

CodeQL #297/#298: closed. Code scanning shows no open alerts on refs/pull/798/merge.

Checklist: changelog.d/+lagekarte.added.md is one English sentence with no PR link. main is still at V35 and protocol 25/24, so V36 and 26/26 stand.

🤖 Generated with Claude Code

Every pack is rebuilt with boundary.geojson inside it, so the fallback
that fetched the area from the catalogue's boundaryUrl is gone. The area
is now one of the data files pack.json declares, a zip without it is
refused, and it must still parse before the pack is installed.
RegionPackInfo no longer carries BoundaryUrl, so a pack no longer counts
as outdated only because the catalogue started naming its area.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975 added a commit to CodeForFire/lagebuch-geodata that referenced this pull request Oct 28, 2026
An app now reads the area from boundary.geojson in the zip only and
refuses a zip without it (CodeForFire/lagebuch#798), and every pack is
rebuilt with it. The sentence saying an app falls back to boundaryUrl
for six-file packs, and the note that an app accepts a zip with or
without the area, no longer hold. boundaryUrl itself stays in the
manifest for its own use.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DeepDiver1975 added a commit to CodeForFire/lagebuch-geodata that referenced this pull request Oct 28, 2026
An app now reads the area from boundary.geojson in the zip only and
refuses a zip without it (CodeForFire/lagebuch#798), and every pack is
rebuilt with it. The sentence saying an app falls back to boundaryUrl
for six-file packs, and the note that an app accepts a zip with or
without the area, no longer hold. boundaryUrl itself stays in the
manifest for its own use.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@DeepDiver1975
DeepDiver1975 merged commit 4a05277 into main Oct 29, 2026
17 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/lagekarte-geodata branch October 29, 2026 10:37
DeepDiver1975 added a commit that referenced this pull request Oct 30, 2026
Stryker mutates every changed file whole and scores only the changed
lines afterwards. A pull request that adds a migration therefore mutates
all of Migrations.cs and IncidentRepository.cs, about 1,500 mutants run
against some 600 Persistence tests. That took 27 of the 30 minutes on
#798, and on #820 the Persistence job was cancelled at the limit with
1,417 mutants still running.

Raise the limit to the 60 minutes the scheduled whole-project job already
has. Mutating only the changed line ranges would remove the cost itself;
that is a separate change.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-msi Build a Windows MSI for this PR on every push

Projects

None yet

2 participants