gvec2sf: Converts from an existing GRASS 7/8 environment an arbitrary...

View source: R/link2giKarim.R

gvec2sfR Documentation

Converts from an existing GRASS 7/8 environment an arbitrary vector dataset into a sf object

Description

Converts from an existing GRASS 7/8 environment an arbitrary vector dataset into a sf object

Usage

gvec2sf(x, obj_name, gisdbase, location, gisdbase_exist = TRUE)

Arguments

x

sf object corresponding to the settings of the corresponding GRASS container

obj_name

name of GRASS layer

gisdbase

GRASS gisDbase folder

location

GRASS location name containing obj_name)

gisdbase_exist

logical switch if the GRASS gisdbase folder exist default is TRUE

Note

have a look at the sf capabilities to read direct from sqlite

Author(s)

Chris Reudenbach

Examples

## Not run: 
## example 
# get meuse data as sf object
require(sf)
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")

## End(Not run)

link2GI documentation built on Aug. 29, 2022, 9:06 a.m.