Essa é uma revisão anterior do documento!
aRT: R-TerraLib API
aRT is an R package that provides the integration between the statistical software R and the GIS library TerraLib. The aim is to have a package for accessing geospatial data to be analysed in R. R is an open source language and environment for statistical computing and graphics. To learn more about R go to R project web page. TerraLib is an open source GIS classes and functions library, available from the Internet as a collaborative environment for the development of GIS tools. For further information visit TerraLib project web page.
Download and Installation
General Installation
- Install aRT dependencies as detailed in the dependencies section.
- Install as usual for R packages:
> install.packages("aRT", contrib="http://leg.ufpr.br/aRT")
See FAQ for more details.
Linux binaries
- Binaries for some Linux distros are also available.
Windows binary
- Instead of using install.packages(), you can download aRT_1.6-1.zip and use 'Install package(s) from local zip files' in the 'Packages' menu.
Source code
aRT_1.6-1.tar.gz (Monday, 13-Oct-2008) |
Dependencies
aRT depends on other availability of resources as follows and may not run correctly with versions other than indicated.
Linux
- Automatic install of all dependencies: Install-aRT-dep is an apt-based script (Debian, Ubuntu, and friends) to facilitate installing aRT dependencies.
- Individual dependencies
- MySQL version 14.12 Distrib 5.0.32 or greater. MySQL is an open source DBMS.
- apt install:
apt-get install mysql-server-5.0 libmysqlclient15-dev
- Qt version 3.3.3. Qt is a multiplatform toolkit in C++ for the development of graphic interfaces, implemented by Trolltech.
- apt:
apt-get install libqt3-mt-dev
- JPEG. A library for working with jpeg image format.
- apt:
apt-get install 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. Alternatives for installing are:
- Installing by compiling from sources:
mkdir terralib cd terralib 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 cvs -d :pserver:anonymous@cvs.dpi.inpe.br:/home/terralib co -r v-3-2-0 terraView cd terraView/linux make
The Makefile is interraView/linux/
. If permissions allow the compiled TerraLib can be moved to/usr/local
. TerraLib directory needs to be registered inLD_LIBRARY_PATH
. Put the following lines in your.bashrc
(change path toTERRALIBDIR
if needed):TERRALIBDIR=/usr/local/terralib LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TERRALIBDIR/terralibx/lib export LD_LIBRARY_PATH
If TerraLib is located at another directory you can still install aRT by calling (replace/terralib/dir
accordingly):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 seweage. 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
Contact
- 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
- Henrique Dallazuanna - wwwhsd at gmail.com
Collaborators in earlier versions
- Marcos Aurélio Carrero
- Adriana Zanella Martinhago
- Thiago Eugênio Bezerra de Melo
- Elias Teixeira Krainski
- Karla Donato Fook
Acknowledgements
aRT has been developed with the computational resources of the Laboratory of Statistics and Geoinformation (LEG), at UFPR, and the Image Processing Division (DPI), at INPE.
This project is partially supported by Fapesp, proccess number 04/11012-0, FPLF proccess 2005.05.066, and CNPq 552044/2002-4.