Closed MiKatt closed 3 years ago
Thanks, the testing I was doing was with a missing SG
. I guess the expected usage would be to test against R_in_sp
and stop if it is "sf"
, so I'll try that first. Could you please provide a test example?
Please check my edit to see whether it fixes the problem (by running use_sp()
if it hasn't been run, or if use_sf()
has been run - without reverting subsequently. Should be silent if use_sp()
has been run.
Thanks a lot! It behaves now as you describe. Here a test example:
devtools::install_github("rsbivand/rgrass7", force = TRUE)
library(rgrass7)
grass_program_path <- "/usr/lib/grass78/"
dem_path <- system.file("extdata", "nc", "elev_ned_30m.tif", package = "openSTARS")
use_sp()
dem_grid <- rgdal::readGDAL(dem_path, silent = TRUE)
initGRASS(SG = dem_grid, mapset = "PERMANENT", gisBase = grass_program_path,
remove_GISRC = TRUE,
override = TRUE)
It runs silently with use_sp()
and gives a warning without (Warning message: In initGRASS(SG = dem_grid, mapset = "PERMANENT", gisBase = grass_program_path, : use_sp() was set because SG was given
).
Do you need a CRAN release soon, or is installing from github OK for now? The last CRAN submission was three weeks ago, so I'd prefer to wait for the next issues before releasing.
As initGRASS
including SG is used within a function in the package openSTARS
a quick CRAN release would be great. In the meantime, I will post a message to install rgrass7
from github when using openSTARS
.
OK, I'll prepare a submission and explain why it is needed now.
Windows binary if needed on https://win-builder.r-project.org/DWxU2zQsKDLi/, starting submission.
"thanks, package rgrass7_0.2-5.tar.gz is on its way to CRAN."
Since recently, initGRASS always fails with an error "no stars SG yet" when I provide it with an SG for DEFAULT_WIND. The SG provided is a SpatialGridDataFrame and I run use_sp before.
I think I traced down the problem to this part of the code
The last stop is always executed if .get_R_interface() is not null. As far as I see in the history this part was also recently changed.
I am running R 4.0.3, rgrass7 v. 0.2.4 and GRASS 7.8.5 on Linux Mint 19.