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
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -280,6 +280,8 @@ impl GpkgSource { | |
| // Columns: the primary key, the geometry and the attribute fields. | ||
| let mut pk = None; | ||
| let mut fields = Vec::new(); | ||
| // The columns with no field type (BLOB), which reading leaves out. | ||
| let mut left_out = Vec::new(); | ||
| { | ||
| let mut st = conn.prepare(&format!("PRAGMA table_info({})", quote(&table))).map_err(err)?; | ||
| let cols = st | ||
|
|
@@ -294,8 +296,9 @@ impl GpkgSource { | |
| pk = Some(name); | ||
| continue; | ||
| } | ||
| if let Some(ty) = field_type(&decl) { | ||
| 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())), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Category: quality |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -354,7 +357,7 @@ impl GpkgSource { | |
| "POLYGON" | "MULTIPOLYGON" | "SURFACE" | "MULTISURFACE" => GeometryType::Polygon, | ||
| _ => GeometryType::None, | ||
| }; | ||
| let info = SourceInfo { | ||
| let mut info = SourceInfo { | ||
| name: table.clone(), | ||
| format: "GeoPackage", | ||
| geometry_type, | ||
|
|
@@ -368,6 +371,10 @@ impl GpkgSource { | |
| notes, | ||
| zm_dropped: false, | ||
| }; | ||
| info.note_columns( | ||
| &left_out, | ||
| ["of a type RustGIS has no field for was left out", "of types RustGIS has no field for were left out"], | ||
| ); | ||
| let file = Some((path.to_path_buf(), id)); | ||
| let mut src = GpkgSource { | ||
| info, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 astable.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