Repository navigation
fix(data): a GeoPackage's BLOB columns and a File Geodatabase's binary and extra geometry columns are said when left out (#2916) - #3093
Conversation
…y and extra geometry columns are said when left out (opengeos#2916)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| &left_out, | ||
| ["of a type RustGIS has no field for was left out", "of types RustGIS has no field for were left out"], | ||
| ) { | ||
| report.messages.push(format!("{name}: {note}")); |
There was a problem hiding this comment.
The per-table naming is a reasonable way to keep two tables' notes apart, and the dedupe in read (line 183 onward) still works. But it means a geodatabase in which many feature classes each have a binary field gets one notice per table, up to 512 of them, each repeating the same kind of loss. The rule asks for one notice per kind with a count. Worth deciding before merge: either one note for the read that counts columns across tables and names the first 12 as table.field (kind), or keep one per table and say in the PR why the flood is acceptable. Not a data-loss issue, so it can wait for the quality pass if you prefer.
Category: quality
| fields.push(Field::new(name, ty)); | ||
| match field_type(&decl) { | ||
| Some(ty) => fields.push(Field::new(name, ty)), | ||
| None => left_out.push((name, "binary".to_string())), |
There was a problem hiding this comment.
The None arm labels every left-out column "binary". That is right today, because gpkg_blob::field_type returns None only for a BLOB declaration. But the label is now tied to that function's None meaning, and a later change that returns None for another reason would be reported as binary without anyone noticing. The same applies to gpkg_mem.rs:200. Small, optional fix: have field_type return the kind too, or add a comment at gpkg_blob::field_type saying that its None means "BLOB" and that the notes depend on it.
Category: quality
Code reviewNo bugs, security or performance issues found. The two findings below are quality points. I checked the diff against the base-branch rules and the read paths it touches. The reader changes are consistent, and the new tests cover both the lossy and clean cases. Bugs: none found.
Security: none found. Performance: none found. The only new allocation is the small Quality (both posted inline, low severity, neither blocks the change):
AGENTS.md: no breaks found.
Not raised, by the author's own note: the notices are plain notes, not Earlier review threads: none existed on this PR ( Checked, no change needed: the GDAL and DuckDB routes for these formats are not part of this change. Change sizeCompared with
|
📖 Docs previewCommit |
Summary
A GeoPackage table's
BLOBcolumns (other than its geometry) and a File Geodatabase table's binary fields and geometry fields after the first were left out of the layer with no word, against the Never silent rule. Each reader now says it once per table, as FlatGeobuf and GeoParquet already do: "N column(s) of a type RustGIS has no field for was/were left out: photo (binary), ...", counting them and naming the first 12. The count and naming moved out ofSourceInfo::note_columnsintosource::columns_note, so the File Geodatabase reader can use it; FlatGeobuf and GeoParquet say what they said.gpkg.rs(desktop) andgpkg_mem.rs(browser and uploads) say the same words. Read whole, the layer's name goes before the note, as for FlatGeobuf.photos: 2 columns of types ... : scan (binary), Shape_2 (geometry)), because a note several layers share is said once (filegdb::read) and two tables with the same field would otherwise be taken for one.Table::parse) and listed as not read, with GDAL offered, so nothing is dropped quietly. TheKind::Rasterarm in the column loop is unreachable today; it names "raster" if the parser ever reads such a field.POINT, ...) other than the registered geometry column is read as a number or text, not left out. That is a different bug.Surfaces: desktop, CLI, Python, MCP and the Assistant get the notice through the layer notices; the browser through
gpkg_memandfilegdb::read(File Geodatabase folders open on the desktop only). No command, parameter, ribbon, plugin or project change; nothing to undo; no rows read or copied, only column names. The docs list (docs/user-guide/data-formats.md, the GeoPackage and File Geodatabase rows) says what is left out.What is left for you: the issue asks for counted loss-code notices. These notices are counted, but plain, like the FlatGeobuf and GeoParquet ones, so
rustgis-cli run --strictdoesn't stop on them. I looked through the existingLossCodes and none says "a column RustGIS has no field type for was left out":dropped.valueis for a value that didn't fit (its advice, "use a destination field that can hold it", doesn't apply to a column with no field type),dropped.extra-attributesfor values beyond a layer's fields,dropped.featureanddropped.geometryfor rows and shapes. A new code is a public identifier (docs/cli.md, never renamed), so I did not invent one: what to call it, and whether FlatGeobuf and GeoParquet should carry it too, is your choice. That is why this is "Part of #2916".Testing
filegdb::tests::binary_and_extra_geometry_fields_are_said_and_left_out(a binary field, a binary plus a second geometry field, 13 left-out fields, a clean table that says nothing, two tables with the same field each saying it) andsource::tests::geopackage_blob_columns_are_said_and_left_out(desktop and browser readers say the same, 1, 2 and 13 BLOB columns, whole read prefixed with the layer name, the unaltered fixture says nothing). Both failed on the old code on the first assertion (left: []) and pass now.cargo test -q -p rustgis-data(1899 passed, 70 integration, 1 doc),cargo clippy -q -p rustgis-data --all-targets -- -D warningsandcargo fmt --all --checkclean.cargo xtask ci,cargo xtask test-hygieneand the wasm build (the gate runs them).UI evidence
No visible UI change (a notice's text only).
Related issue
Part of #2916 (the counted loss code the issue asks for is left to the maintainer; see the Summary)
Summary by CodeRabbit
Bug Fixes
Documentation