Beruflich Dokumente
Kultur Dokumente
Data management
All of data (spatial + attributes) is in
database
Functions
Spatial statistics, Image Processing,
Map Algebra
Innovation
Based on state-of-the-art techniques
Same timing as similar commercial
products
http://www.terralib.org
Operational Vision of TerraLib
DBMS
TerraLib
Oracle
Spatial Spatial Access Spatial
Operations Operations
Geographic API for
Application Spatial MySQL
Operations Postgre
SQL
Cadastral Mapping
Improving urban management of large
Brazilian cities
Public Health
Spatial statistical tools for
epidemiology and health services
Social Exclusion
Indicators of social exclusion in inner-
city areas
Land-use change modelling
Spatio-temporal models of
deforestation in Amazonia
Emergency action planning
Oil refineries and pipelines (Petrobras)
TerraLib Structure
Functions
kernel
Visualization Spatio-Temporal File and DBMS
Controls Data Structures Access
I/O Drivers
External
DBMS
Files
TerraView
TerraLib client
Connects to DBMS
Oracle, PostGIS, MySQL and SQLServer
Visualization with ‘views’ and ‘themes’
Images, Grids, vectors and tables
Brushing between graphics and maps
Analysis
Geocoding, ESDA, Clustering (more to come)
I/O
SHP, MIF, and SPRING vectors
TIFF and GEOTIFF rasters
Creating a MySQL spatial database in TerraView
File...Import data
Select the rio_inf_mort.shp (Rio infant mortality data)
Use OBJET_ID_1 as the column
Use Projection... Lat/Long and Datum SAD69
Databases, layers, views and themes
Visualization is based on
views and themes
Theme...Change legend
Theme...Graphic Parameters
Selection a DISPERSION graphic
X – TOTBIRTH
Y – NEO_RATE
Brushing
Operation...TileWindows
Shows both graphics and map
Brush between the two and the table
R – TerraLib integration
http://www.est.ufpr.br/aRT/
aRT: API R-TerraLib
aRT
Enables connection to the DBMS for database administration
aRTdb
Creation and access to a database
aRTlayer
Enables manipulation of layers in aRT
aRTtheme
Enables visualização of themes in TerraView
Integration R - TerraLib
R graphics
##
## loading packages
##
require(geoR)
require(aRT)
##
## Exemple 1: data for parana state
##
data(parana)
points(parana, bor=borders)
A new type: geodata
> class (parana)
[1] "geodata"
> parana
$coords
east north
[1,] 402.9529 164.52841
[2,] 501.7049 428.77100
[3,] 556.3262 445.27065
[4,] 573.4043 447.04177
[5,] 702.4228 272.29590
[6,] 668.5442 261.67070
[7,] 435.8477 286.54044
[8,] 434.0125 317.90506
[9,] 432.4622 288.37001
A new type: geodata
$data
[1] 306.09 200.88 167.07 162.77 163.57 178.61 301.54
[8] 282.07 319.12 244.67 233.31 224.46 206.12 248.99
[15] 237.87 222.87 263.10 236.91 247.01 240.58 304.28
[22] 351.73 277.92 323.08 253.32 315.33 379.94 197.09
[29] 199.91 167.00 182.88 197.10 257.50 205.16 224.07
[36] 212.50 242.08 247.79 187.27 222.54 313.60 269.92
[43] 321.69 208.89 238.62 248.76 193.48 240.48 265.56
[50] 302.13 335.41 330.87 329.49 262.81 365.88 359.08
[57] 344.59 366.10 201.84 218.27 200.38 229.40 235.07
[64] 236.25 228.82 258.12 232.17 248.17 240.66 184.59
[71] 165.46 320.31 232.80 266.27 301.10 244.78 248.57
A new type: geodata
$borders
east north
[1,] 670.2049 111.7610
[2,] 663.7187 107.0510
[3,] 656.0667 105.2420
[4,] 649.9714 100.7915
[5,] 642.6346 97.9930
[6,] 635.2717 101.1545
[7,] 628.7421 105.5405
[8,] 622.7559 110.7495
[9,] 617.2708 116.3970
[10,] 610.4570 120.5795
[11,] 604.4217 119.6670
[12,] 600.2620 121.8980
[13,] 592.6210 119.9675
A new type: geodata
$loci.paper
[,1] [,2]
[1,] 300.336 484.453
[2,] 647.755 317.463
[3,] 361.764 438.781
[4,] 410.100 260.373
R-TerraLib integration: example 1
##
## connection to MySQL
##
> con <- openConn(user=“gilberto")
> con
Object of class aRTconn
DBMS: "MySQL"
User: "gilberto"
Password: ""
Port: 3306
Host: "localhost"
Cleaning the database
> showDbs(con)
[1] "ifgi" "intro" "mysql" "parana"
"test"
> if(any(showDbs(con)=="parana"))
deleteDb(con, "parana", force=T)
Deleting database 'parana' ... yes
Creating a new database
##
## Creating a layer to hold the data
##
l_data <- createLayer(pr, "data")
Building projection to layer 'data' ... yes
Creating layer 'data' ... yes
Loading points into the database
## loading points
> artcoords <- .gr2aRTpoints(parana)
# adding points to a layer
> addPoints(l_data, artcoords)
Converting points to TerraLib format ... yes
Adding 143 points to layer 'data' ... yes
Reloading tables of layer 'data' ... yes
> plot(l_data)
Inserting attributes on the GIS table
File...OpenDatabase...
Parana database is there!
Create Views and Themes (if needed)
Create themes
Borders
Data
Pred