Repository navigation
feat(data): readers say features, geometry and values they leave out, and systems they assume, with loss codes (#2371) #2851
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
5f168f0
2524386
841b0c2
2d283bf
f725247
62ad453
884c56c
e088053
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 |
|---|---|---|
|
|
@@ -158,7 +158,10 @@ impl Losses { | |
| pub fn messages(&self) -> crate::loss::Notes { | ||
| let mut out = crate::loss::Notes::new(); | ||
| if self.no_crs { | ||
| out.push("the answer names no coordinate system; coordinates are read as longitude/latitude"); | ||
| out.push(crate::loss::Note::loss( | ||
| crate::loss::LossCode::AssumedCrs, | ||
| "the answer names no coordinate system; coordinates are read as longitude/latitude", | ||
| )); | ||
| } | ||
| if self.unreadable > 0 { | ||
| out.push(format!("{} values don't fit their field's type and are left empty", self.unreadable)); | ||
|
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. This function is changed by the PR, but three confirmed losses in it stay plain:
A strict run passes all three today. Confidence: medium. Category: bug
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. Right, these three are losses with no code. They were plain before this PR, which doesn't set out to code every notice, so they go in the next #2371 batch: unreadable values as |
||
|
|
@@ -200,9 +203,9 @@ pub fn read(bytes: &[u8], name: &str) -> Result<(Dataset, ReadReport)> { | |
| let mut page = read_page(bytes, name)?; | ||
| page.report.messages.extend(page.losses.messages()); | ||
| if page.exceeded_transfer_limit { | ||
| page.report.messages.push(format!( | ||
| "the service sent {} features only (its record limit); the rest aren't in this answer", | ||
| page.dataset.features.len() | ||
| page.report.messages.push(crate::loss::Note::loss( | ||
| crate::loss::LossCode::DroppedOverLimit, | ||
| format!("the service sent {} features only (its record limit); the rest aren't in this answer", page.dataset.features.len()), | ||
| )); | ||
| } | ||
| Ok((page.dataset, page.report)) | ||
|
|
@@ -337,7 +340,10 @@ pub fn read_page_within(bytes: &[u8], name: &str, limit: usize) -> Result<Page> | |
| || esri_wkt_over_code(code, wkt.as_deref()).is_some() | ||
| || !wkt.as_deref().is_some_and(crate::raster::wkt::parses)) | ||
| { | ||
| report.messages.push("the coordinate system's WKT isn't valid UTF-8; the bytes that can't be read are replaced with U+FFFD"); | ||
| report.messages.push(crate::loss::Note::loss( | ||
| crate::loss::LossCode::ChangedEncoding, | ||
| "the coordinate system's WKT isn't valid UTF-8; the bytes that can't be read are replaced with U+FFFD", | ||
| )); | ||
| } | ||
| let said_before = report.messages.len(); | ||
| let (crs, to_lonlat) = crate::filegdb::esri_crs(code, wkt.as_deref(), &mut report)?; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.