From ab8a94bd16b2d21bce68e25a97ad4118609713d0 Mon Sep 17 00:00:00 2001 From: Dylan Warburg <53492911+dwarburg@users.noreply.github.com> Date: Sun, 29 Nov 2026 14:15:24 -0800 Subject: [PATCH] test(engine): GeoJSON reading says a dropped measure (M), alone or on a later vertex Two cases in the reading-loss corpus close the GeoJSON M gap in its coverage inventory: a point with a measure and no height ([1,2,null,4], as GeoJSON has no XYM) and a line whose second vertex alone has one. Both give one DroppedZm notice that the clean file doesn't, and every read route reads them as the path does. Co-Authored-By: Claude Opus 5.5 --- crates/engine/testdata/reading-losses/README.md | 2 +- .../tests/integration/never_silent_reading.rs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/engine/testdata/reading-losses/README.md b/crates/engine/testdata/reading-losses/README.md index e42fc706d1..193959fe2e 100644 --- a/crates/engine/testdata/reading-losses/README.md +++ b/crates/engine/testdata/reading-losses/README.md @@ -190,7 +190,7 @@ but not covered here, not necessarily a known bug. CRS assumptions remain separa | Reader dispatch | Paired corpus coverage | Remaining applicable families | | --- | --- | --- | -| GeoJSON | Z, unreadable geometry | M, members/holes, attributes | +| GeoJSON | Z, M (null-Z measure, later vertex), unreadable geometry | Members/holes, attributes | | TopoJSON | Z, missing arcs, bad quantized positions, nested members | M, other parts, attributes | | Delimited text (CSV/TSV/TXT/DAT, gzip wrapper) | CSV WKT Z, bad WKT/XY, later WKT members, extra cells | M, holes/curves, types/names/encoding, wrapper parity | | Shapefile | Point Z/M, line Z/ZM | Other shapes/parts, attributes; DBF encoding tracked in #2325 | diff --git a/crates/engine/tests/integration/never_silent_reading.rs b/crates/engine/tests/integration/never_silent_reading.rs index 2d4cdbc6fb..263fdabde2 100644 --- a/crates/engine/tests/integration/never_silent_reading.rs +++ b/crates/engine/tests/integration/never_silent_reading.rs @@ -227,6 +227,21 @@ pub(super) fn cases(fixture_dir: &std::path::Path) -> Vec { geojson(&[r#"{"type":"Point","coordinates":[1,2,3]}"#]), Expect::Classified(LossCode::DroppedZm, "Z or M"), ), + // A measure without a height: GeoJSON positions have no XYM, so the Z is null. + case( + "GeoJSON: a measure", + "a.geojson", + geojson(&[point]), + geojson(&[r#"{"type":"Point","coordinates":[1,2,null,4]}"#]), + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), + case( + "GeoJSON: a measure on a line's later vertex", + "a.geojson", + geojson(&[r#"{"type":"LineString","coordinates":[[0,0],[1,1]]}"#]), + geojson(&[r#"{"type":"LineString","coordinates":[[0,0],[1,1,null,7]]}"#]), + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), case( "GeoJSON: an unreadable geometry", "a.geojson",