R/link2giKarim.R
gvec2sf.Rd
Converts from an existing `GRASS` environment an arbitrary vector dataset into a sf object
gvec2sf(x, obj_name, gisdbase, location, gisdbase_exist = TRUE)
sf
object corresponding to the settings of the corresponding GRASS container
name of GRASS layer
GRASS gisDbase folder
GRASS location name containing obj_name)
logical switch if the GRASS gisdbase folder exist default is TRUE
have a look at the sf
capabilities to read direct from sqlite
run = FALSE
if (run) {
## example
require(sf)
require(sp)
require(link2GI)
data(meuse)
meuse_sf = st_as_sf(meuse,
coords = c("x", "y"),
crs = 28992,
agr = "constant")
# write data to GRASS and create gisdbase
sf2gvec(x = meuse_sf,
obj_name = "meuse_R-G",
gisdbase = "~/temp3/",
location = "project1")
# read from existing GRASS
gvec2sf(x = meuse_sf,
obj_name = "meuse_r_g",
gisdbase = "~/temp3",
location = "project1")
}