http://www.iisc.ernet.in/
GRASS with R: An Introductory Tutorial to Open Source GIS & Statistical Computing Software for Geospatial Analysis
http://wgbis.ces.iisc.ernet.in/energy/
Anindita Dasgupta1          Uttam Kumar1,2,3          Chiranjit Mukhopadhyay2           T.V. Ramachandra1,3,4,*
1Energy and Wetlands Research Group, Centre for Ecological Sciences [CES], 2Department of Management Studies, 3Centre for Sustainable Technologies (astra),
4Centre for infrastructure, Sustainable Transportation and Urban Planning [CiSTUP], Indian Institute of Science, Bangalore – 560012, India.
*Corresponding author:
cestvr@ces.iisc.ernet.in

GRASS / R INTERFACE

The GRASS/R interface substantially improves the geospatial analysis capabilities of GRASS. The “spgrass6” R addon package (http://cran.r-project.org/web/packages/spgrass6/) provides the R to GRASS interface for raster and vector. It is an interface between GRASS GIS and R based on starting R from within the GRASS environment, or running free-standing R in a temporary GRASS location; the package provides facilities for using all GRASS commands from the R command line. When R is used in GRASS GIS, it has two meanings:

  1. R is run “on top of” GRASS, transferring GRASS data to R to run statistical functions on the imported data as R objects in memory, and possibly transfer the results back to GRASS.
  2. The data are stored in GRASS and R is used as a scripting language “on top of” GRASS with execGRASS() function. In this case, little data is moved to R, so memory constraints can be ignored and R functionalities are available.

For the integration of R with GRASS, you need to run R from the GRASS shell environment. The interface dynamically loads compiled GIS library functions into the R environment. The GRASS metadata about the LOCATION’s regional extent and raster resolution are transferred to R. These libraries can be called in R as (i) library(spgrass6), and (ii) library(GRASS). Chapter 10 (Using GRASS with other Open Source Tools) in Open Source GIS A GRASS GIS Approach Book written by Neteler and Mitasova [3] discusses these spatial functions in detail.

BACK   «   TOP   »   NEXT
Citation : Anindita Dasgupta, Uttam Kumar, Chiranjit Mukhopadhyay and Ramachandra. T.V., 2012, GRASS with R: An Introductory Tutorial to Open Source GIS & Statistical Computing Software for Geospatial Analysis, Proceedings of the OSGEO-India: FOSS4G 2012- First National Conference "OPEN SOURCE GEOSPATIAL RESOURCES TO SPEARHEAD DEVELOPMENT AND GROWTH”, 25-27th October 2012, @ IIIT Hyderabad , pp. 1-6.
* Corresponding Author :
Dr. T.V. Ramachandra
Energy & Wetlands Research Group, Centre for Ecological Sciences, Indian Institute of Science, Bangalore – 560 012, India.
Tel : +91-80-2293 3099/2293 3503-extn 107,      Fax : 91-80-23601428 / 23600085 / 23600683 [CES-TVR]
E-mail : cestvr@ces.iisc.ernet.in, energy@ces.iisc.ernet.in,     Web : http://wgbis.ces.iisc.ernet.in/energy, http://ces.iisc.ernet.in/grass
E-mail    |    Sahyadri    |    ENVIS    |    GRASS    |    Energy    |      CES      |      CST      |    CiSTUP    |      IISc      |    E-mail