gmeta6 {spgrass6}R Documentation

Reads GRASS metadata from the current LOCATION

Description

GRASS LOCATION metadata are read into a list in R; helper function getLocationProj returns an spproj-compliant PROJ.4 string of projection information. The helper function gmeta2grd creates a GridTopology object from the current GRASS mapset region definitions.

Usage

gmeta6(ignore.stderr = FALSE)
getLocationProj(ignore.stderr = FALSE)
gmeta2grd(ignore.stderr = FALSE)
## S3 method for class 'gmeta6':
print(x, ...)

Arguments

ignore.stderr default FALSE, can be set to TRUE to silence system() output to standard error; does not apply on Windows platforms
x S3 object returned by gmeta6
... arguments passed through print method

Value

Returns list of g.gisenv, g.region -g3, and g.proj values

Author(s)

Roger S. Bivand, e-mail: Roger.Bivand@nhh.no.

Examples

if (nchar(Sys.getenv("GISRC")) > 0) {
  G <- gmeta6()
  print(G)
  CRS(getLocationProj())
  grd <- gmeta2grd()
  print(grd)
  ncells <- prod(slot(grd, "cells.dim"))
  df <- data.frame(k=rep(1, ncells))
  mask_SG <- SpatialGridDataFrame(grd, data=df)
  print(summary(mask_SG))
}

[Package spgrass6 version 0.6-14 Index]