Geoscience Reference
In-Depth Information
Classes "GRASSneigh", "spatial.neighbour" and "data.frame": 1536 obs. of
3 variables:
$ left : int 1 1 1 1 1 1 1 2 2 2 …
$ right : int 2 13 14 15 48 49 50 1 3 13 …
$ length: num 732 902 458 1804 145 …
- attr(*, "external")=num 0 0 0 0 0 0 0 0 0 0 …
- attr(*, "total")=Named num 1329 5178 5620 13156 5139 …
..- attr(*, "names")=chr "-1" "1" "2" "3" …
- attr(*, "region.id")=chr "1" "2" "3" "4" …
- attr(*, "n")=int 281
The second example replicates the
rgeos
gBuffer
given earlier, by exporting a
SpatialPointsDataFrame
object to GRASS with
writeVECT6
and using
execGRASS
to
run the GRASS command
v.buffer
on the input vector object, returning the results to
R
with
readVECT6
. The use of the “6” tag in
spgrass6
function names is now misleading, as the func-
tions work for GRASS versions 6 and 7, but was originally introduced to signal the difference from
GRASS version 5. Generic wrappers will be put in place before GRASS 7 is released:
> writeVECT6(TCE, vname = "TCE", v.in.ogr_flags = "o")
> execGRASS("v.buffer", input = "TCE", output = "TCE10k", distance = 10000)
> TCE10kG <- readVECT6("TCE10k", with_c=TRUE)
The output buffers from GRASS
v.buffer
and
rgeos
gBuffe
r are not exactly identical,
because they do not use the same numbers of boundary coordinates in the same positions to
represent the buffers. Overplotting does, however, show that the buffers are the same given those
representational differences.
The interface between GRASS 6 and
R
has been used in research in a number of fields, for example,
by Carrera-Hernández and Gaskin (2008) in implementing the Basin of Mexico hydrogeological
database and by Grohmann and Steiner (2008) in SRTM resampling using short-distance kriging.
The work by Haywood and Stone (2011) is interesting in that it uses the interface to apply the Weka
machine learning software suite, itself interfaced to
R
through the
RWeka
package, to GIS data in
GRASS;
R
then becomes a convenient bridge between applications, with the GRASS-
R
interface
opening up other possibilities beyond
R
(see also Rico and Maseda 2012). Finally, Jasiewicz (2011)
reports the transfer of fuzzy inference system technology to a GRASS add-on after prototyping
using an
R
implementation in the
sets
package (Meyer and Hornik 2009), which was not intended
for large data sets.
14.4.5 Saga-rSaga, g
eoProceSSing
(rPygeo), M
arine
g
eoSPatial
e
cology
t
oolS
and
o
therS
The open-source SAGA GIS has been interfaced with R using the SAGA command-line interface in
the
RSAGA
package first released to CRAN in early 2008 (Brenning 2011). The package provides
extensive facilities for scripting SAGA through R, as
spgrass6
also now does, since using R to script
repetitive tasks in a GIS turned out to be of value to researchers. The author of
RSAGA
, Alexander
Brenning, has also contributed the
RPyGeo
package, based on
RSAGA
, to auto-generate and run
ArcGIS Python Geoprocessor commands from R. Further examples of the use of R with ArcGIS
are given by Krivoruchko (2011) to supplement methods implemented in ArcGIS and by Roberts
et al. (2010), who have developed Marine Geospatial Ecology Tools (MGET, also known as the
GeoEco Python package).*
*
http://code.env.duke.edu/projects/mget.