Repository navigation
Formats out follow-ups: streamed CSV system notice, digests and loss counts without converting the layer (#2032 C2f-1) #2708
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 |
|---|---|---|
|
|
@@ -62,11 +62,20 @@ pub(crate) fn publish_work(s: &Session, p: &Value) -> Result<super::exports::Wor | |
| let (synced, path, dataset, instance, name) = | ||
| (synced.clone(), path.to_string(), l.dataset.clone(), l.instance_id(), l.name.clone()); | ||
| Ok(Box::new(move || { | ||
| // Both kinds of digest, before anything is written: the record the publish makes may | ||
| // keep the other kind (an older release's record kept no native one), and Cancel must | ||
| // not leave a written file without its record. | ||
| let (lonlat_rows, native_rows) = rustgis_data::sync::digests(&dataset).map_err(|e| e.to_string())?; | ||
| let of_kind = |native: bool| if native { native_rows } else { Some(lonlat_rows) }; | ||
| // The digests the record needs, before anything is written, so Cancel can't leave a | ||
| // written file without its record. A layer held in its own system is hashed as held | ||
| // (no conversion), and in longitude/latitude too only when its record is of that kind | ||
| // (an older release's kept no native one), in the same pass. A record of a kind not | ||
| // hashed here (a held layer read back in longitude/latitude) differs, so the layer | ||
| // takes what was read back: refreshed, never out of step. | ||
|
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 later comment (lines 128-129, which is outside this diff hunk) says the new record's digest is "hashed above", but in this Category: quality
Contributor
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. Left for the release quality pass. |
||
| let err = |e: rustgis_data::DataError| e.to_string(); | ||
| let (lonlat_rows, native_rows) = if synced.native.is_none() || dataset.coord_crs() == rustgis_data::raster::Crs::LonLat { | ||
| let (rows, native) = rustgis_data::sync::digests(&dataset).map_err(err)?; | ||
| (Some(rows), native) | ||
| } else { | ||
| (None, Some(rustgis_data::sync::native_digest(&dataset).map_err(err)?)) | ||
| }; | ||
| let of_kind = |native: bool| if native { native_rows } else { lonlat_rows }; | ||
| let rows = of_kind(synced.native.is_some()); | ||
| let features = dataset.features.len(); | ||
| if rows == Some(synced.digest()) { | ||
|
|
||
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 comment says a projected system's coordinates "aren't checked as such", but the projected branch (
elseat line 5007) still callsCsvLosses::ofon the native coordinates, so they are checked as degrees. The result is never read for a projected target:coordinates_note_inreturns before usingunusable_pointswhen!crs.is_geographic(), andnotes()doesn't read it either. So the pass is wasted work and the comment misstates what happens. Suggest rewording the comment to say the count is not used for projected targets, or skipping the degree check on that path.Category: quality
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.
Left for the release quality pass.