diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e4e40bf36d..537c15bb5d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -60,7 +60,7 @@ jobs: release-build: true # Everyday jobs on real data: the Census Bureau's tracts for Shelby County, Tennessee, checked - # against the areas it publishes (crates/engine/tests/workflows.rs). The files are public domain + # against the areas it publishes (crates/engine/tests/integration/workflows.rs). The files are public domain # and pinned by checksum; a changed file fails the run, a download that fails skips the tests # (`tested` tells the report, which then neither opens nor closes an issue). workflows: diff --git a/ROADMAP.md b/ROADMAP.md index 6720bb1a9e..e726f96fc9 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -71,7 +71,7 @@ A result is right, or RustGIS says what it lost or assumed ([AGENTS.md](AGENTS.md#never-silent)). - Known silent losses: DuckDB queries (`ST_Force2D`) drop Z without a notice; the OSM reader leaves out rings that don't close, rings and member ways with nodes or ways the file doesn't hold, and inner rings outside every outer one; and the text - readers' losses listed as `Silent` in `crates/engine/tests/never_silent_reading.rs`, among them + readers' losses listed as `Silent` in `crates/engine/tests/integration/never_silent_reading.rs`, among them each vertex's Z in DXF and unreadable coordinates, holes and parts in KML, GeoRSS, MapInfo and DXF, plus geometry-collection members in XLSX/ODS/XLS/XLSB, error-valued attribute cells in XLSX, and attribute fields/values in XLSB short-cell workbooks (the original SheetJS 0.18.5 clean diff --git a/crates/data/src/citygml.rs b/crates/data/src/citygml.rs index 0db1d43c2c..c451a31dbc 100644 --- a/crates/data/src/citygml.rs +++ b/crates/data/src/citygml.rs @@ -569,6 +569,13 @@ fn written_dim(e: &BytesStart) -> Option> { Some(written_attribute("srsDimension", value).into()) } +/// Whether the ` bool { + // The error is placed at the `<` of the markup. + usize::try_from(at).ok().and_then(|at| text.get(at..)).is_some_and(|rest| rest.trim_end() == ") -> usize { usize::try_from(reader.buffer_position()).unwrap_or(usize::MAX) } @@ -740,7 +747,10 @@ impl Index { // A syntax error is the text ending inside markup (a tag, a comment): a file cut // short, as one cut between tags is. But for ` { + // The ` + { let at = usize::try_from(reader.error_position()).unwrap_or(usize::MAX); in_root_end = depth == 1 && text.get(at..).is_some_and(|rest| rest.starts_with(" { + let (unknown, other) = if a.is_none() { (first.as_str(), srs) } else { (srs, first.as_str()) }; + let both = if a.is_none() && b.is_none() { "two coordinate systems" } else { "a coordinate system" }; + let then = if self.archive { + "which aren't read together in a model in an archive" + } else { + "which aren't read together; give the coordinate system (crs) to read it in one" + }; + Err(DataError::Unsupported(format!( + "{file_name}: it names {both} RustGIS doesn't know ({} beside {}), {then}", + cut(unknown), + cut(other) + ))) + } _ if self.archive => Err(DataError::Unsupported(format!( "{file_name}: it names different coordinate systems ({} and {}), which aren't read together; in an archive a model keeps the systems it names, so a coordinate system given doesn't apply to it", cut(first), @@ -2599,7 +2624,7 @@ impl<'a, 'i> Walk<'_, 'a, 'i> { fn implicit(&mut self, g: &Node<'a, 'i>) -> Option<()> { if self.local { // A prototype's geometries are GML's: one that is an implicit geometry places nothing. - self.counts.unknown.insert("ImplicitGeometry in a prototype".to_string()); + self.counts.nested_instances += 1; return Some(()); } let at = elements(*g).find(|c| local(c) == "referencePoint")?; diff --git a/crates/data/src/citygml/tests.rs b/crates/data/src/citygml/tests.rs index 4d2ea0dcdd..1c99b89fad 100644 --- a/crates/data/src/citygml/tests.rs +++ b/crates/data/src/citygml/tests.rs @@ -210,6 +210,13 @@ fn a_compound_system_is_read_by_its_horizontal_part() { let other = inner.replace("EPSG:25832", "EPSG:25833"); let err = read("model.gml", &model("EPSG:25832", &building("b1", &other)), None).unwrap_err().to_string(); assert!(err.contains("different coordinate systems (EPSG:25832 and EPSG:25833)"), "{err}"); + // One RustGIS doesn't know beside a known one: said as unknown, not as another system. + let unknown = inner.replace("EPSG:25832", "EPSG:999999"); + let err = read("model.gml", &model("EPSG:25832", &building("b1", &unknown)), None).unwrap_err().to_string(); + assert!(err.contains("a coordinate system RustGIS doesn't know (EPSG:999999 beside EPSG:25832)"), "{err}"); + assert!(err.contains("give the coordinate system (crs)") && !err.contains("different coordinate systems"), "{err}"); + // Given one, it is read in it. + assert!(read("model.gml", &model("EPSG:25832", &building("b1", &unknown)), Some(Crs::Epsg(25832))).is_ok()); } /// A compound system's vertical part is said when its heights aren't metres upward: another unit, a @@ -1109,6 +1116,11 @@ fn a_file_broken_in_the_middle_is_refused() { // Markup that `".to_string(), building("b2", &box_surfaces("b2"))].concat()); assert!(read("model.gml", &bang, None).is_err()); + // Broken in the middle and ending at `".to_string(), building("b2", &box_surfaces("b2"))].concat()); let cut = whole.windows(4).position(|w| w == b"