AustralianAntarcticDivision / SOmap

Southern Ocean round maps
https://australianantarcticdivision.github.io/SOmap/
24 stars 6 forks source link

All the warnings #85

Closed Maschette closed 4 years ago

Maschette commented 4 years ago

Soooo I updated all my packages and now get a warning frenzy when I call SOmap()

Is this a reproj thing @mdsumner?


library(SOmap)
#> Loading required package: raster
#> Loading required package: sp

SOmap()
#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved
#> Loading required namespace: rgeos
#> Warning in proj4string(x): CRS object has comment, which is lost in output

#> Warning in proj4string(x): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved

#> Warning in proj4string(x): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved
#> Warning in proj4string(x): CRS object has comment, which is lost in output
#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved

#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved

#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved

#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved
#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown based on WGS84 ellipsoid in CRS definition,
#>  but +towgs84= values preserved

#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown based on WGS84 ellipsoid in CRS definition,
#>  but +towgs84= values preserved
#> Warning: st_crs<- : replacing crs does not reproject data; use st_transform for
#> that

#> Warning: st_crs<- : replacing crs does not reproject data; use st_transform for
#> that
#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum WGS_1984 in CRS definition,
#>  but +towgs84= values preserved
#> Warning in proj4string(x): CRS object has comment, which is lost in output
#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown based on WGS84 ellipsoid in CRS definition,
#>  but +towgs84= values preserved

#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown based on WGS84 ellipsoid in CRS definition,
#>  but +towgs84= values preserved

#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown based on WGS84 ellipsoid in CRS definition,
#>  but +towgs84= values preserved


sessionInfo()
#> R version 4.0.0 (2020-04-24)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 17134)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
#> [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
#> [5] LC_TIME=English_Australia.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] SOmap_0.5.2.9999 raster_3.1-5     sp_1.4-2        
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.4.6       compiler_4.0.0     pillar_1.4.4       highr_0.8         
#>  [5] class_7.3-16       tools_4.0.0        digest_0.6.25      evaluate_0.14     
#>  [9] lifecycle_0.2.0    tibble_3.0.1       gtable_0.3.0       lattice_0.20-41   
#> [13] pkgconfig_2.0.3    rlang_0.4.6        DBI_1.1.0          reproj_0.4.2.9001 
#> [17] rgdal_1.5-10       yaml_2.2.1         xfun_0.14          e1071_1.7-3       
#> [21] stringr_1.4.0      dplyr_1.0.0        knitr_1.28         rgeos_0.5-3       
#> [25] generics_0.0.2     vctrs_0.3.1        classInt_0.4-3     grid_4.0.0        
#> [29] tidyselect_1.1.0   graticule_0.1.2    glue_1.4.1         sf_0.9-4          
#> [33] R6_2.4.1           rmarkdown_2.1      ggplot2_3.3.2      purrr_0.3.4       
#> [37] magrittr_1.5       units_0.6-7        scales_1.1.1       codetools_0.2-16  
#> [41] htmltools_0.4.0    ellipsis_0.3.1     proj4_1.0-10       assertthat_0.2.1  
#> [45] colorspace_1.4-1   KernSmooth_2.23-16 stringi_1.4.6      munsell_0.5.0     
#> [49] crayon_1.3.4

Created on 2020-06-25 by the reprex package (v0.3.0)

mdsumner commented 4 years ago

ignore it, it's meaningless we can't do much about it apart from

options(warn = -1)

and that'll turn off all warnings until they get turned back on.

it's just how things are for now, it's not reproj but rgdal/sf

mdsumner commented 4 years ago

looks like we can do this with the new rgdal (1.5-12, released 2020-06-26)

options("rgdal_show_exportToProj4_warnings"="none")

so this would go into our zzz.R, but the problem with that is it masks it for any use of rgdal if SOmap is loaded, so maybe that's too much

mdsumner commented 4 years ago

also, it only applies if this option is set before rgdal is loaded - on the whole, I think it's worthwhile but perhaps not worth conditioning SOmap on this version of rgdal

raymondben commented 4 years ago

dev version now has quietly(...) wrapped inside top-level functions, which selectively suppresses warnings. Currently only warnings with the string "Discarded datum WGS_1984" are suppressed. @mdsumner SOauto_crop throws "NULL source CRS comment, falling back to PROJ string" warnings - should these be suppressed too? I think they come from spTransform

mdsumner commented 4 years ago

yes I don't see any use for these warnings in this context at all - that particular warning is saying

"this S4-class 'CRS' object has an empty value in the comment attribute"

the comment attribute is a hidden attribute, using the comment() mechanism - and it's been retrofit in sp to store WKT2, so that the back-end can transform using a full CRS, while the front-end presents only a PROJ.4 string. It's a kind of backwards compatibility.

(in sf context, sf only stores $input and $wkt now, and $wkt cannot be NULL, the $proj4string apparent value in sf is a dynamic function call)

raymondben commented 4 years ago

Thanks. https://github.com/AustralianAntarcticDivision/SOmap/commit/abee8fdc1d7dbc0c800020e9d9ce160db4e5e971. I think this is OK as a workaround.