gmeta {GRASS} | R Documentation |
GRASS LOCATION metadata are read into a list in R, and processed to provide other functions with parameters and structures they require.
gmeta(interp=FALSE) east(object) north(object) ## Default S3 method: east(object) ## Default S3 method: north(object) ## S3 method for class 'grassmeta': east(object) ## S3 method for class 'grassmeta': north(object) obsno(G) reverse(G) make.maas.location()
interp |
if interp is TRUE, the interface uses text transfer through system() |
G |
a grassmeta object returned by gmeta |
object |
a grassmeta object returned by gmeta |
The function retrieves metadata from the GRASS LOCATION from which R was started, and stores it in a list. The metadata is taken from the current, active region, and the implied resolution for raster layers. Next, this is used to create a number of auxilliary objects used by other interface routines. Other auxilliary objects may be constructed using the access functions east.grassmeta
, north.grassmeta
, obsno
, and reverse
. The function returns a list with class grassmeta
:
LOCATION |
GRASS LOCATION name |
MAPSET |
GRASS MAPSET within the LOCATION |
proj |
GRASS projection description |
n |
Northern edge: numeric |
s |
Southern edge: numeric |
w |
Western edge: numeric |
e |
Eastern edge: numeric |
nsres |
North-South resolution in measurement units, typically metres or decimal degrees |
ewres |
East-West resolution in measurement units, typically metres or decimal degrees |
Nrow |
Number of rows of raster cells |
Ncol |
Number of columns of raster cells |
Ncells |
Number of raster cells |
xlim |
East-West range |
ylim |
North-South range |
xseq |
Sequence of raster cell East-West midpoint coordinates |
yseq |
Sequence of raster cell North-Soutb midpoint coordinates |
ryseq |
Reversed sequence of raster cell North-Soutb midpoint coordinates |
In addition, a number of internal GRASS environment variables are exposed for reading and manipulation - these are at present visible but should be used only with caution, and signal the future deprecation of the gmeta() mechanism for handling metadata.
The functions in this package are intended to work with the GRASS geographical information system. The examples for wrapper functions will will work whether or not R is running in GRASS, and whether or not the current location is that of the data set used for the examples. Examples of interface functions will however (from version 0.2-2) only work outside GRASS, to avoid possible overwriting of GRASS database locations and/or files.
Roger S. Bivand, e-mail: Roger.Bivand@nhh.no.
http://grass.itc.it/statsgrass/index.html, Bivand, R. S., (2000) Using the R statistical data analysis language on GRASS 5.0 GIS data base files. Computers and Geosciences, 26, pp. 1043-1052.
if(!get("maas.loc", env = .GRASS.meta)) make.maas.location() G <- gmeta() summary(G)