-
Notifications
You must be signed in to change notification settings - Fork 7
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
Need methods to store objects #172
Comments
@rhijmans, if you have thoughts, please share them with us :-) |
I think you can define a |
courtiol
added a commit
that referenced
this issue
Nov 8, 2023
courtiol
added a commit
that referenced
this issue
Nov 12, 2023
* Edits * Fix typos and outdated URLs * First saveRDS & readRDS methods (#172) * PrecipBrickDE: raster -> terra * isomultiscape was broken * Methods for saveRDS and readRDS * Remove pdf after test * Add bookdown link * Adapt to new IsoriX * Omnibus saveRDS fn * Omnibus saveRDS fn * Use distinct Rproj for bookdown and package * Add comment on terra * `terra::aggregate()` does not na.rm by default (unlike `raster::aggregate`) * Minor edits for consistency * Fix typo(s) * NEWS moved to md * Update spelling * Fix typo(s) * Reoxygenise * Minor edit * Reformatting * Update README * Fix wrong index in tests * Capture spaMM warnings and messages * New IsoriX options for reviving spaMM warnings and messages * Fix typo(s) * Better handle NAs in predictions * `terra::aggregate()` does not na.rm by default (unlike `raster::aggregate`) * Outdated? * Reformating * Add local tests * Update README * Better handle NAs * Add info origin def * Add bullet points to issue template * Add missing namespace * `styler:::style_active_pkg()` and `lintr::lint_package()` * Add path in example * Revise spacing * Local test for RDS * Solve S3/S4 remaining issues * Complete NEWS * Polish links * Update URL * `usethis::use_spell_check(lang = "en-GB")` * `styler:::style_active_pkg()` * `usethis::use_cran_comments()` * Add steps * Update CRAN comment * More steps * Bump version number
courtiol
added a commit
that referenced
this issue
Nov 12, 2023
* Edits * Fix typos and outdated URLs * First saveRDS & readRDS methods (#172) * PrecipBrickDE: raster -> terra * isomultiscape was broken * Methods for saveRDS and readRDS * Remove pdf after test * Add bookdown link * Adapt to new IsoriX * Omnibus saveRDS fn * Omnibus saveRDS fn * Use distinct Rproj for bookdown and package * Add comment on terra * `terra::aggregate()` does not na.rm by default (unlike `raster::aggregate`) * Minor edits for consistency * Fix typo(s) * NEWS moved to md * Update spelling * Fix typo(s) * Reoxygenise * Minor edit * Reformatting * Update README * Fix wrong index in tests * Capture spaMM warnings and messages * New IsoriX options for reviving spaMM warnings and messages * Fix typo(s) * Better handle NAs in predictions * `terra::aggregate()` does not na.rm by default (unlike `raster::aggregate`) * Outdated? * Reformating * Add local tests * Update README * Better handle NAs * Add info origin def * Add bullet points to issue template * Add missing namespace * `styler:::style_active_pkg()` and `lintr::lint_package()` * Add path in example * Revise spacing * Local test for RDS * Solve S3/S4 remaining issues * Complete NEWS * Polish links * Update URL * `usethis::use_spell_check(lang = "en-GB")` * `styler:::style_active_pkg()` * `usethis::use_cran_comments()` * Add steps * Update CRAN comment * More steps * Bump version number
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
It is no longer possible to directly save objects created by IsoriX onto the hard drive with terra.
Context
When relying on raster it was possible to save objects created by IsoriX onto the hard drive as
*.rda
or*.rds
.Objects created by IsoriX are composite in the sense that they may contain rasters, spatial vectors, and non-spatial info all bundled together as a list.
Those list cannot be saved with terra since this package has functions designed to save rasters or vectors specifically and no function to store any kinds of composite.
This matters for users because spatial objects created by IsoriX can be very slow to create.
This also matters to me for editing the bookdown.
Solution
Turning files into binaries ("serialisation") does not seem to be a recommended practice for spatial objects, and even with raster it led to issues if the values were not stored in memory.
So the solution seems to implement methods to save specific classes of IsoriX-created objects.
These methods would create a folder with a particular structure within which the different parts of the objects would be saved separately.
We would also have methods to read these folders so as to recreate the IsoriX objects.
Objects created in IsoriX containing spatial data
ISOFIT
: a list storing various info and no spatial data.MULTIISOFIT
: a list storing various info and no spatial data.CALIBFIT
: a list storing various info as well as 0 or 1 SpatVector and no SpatRaster.ISOSCAPE
: a list storing 1 SpatRaster and 1 SpatVector.ISOFIND
: a list of 3 lists, one containing 4 SpatRaster, one containing 1 SpatRaster, one containing (up to?) 3 SpatVector.Open questions
ISOFIND
to make it simpler (e.g. single brick)? (I need to check if various sets of points can be combined within a single SpatVector)The text was updated successfully, but these errors were encountered: