Closed raymondben closed 4 years ago
Same issue but on a mac, so i guess "pretend" Linux too
R version 4.0.1 (2020-06-06) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.5
Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding
locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] SOmap_0.5.2.9999 raster_3.3-7 trip_1.7.1
[4] sp_1.4-2
loaded via a namespace (and not attached):
[1] tidyselect_1.1.0 remotes_2.1.1 sf_0.9-4
[4] purrr_0.3.4 splines_4.0.1 lattice_0.20-41
[7] generics_0.0.2 colorspace_1.4-1 spatstat.utils_1.17-0
[10] vctrs_0.3.1 graticule_0.1.2 mgcv_1.8-31
[13] rlang_0.4.6 pkgbuild_1.0.8 e1071_1.7-3
[16] spatstat.data_1.4-3 pillar_1.4.4 DBI_1.1.0
[19] spatstat_1.64-1 foreign_0.8-80 glue_1.4.1
[22] withr_2.2.0 crsmeta_0.3.0 lifecycle_0.2.0
[25] rgeos_0.5-3 munsell_0.5.0 gtable_0.3.0
[28] codetools_0.2-16 traipse_0.1.0 callr_3.4.3
[31] maptools_1.0-1 ps_1.3.3 class_7.3-17
[34] fansi_0.4.1 reproj_0.4.2 Rcpp_1.0.4.6
[37] KernSmooth_2.23-17 tensor_1.5 classInt_0.4-3
[40] backports_1.1.8 scales_1.1.1 abind_1.4-5
[43] deldir_0.1-25 proj4_1.0-10 ggplot2_3.3.2
[46] dplyr_1.0.0 processx_3.4.2 polyclip_1.10-0
[49] grid_4.0.1 rprojroot_1.3-2 rgdal_1.5-12
[52] cli_2.0.2 tools_4.0.1 magrittr_1.5
[55] goftest_1.2-2 tibble_3.0.1 crayon_1.3.4
[58] pkgconfig_2.0.3 MASS_7.3-51.6 ellipsis_0.3.1
[61] Matrix_1.2-18 prettyunits_1.1.1 assertthat_0.2.1
[64] rstudioapi_0.11 R6_2.4.1 rpart_4.1-15
[67] units_0.6-7 nlme_3.1-148 compiler_4.0.1
I blame raster. I wasn't seeing it in a prior version (3.1-5), but I do see it in 3.3-6 (3.3-7 came out a few days ago).
So probably not a SOmap issue (I'll pursue)
thanks @bootneck2000 for the confirmation @mdsumner - that's consistent with what I'm seeing too - my Linux box (working OK) is raster 3.1.5/R 3.6.3, my Windows (R 3.6.3 and 4.02) are raster 3.3.7 and 3.3.6, not working with either of those. thanks
hmm, but in SOmap I expect this from Bathy
class : RasterLayer
dimensions : 1384, 1418, 1962512 (nrow, ncol, ncell)
resolution : 16000, 16000 (x, y)
extent : -11344000, 11344000, -11344000, 10800000 (xmin, xmax, ymin, ymax)
crs : +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
source : memory
names : Elevation.relative.to.sea.level
values : -10352, 6049 (min, max)
In SOmap() now I see this, so looks like it is our fault
x <- SOmap()
x$bathy[[1]]$plotargs$x
class : RasterLayer
dimensions : 860, 861, 740460 (nrow, ncol, ncell)
resolution : 16000, 16000 (x, y)
extent : -2976000, 10800000, -6880000, 6880000 (xmin, xmax, ymin, ymax)
crs : +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
source : memory
names : Elevation.relative.to.sea.level
values : -9637, 4081 (min, max)
Pretty sure it's the trim
operation on https://github.com/AustralianAntarcticDivision/SOmap/blob/dev-0.6/R/SOmap.R#L68
Remove the trim but leave everything else and it's OK (just with a lot of whitespace)
it's definitely isolated to the earlier raster versions though, it's just not only about the plot ... - I probably will put this aside for now for health reasons more tmw
yes good one, works in early raster fails now:
library(SOmap)
x <- Bathy
x1 <- SOmap::latmask(x, -45)
plot(x1) ## ok
plot(trim(x1)) ## bad in raster >=3.3-6
reprex!
v <- raster(volcano)
v[v < 150] <- NA
plot(v) ## good
plot(trim(v)) ## bad
huh, beaten to it: https://github.com/rspatial/raster/issues/138
so, we can forget it!
added a check/warning in onLoad
, at least temporarily
Does anyone else see this?
Happening on Windows only, not a problem on Linux.