Repository navigation
feat(data): open dBASE tables on their own and from zips (#1998) #2252
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
58b57b6
926564f
d3eda9c
094e952
d3b2b0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -723,6 +723,11 @@ pub(crate) fn add_named_bytes(s: &mut Session, p: &Value, name: String, bytes: V | |
| if rustgis_data::source::is_source_name(&name) { | ||
| return super::layer::add_source(s, p, super::layer::Origin::Bytes(&name, std::sync::Arc::new(bytes)), zoom); | ||
| } | ||
| // A standalone dBASE table is binary too, and uses the usual non-spatial table path. | ||
| if name.to_ascii_lowercase().ends_with(".dbf") { | ||
| let read = rustgis_data::io::read_bytes(&name, &bytes).map_err(|e| e.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. Performance (low, confidence low): this branch decodes the whole DBF synchronously on the calling thread, with no Cancel and no progress. Desktop Add Data runs DBF reads through read-ahead, so this matters only if a large DBF reaches here on the desktop, for example through
Member
Author
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. As you note, desktop Add Data reads |
||
| return super::layer::add_read(s, p, read, zoom); | ||
| } | ||
| if name.to_ascii_lowercase().ends_with(".gz") && !rustgis_data::io::is_gzip_text_name(&name) { | ||
| return Err(format!("{name}: decompress it first, then add the supported file inside")); | ||
| } | ||
|
|
||
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.
Bug (low, confidence medium):
partsadds the.cpgonly for a.shp. A standalone.dbftable is read with its.cpg(read_pathcallsread_cpg, andread_dbfdecodes text with it), so a.cpgedit changes the table's text but leaves the table's sync record clean. Add the same companions for a.dbfthat a.shpgets, sochangedreports them.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.
Tracking a standalone table's
.cpgfor changes is a refinement; left for the release quality pass.