For developers: Hidden fasterRaster functions
Adam B. Smith
2024-12-17
Source:vignettes/hidden_functions.Rmd
hidden_functions.Rmd
fasterRaster contains a set of “private” functions
that users can access using fasterRaster:::functionName
.
These functions are useful for power users and developers. Not all
hidden functions are listed here. Often, a method will have a hidden
function of the same name that starts with a period (e.g.,
.plot()
). This “period” function is intended to be supplied
the sources()
name of a GRaster
or GVector
from other
functions so that the calling function does not need to spend the time
creating the GRaster
or GVector
pointer before
calling the function. “Period” functions will, though, often work on
GRaster
s or GVector
s, though some
error-checking and region re-definition is not conducted.
General
-
.backdoor()
: Calls [faster()] and sets GRASS folder to “C:/Program Files/GRASS GIS X.Y”, plus other options useful for development. -
.fileExt()
: Get file extension -
.ls()
: Lists thesources
of all objects in the active GRASS “project/location” -
.message()
: Display a warning or message if the given warning has not been displayed since fasterRaster was attached or if a given number of hours has passed -
.quiet()
: Returns “quiet” iffaster("debug")
isTRUE
-
.workDir()
: Working directory of aGLocation
object
Rasters and vectors
-
.copyGSpatial()
: Make a copy of the GRASS file pointed to by aGRaster
orGVector
-
.exists()
: Does the GRASS file of aGRaster
orGVector
exist? -
.ext()
: Extent from thesources()
name of aGRaster
orGVector
-
.makeSourceNames()
: Makes one or more statistically unique strings that can be used as file names to represent rasters or vectors in GRASS -
.plot()
: Plot using thesources()
name of aGRaster
orGVector
-
.projection()
: Value of the@projection
slot in aGRaster
orGVector
-
.rastInfo()
and.vectInfo()
: Metadata for a GRASS raster or vector -
.rename()
: Rename a GRASS raster or vector -
.rm()
: Delete rasters or vectors in GRASS
Vectors
-
.aggDisaggVect()
: Aggregate or disaggregate a vector using itssources()
name. -
.geomtype()
: Geometry type (“point”, “line”, or “area”) from thesources()
name of aGVector
-
.validVector()
: Test if aGVector
is valid. -
.vAsDataTable()
: Convert the attribute table linked to a vector in GRASS to adata.table
. This table is distinct from the attribute table attached to aGVector
-
.vAttachDatabase()
: Add a database table to the GRASS representation of aGVector
-
.vCats()
: Get adata.table
with a single column namedcat
, which corresponds to the GRASS attribute table’scat
column -
.vDetachDatabase()
: Detach the GRASS database from a GRASS vector -
.vHasDatabase()
: Tests if GRASS vector has a database -
.vIncrementCats()
: Increment category values of aGVector
-
.vNames()
: “GRASS” vector attribute table column names -
.vRecat()
: Change GRASS category indices of a GRASS vector -
.vValidCats()
: Are category values of a vector valid?
Rasters
-
.layerIndex()
: Gets the index ofGRaster
layers from a numeric, integer, character, or logical vector -
.makeGRaster()
and.makeGVector()
: MakeGRaster
s orGVector
s from a vector ofsources
, which are pointers to files in GRASS -
.minVal()
and.maxVal()
: Values in the@minVal
and@maxVal
slots in aGRaster
-
.nlevels()
: Number of levels in aSpatVector
,data.frame
,data.table
, empty string, or a list ofdata.frame
s,data.table
s, and/or empty strings.
GRASS “Projects/locations” and “mapsets”
-
.locationCreate()
Make a connection to GRASS (i.e., start GRASS from within R) and create a location -
.locationDelete()
Deletes all files associated with a GRASS “location” and mapset -
.locationFind()
: Find a specific GRASS “location” that already exists -
.locationRestore()
Reconnect GRASS to a previously-created GRASS “location” -
.locations()
: List of all available “locations” -
.g.proj()
: Runs GRASSg.proj
module to display projection of current “project” -
.g.region()
: Runs GRASSg.region
module to display region of current “project” -
.mapset()
: GRASS “mapset” of an object or the active session
GRASS “regions”
-
.region()
: Change or report the active region’s extent and resolution -
.regionDim()]
: Change or report the active region’s resolution (alsodim()
and related functions, with no arguments) -
.regionExt()
: Change or report the active region’s extent (alsoext()
and related functions, with no arguments) -
.regionRes()
: Change or report the active region’s dimensions (alsores()
and related functions, with no arguments)
~ FINIS ~