Essa é uma revisão anterior do documento!
aRT: R-TerraLib API
aRT is an R package that provides the integration between the software R and the GIS classes TerraLib. The aim is to have a package for analysing spatial data in R. R is a freely-available open source language and environment for statistical computing and graphics. To learn more about R go to R project web page. TerraLib is a GIS classes and functions library, available from the Internet as open source, allowing a collaborative environment and its use for the development of multiple GIS tools. Further information can be found at TerraLib project web page.
Download and Installation
Linux
To install aRT, first check the section Dependencies below, or use install-aRT-dep, an apt-based script (Debian, Ubuntu, and friends) to install aRT requirements. Then, install aRT through a Debian package, or directly from R:
install.packages("aRT", contrib="http://leg.ufpr.br/aRT")
Windows
aRT_2.0-0.zip (Friday, 19-Sep-2008 12:00:00 BRT) |
Before installing aRT, see the section Dependencies below. After that, download aRT and use 'Install package(s) from local zip files' from the 'Packages' menu. You can also download and install aRT directly from R:
install.packages("aRT", contrib="http://leg.ufpr.br/aRT/windows")
Source code
aRT_2.0-0.tar.gz (Friday, 19-Sep-2008 12:00:00 BRT) |
Before installing aRT, see the section Dependencies below.
Dependencies
There are some dependencies for installing aRT. Following there is a link to their pages and versions. Other versions may not run correctly.
Linux
- MySQL version 14.12 Distrib 5.0.32 or greater. MySQL is an open source DBMS. apt: mysql-server-5.0 and libmysqlclient15-dev
- Qt version 3.3.3. Qt is a multiplataform toolkit in C++ for the development of graphic interfaces, implemented by Trolltech. apt: libqt3-mt-dev
- JPEG. A library for working with jpeg image format. apt: libjpeg62-dev
- sp version at least 0.9-26. sp is an R package with S4 classes and methods for spatial data.
- TerraLib version 3.2. TerraLib is a library of classes for GIS. It is available under cvs:
cvs -d :pserver:anonymous@cvs.dpi.inpe.br:/home/terralib login cvs -d :pserver:anonymous@cvs.dpi.inpe.br:/home/terralib co -r v-3-2-0 src cvs -d :pserver:anonymous@cvs.dpi.inpe.br:/home/terralib co -r v-3-2-0 terralibx
There is a Makefile in terralibx/terralib. You can download TerraView too:
cvs -d :pserver:anonymous@cvs.dpi.inpe.br:/home/terralib co -r v-3-2-0 terraView
The Makefile is in terraView/linux/. TerraLib directory need to be registered in LD_LIBRARY_PATH. Put the following lines in your .bashrc:
TERRALIBDIR=/usr/local/terralib LD_LIBRARY_PATH=$TERRALIBDIR/terralibx/lib export LD_LIBRARY_PATH
Usually TerraLib is installed in /usr/local. If TerraLib is located in another directory, you can set it when calling R CMD:
R CMD INSTALL --configure-args=--with-terralib=/terralib/dir aRT
Windows
Examples
The following two figures are one example of R data (from geoR package) that can be exported to a TerraLib database, and then it can be visualized with TerraView.
![]() |
![]() |
---|
One of the main objectives of aRT is to do spatial queries and operations in R. For example, in the following figure we have a spatial data from a TerraLib database of Recife city, in Brazil. In the top left figure we have the map of Recife and its districts, with some points, and the bottom left figure shows the sewerage. The other two result from spatial queries. The top right answers "Which districts contains the points (yellow) and which ones are their neighbours (green)?" and the bottom right answers "Which sewers are inside (red) or touches (green) the districts that contain the points?"
Another example is shown below. In the left figure there are two cities and their neighbours of first and second order. The right side shows all the neighbours that are completely within a buffer given a distance from the polygons, and the ones that has some overlap with this buffer.
Documentation
User Guides (also distributed as package vignettes)
- aRT Manual (pdf)
Papers and Presentations
- Integration of Statistics and Geographic Information Systems: the R/TerraLib Case. P. R. Andrade, P. J. Ribeiro Junior, K. Fook. GeoInfo 2005 (paper, presentation)
- A Process and Environment for Embedding The R Software into TerraLib. P. R. Andrade, P. J. Ribeiro Junior. GeoInfo 2005 (paper, presentation)
Data sets and scripts
- Creating cells and filling attributes (script, shapefile data)
- Points inside of polygons (script, MID/MIFF data)
- Union of polygons (script, shapefile data)
Other links
Authors
- Pedro Ribeiro de Andrade - pedro at dpi.inpe.br (maintainer)
- Paulo Justiniano Ribeiro Junior - paulojus at ufpr.br
- Eduardo Sant'Ana da Silva - eduardo.santanadasilva at gmail.com
Collaborators in earlier versions:
- Marcos Aurélio Carrro
- Eduardo Sant'Ana da Silva
- Adriana Zanella Martinhago
- Thiago Eugênio Bezerra de Melo
- Elias Teixeira Krainski
- Karla Donato Fook
Acknowledgements
This project is partially supported by Fapesp, proccess number 04/11012-0, FPLF proccess 2005.05.066, and CNPq 552044/2002-4.