diff --git a/crates/engine/testdata/reading-losses/README.md b/crates/engine/testdata/reading-losses/README.md index e42fc706d1..8ac721d0ef 100644 --- a/crates/engine/testdata/reading-losses/README.md +++ b/crates/engine/testdata/reading-losses/README.md @@ -190,16 +190,16 @@ 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 | -| 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 | +| GeoJSON | Z, unreadable geometry, multi-member collections | M, holes, attributes | +| TopoJSON | Z, M, missing arcs, bad quantized positions, nested members | other parts, attributes | +| Delimited text (CSV/TSV/TXT/DAT, gzip wrapper) | CSV WKT Z and M, bad WKT/XY, later WKT members, extra cells | holes/curves, types/names/encoding, wrapper parity | | Shapefile | Point Z/M, line Z/ZM | Other shapes/parts, attributes; DBF encoding tracked in #2325 | | Standalone DBF | Invalid date read as Null | Other types/names/encoding; geometry and Z/M inapplicable | | KML/KMZ | Z, missing geometry, bad coordinate/hole/part, excess point coordinates | Other parts, attributes | | GPX | Bad waypoint, short track segment | Elevation attributes, other parts, attributes | | GeoRSS (RSS/Atom/GeoRSS, sniffed XML) | Unreadable place/hole, excess coordinate pairs | GML dimensions, other members, attributes | | LandXML (including sniffed XML) | Unreadable point, parcel without geometry | Elevations, curves/parts, attributes | -| GML | Z | M, members/holes/curves, attributes | +| GML | Z, M (4-D, with Z) | members/holes/curves, attributes | | CityGML / CityJSON (distinct parsers) | Varying line Z in each | Other dimensions, surfaces/members/holes, attributes | | DXF | Varying line Z, unreadable entity/vertex | Other entities/curves/parts, attributes | | MapInfo MIF/MID | Unreadable object, arc, short part/ring | Other geometry and attribute conversion | diff --git a/crates/engine/tests/integration/never_silent_reading.rs b/crates/engine/tests/integration/never_silent_reading.rs index 2d4cdbc6fb..2cbebae5a1 100644 --- a/crates/engine/tests/integration/never_silent_reading.rs +++ b/crates/engine/tests/integration/never_silent_reading.rs @@ -234,6 +234,16 @@ pub(super) fn cases(fixture_dir: &std::path::Path) -> Vec { geojson(&[point, r#"{"type":"Point","coordinates":["x",2]}"#]), Said("unreadable geometry"), ), + case( + "GeoJSON: a geometry collection of two members", + "a.geojson", + geojson(&[point, point]), + geojson(&[ + point, + r#"{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[1,2]},{"type":"Point","coordinates":[3,4]}]}"#, + ]), + Expect::Classified(LossCode::DroppedFeature, "unreadable geometry"), + ), // TopoJSON. case( "TopoJSON: a height", @@ -242,6 +252,20 @@ pub(super) fn cases(fixture_dir: &std::path::Path) -> Vec { topo_line("[[0,0,5],[1,1,6]]"), Expect::Classified(LossCode::DroppedZm, "Z or M"), ), + case( + "TopoJSON: a measure", + "a.topojson", + topo_line("[[0,0],[1,1]]"), + topo_line("[[0,0,null,7],[1,1,null,8]]"), + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), + case( + "TopoJSON: a measure on one position", + "a.topojson", + topo_line("[[0,0],[1,1]]"), + topo_line("[[0,0],[1,1,null,8]]"), + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), case( "TopoJSON: an arc index the file doesn't hold", "a.topojson", @@ -278,6 +302,20 @@ pub(super) fn cases(fixture_dir: &std::path::Path) -> Vec { "wkt,id\n\"POINT Z(1 2 3)\",1\n", Expect::Classified(LossCode::DroppedZm, "Z or M"), ), + case( + "CSV: a measure in WKT", + "a.csv", + "wkt,id\n\"POINT(1 2)\",1\n", + "wkt,id\n\"POINT M(1 2 4)\",1\n", + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), + case( + "CSV: a measure on a WKT line", + "a.csv", + "wkt,id\n\"LINESTRING(0 0,1 1)\",1\n", + "wkt,id\n\"LINESTRING M(0 0 7,1 1 8)\",1\n", + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), case( "CSV: an unreadable coordinate", "a.csv", @@ -452,6 +490,16 @@ pub(super) fn cases(fixture_dir: &std::path::Path) -> Vec { ), Expect::Classified(LossCode::DroppedZm, "Z or M"), ), + case( + // GML can't mark a 3-D position as XYM, so a measure comes with a height: a 4-D position. + "GML: a measure", + "a.gml", + gml(r#"48 10 49 11"#), + gml( + r#"48 10 5 7 49 11 6 8"#, + ), + Expect::Classified(LossCode::DroppedZm, "Z or M"), + ), // GeoRSS. case( "GeoRSS: an unreadable place",