FOSS Relational Database and GeoDatabase Part II. PostgreSQL, Data Base Open Source and GRASS. Marco Ciolli, Fabio Zottele



Similar documents
Basics on Geodatabases

Geodatabase Programming with SQL

Navicat Premium è uno strumento di amministrazione per database con connessioni-multiple, consente di connettersi

Cifratura Dati in Tabelle MySQL

DEVELOPING AND IMPLEMENTING MULTIUSER, FULLY RELATIONAL GIS DATABASE FOR DESKTOP SYSTEMS USING OPEN SOURCE TECHNOLOGIES

IBM Academic Initiative

Knocker main application User manual

OBJECTSTUDIO. Database User's Guide P

Cad Service e l integrazione CAD : Una partnership di valore per. Meeting. G.Delmonte Founder and CEO CadService

Personal Geodatabase 101

Cookbook 23 September 2013 GIS Analysis Part 1 - A GIS is NOT a Map!

GEOGRAPHIC INFORMATION SYSTEMS CERTIFICATION

Spatial Database Support

Dip. di Scienze Economiche, Statistiche e Finanziarie, Università della Calabria, Ponte P. Bucci, Arcavacata di Rende (CS), Italy

INVEST YOUR TALENT IN ITALY

Introduction to PostGIS

22/11/ :08:30 Pag. 1/10

Supported DBMS platforms DB2. Informix. Enterprise ArcSDE Technology. Oracle. GIS data. GIS clients DB2. SQL Server. Enterprise Geodatabase 9.

Archive Server for MDaemon disaster recovery & database migration

Gara Europea a procedura aperta per l affidamento dei servizi di gestione e

SQL Server Introduction to SQL Server SQL Server 2005 basic tools. SQL Server Configuration Manager. SQL Server services management

Creating a File Geodatabase

Source code security testing

SQL Injection Vulnerabilities in Desktop Applications

GIS Databases With focused on ArcSDE

ArcGIS 10.1 Geodatabase Administration. Gordon Sumerling & Christopher Brown

Corso: Administering Microsoft SQL Server 2012 Databases Codice PCSNET: MSQ2-1 Cod. Vendor: Durata: 5

VBA and Databases (see Chapter 14 )

The Advantages of PostgreSQL

Relational Database Basics Review

Package sjdbc. R topics documented: February 20, 2015

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

1 File Processing Systems

SIIV SUMMER SCHOOL 2013 PADOVA (Italy) 9 th -13 th September Innovative Research on Materials and Technologies for Transport Infrastructures

Lezione 10 Introduzione a OPNET

Final Report - HydrometDB Belize s Climatic Database Management System. Executive Summary

Corso: Core Solutions of Microsoft Skype for Business 2015 Codice PCSNET: MSKY-5 Cod. Vendor: Durata: 5

Chapter 2 Database System Concepts and Architecture

Corso: Mastering Microsoft Project 2010 Codice PCSNET: MSPJ-11 Cod. Vendor: Durata: 3

Cisco di Torino

4 IN 5 OUT MATRIX SWITCHER YUV & Stereo Audio

Web publication and sharing of historical and cultural knowledge: the Via Regina project

DBX. SQL database extension for Splunk. Siegfried Puchbauer

Visual FoxPro Accessing MySQL. presented to The Atlanta FoxPro Users Group June 19 th, 2007

PROGRAMMA CORSO DI LOGIC PRO 9

AN STUDY ON DATA CONSISTENCY IN SPATIAL DATABASE SYSTEM

ANDREA COLOMBARI. Curriculum vitae

Pennsylvania Geospatial Data Sharing Standards (PGDSS) V 2.5

The paths of Via Regina geomatics for sustainable mobility

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

MS SQL Express installation and usage with PHMI projects

sensors ISSN

Introductory Concepts

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

Implementation of Recent Metadata Directives and Guidelines in Public Administration: the Experience of Sardinia Region

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

1. INTRODUCTION TO RDBMS

Introduction. Introduction: Database management system. Introduction: DBS concepts & architecture. Introduction: DBS versus File system

INTRODUCTION TO ARCGIS SOFTWARE

The process of database development. Logical model: relational DBMS. Relation

Exemplar. Novembre Cosima Fiaschi Fabrizio Trentini

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey

Hermes.Net IVR Designer Page 2 36

DBMS / Business Intelligence, SQL Server

Introduction: Database management system

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

LAND-RISK: UN SISTEMA WEB-GIS A SUPPORTO DELLE DECISIONI PER IL MONITORAGGIO E LA VALUTAZIONE DEL RISCHIO FALDA PER UNA DISCARICA DI RIFIUTI

Writing Scripts with PHP s PEAR DB Module

Introduction to Database Systems

Basic Concepts of Database Systems

10. Creating and Maintaining Geographic Databases. Learning objectives. Keywords and concepts. Overview. Definitions

How To Write A Store On A Microsoft Database On A Flash (Orchestra) On A Linux Computer (Ortho) On An Ipro (Orroster) On Your Computer Or Your Computer (For Ahem) On The

Statistics Jobs. La mia esperienza nell industria farmaceutica Silvia Barbi, Statistician at Novartis Vaccines Bologna, 9 Maggio 2014

DiskPulse DISK CHANGE MONITOR

ICOM 6005 Database Management Systems Design. Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 August 23, 2001

Application Development

Using the Query Analyzer

Corso: Supporting and Troubleshooting Windows 10 Codice PCSNET: MW10-3 Cod. Vendor: Durata: 5

Chapter 2 Creating a Database

Integrating Web & DBMS

UNIVERSITÀ DI PISA Department of Computer Science. Master s degree in Business Informatics (2 years, 120 ECTS)

Jet Data Manager 2012 User Guide

Vincenzo Gattulli. Dipartimento di Ingegneria Civile, Edile-Architettura, Ambientale Università di L Aquila, Italy.

gvsig: A GIS desktop solution for an open SDI.

Programmable Graphics Hardware

An Integrated Information System for Archaeological Data Management: Latest Developments

Sage 300 ERP Intelligence Reporting Getting Started Guide. Debra Holder March 2014

Elenco titoli corsi di formazione Vers. 1 rev. 0 del 02/01/2005

MySQL for Beginners Ed 3

Database Management Systems

Transcription:

FOSS Relational Database and GeoDatabase Part II PostgreSQL, Data Base Open Source and GRASS Marco Ciolli, Fabio Zottele Dipartimento di Ingegneria Civile e Ambientale Universita' degli Studi di Trento Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale

Data Base management in GRASS DB management in GRASS may follow different procedures. Procedures are not equivalent and the chice of a procedure provides different data processing and analisys tools In particular alphanumeric data connected to geographic data may be managed: Directly with GRASS DB engine This option does not guarantee the respect of DBMS security functions (coherence, integrity and so on) file format is dbf Through an external DBMS interfaced with GRASS in different ways (directly, not directly) Data Management by means of an external Data Base is more reliable and improves analisys and processing capabilities Here various procedures regarding GRASS 6.2.x versions interfaced with PostgreSQL. Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale

Why an external DBMS is better? Direct DB management with GRASS nay lead to: data redundance and inconsistency; data access concurrence problems (multi-user simultaneous access); lost of data integrity; security problems; performance problems under the point of view of time needed to: - data search; - data update. A DBMS, is a tool designed expressely to manage archives, therefore is provided with all the instruments that are necessary and is flexible and tailorable. Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale

Two interface types GRASS and PostgreSQL interface can be obtained in two ways: Direct Interface Interface through ODBC GRASS GRASS Interfaccia GRASS/Postgres Interfaccia GRASS/ODBC PostgreSQL PostgreSQL Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale ODBC driver ODBCPostgreSQL

http://grass.osgeo.org/grass64/manuals/html64_user/database.html

GRASS can be connected to one or more database management systems (DBMS). db.* command set provides a base SQL support to manage attributes, while v.db.* command set operates with vector maps.

Some functions have been made available recently

* Categorie: Category number is vector ID. It is used to connect the attribute/s to each vector object. A vector object can have zero, one, two or more categories. Category numbers are stored within geometry file and within attributes tablefor each vector object (generally "cat" column). Using v.category, category number can be printed or maintained. To connect a vector object to many different tables, different category numbers for each vector object are necessary.

* Layers: It is possible to connect geographical objects in a vector map to one or more tables. Each link to a different attribute table is called layer. A link defines which database driver, what database and which table must be used. Each category number in a geometry file corresponds to a row in the attribute table (generally cat" column). Using v.db.connect layers can be listed or maintained.

GRASS layers does not contain geografic objects, but they are link to attribute tables in which vector object can have zero, one or more categories. If a vector object has zero categories in a layer, the result is it does not appear in the layer. In this way some vector objects can appear in some layers and not in other layers. The advantage of this system is it allows to locate thematically different object that are topologically related in a single map (for example forests and lakes, or cultivated areas and water basins). These virtual layers are also useful to connect temporal data series to series of objects that does not change in time. The first layer is active, for example the first table corresponds to the first layer. Further tables are tied to following layers.

* SQL support: DBF driver provides a limited support to SQL while other DBMS backends (PostgreSQL, MySQL...) give full SQL support because SQL commands are directly sent through DBMI. SQL commands can be directly executed with db.execute, db.select and other db.* modules. When a new table is created, a new attribute table must be created and must be populated with a row per each category (using v.to.db). This operation can be performed in a single pass using v.db.addtable together with type definition of table column.

Db commands and db interaction commands: comandi db DB connections: 1. db.connect 2. db.test 3. db.drivers 4. db.login Tables: 1. db.columns 2. db.copy 3. db.describe 4. db.tables SQL query (operations on tables): 1. 2. db.execute db.select

db.connect allows the connection through a Dbm interface

db.test Tests db driver to check function

db.drivers Shows the available db driver list

db.login Sets user and password of a certain db driver

db.columns Allows to display columns of a certain table within a database

When database is connected and tables are visible it is posible to use graphic interface, more user friendly, to display the columns of a certain table in a database

db.copy allows the user to copy a table between two database that maybe also connected through different db drivers

db.describe Allows the user to display information about a table. If -c parameter is used only the names of the columns are obtained instead of complete description

db.tables Fa la lista di tutte le tabelle contenute in un database

db.execute executes SQL strings directly written or contained in a text file

db.select Prints the result of a selection made in DataBase from an SQL string read from an input file or written in the interface

Db commands and interaction vector-db: comandi v.db Vector-db connection: 1. 2. 1. 2. 3. 4. SQL query: v.db.connect v.to.db v.db.update v.db.addtable v.db.droptable v.db.reconnect.all 1. 2. 3. 4. Display Manager d.vect v.extract v.reclass

v.db.connect Prints or sets the database connection for a particular vector

v.to.db Allows to insert in a database data coming from a vector file

v.db.update Allows to assign a new value to a column connected to a certain map

v.db.addtable creates and adds a new attributes table to a certain layer of an existing vector map

v.db.droptable removes attibutes table of an exixting vector map

v.db.reconnect.all reconnects vector files to a new database

db.dropcol: Eliminates a column from a selcted attribute table

And: db.in.ogr: Imports tables in various formats db.out.ogr: Exports tables in various formats

Attributes table display from layer manager It is possible to display the content of a table connected to the displayed layer

Query from table manager It is possible to create a query direcly form table manager, in this case all Trentino SIC with more than 4000 ha surface

Query in table manager It is possible to use query builder in table manager

Query in table manager

Add vector map layers in Table Manager

Delete layers in a vector map in Table Manager

Modify layers in a vector map in Table Manager

Manage tables in vector maps in Table Manager

Esecuting a query with d.vect si richiede la visualizzazione delle zone di censimento aventi area minore di 500000 Funziona con i monitor lanciati da d.mon

Esecuting a query with layer manager SIC in Trentino with surface less than 4000 hectars

Esecuting a query with gis.m (tcltk - old) Buildings in Trento with roof height less than 10 m

Esecuting a query with v.extract Asks to create a new map containing only streets in with emission between 8 and 9 in the morning is more than 5000 (g CO/km)

d.what.vect -help Description: Allows the user to interactively query a vector map layer at user-selected locations within the current geographic region. Usage: d.what.vect [-1txdfe] [map=name[,name,...]] Flags: -1 Identify just one location -t Terse output. For parsing by programs. -x Print information as plain text to terminal window. -d Print topological information (debugging). -f Enable flashing (slower). -e Open form in edit mode.

Xterm: Vector -> Query with mouse (Form mode, editing enabled) d.what.vect -e nomefile

Old interface d.m is still active can be invoked with: d.m& It uses monitor x1, x2, x3

v.db.univar

v.db.join

v.db.renamecol

v.db.dropcol

pgdesigner http://pgdesigner.sourceforge.net/it/index.html

pgdesigner

pgdesigner

http://www.opengis.org/index.htm MapServer http://mapserver.gis.umn.edu/

http://ems-hitech.com/pgmanager/?src=overture

http://www.pgadmin.org/ pgadminiii

http://www.pgadmin.org/

PgAccess graphic interface for PostgreSQL written in Tcl/Tk, that allows the management of ana archive: table operations, queries... Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale

http://sourceforge.net/projects/pgaccess

Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale

DBdesigner4 a tool to easily design data base (supports MySQL but, at the moment, not PostgreSQL)

phppgadmin

phppgadmin

http://kandalaya.org/download/oo-pgsql.html

http://users.binary.net/thehaas/pgodbc-ooo-howto.html

http://grass.osgeo.org/wiki/openoffice.org_with_sql_databases

http://www.comunecampagnano.it/gnu/accessless/

http://dba.openoffice.org/

http://mdbtools.sourceforge.net/

Bibliografia AA.VV.: "PostgreSQL Programmer's Guide", Regent of the University of California, 1995. AA.VV.: "PostgreSQL User's Guide", Regent of the University of California, 1995. V.S. Subrahmanian: Principles of multimedia database system, Morgan Kaufmann, 1998 M. A. Brovelli, M. Negretti, C. Saldarini: GRASS interfacing with DBMSs, Geomatics Workbooks Indexing tree methods and spatial ordering for maps and geographic data: an overview and application to the geodetic gis project, atti del congresso ISPRS - WG VI/3 "International cooperation and technology transfert", Parma, 15-19 febbraio 1999 L. Biagi, M. A. Brovelli, M. Negretti and C. Saldarini; Nuove metodologie GIS per la stima e l aggiornamento del geoide, pp.123-165, tesi di Laurea svolta presso il Politecnico di Milano, 1999, M. Negretti, C.Saldarini. Ciolli M. Dispense del Corso GRASS e OPEN SOURCE GIS teoria ed applicazioni 1a edizione - anno 2003, 2a edizione - anno 2004, 3a edizione - anno 2005, 4a edizione - Roma anno 2006, 5a edizione Trento anno 2006, 6a edizione Trento anno 2007,7a edizione Trento anno 2008, 8a edizione Trento anno 2009,. File sorgenti e manuali di PostgreSQL: http://www.postgresql.org e http://techdocs.postgresql.org/ Interfaccia grafica PgAccess: http://www.flex.ro/pgaccess/ e www.pgaccess.org File sorgenti e manuali di GRASS: http://grass.itc.it/ http://www.html.it/sql Suffritti P., Appunti sui DataBase Relazionali e sul linguaggio SQL. http://www.suffritti.it/sqltutorial.htm L.Biagi, M.A.Brovelli, M.Negretti, Caratteristiche di PostgreSQL http://www.geo.unipr.it/~gis/tutorials/postgresintro/postgres.pdf M. Zanoni, Implementazione di un sistema integrato gis database per la gestione dei dati di traffico e produzione di mappe delle emissioni. applicazione alla città di Trento. Tesi di Laurea Ingegneria Trento 2003 C. Modena, Analisi e delimitazione delle aree forestali con particolare funzione protettiva in Trentino tramite tecniche GIS. Tesi di Laurea Ingegneria Trento 2003 A. Daloli, Strutturazione e sviluppo di un Database in Postgresql per l analisi dei dati di traffico Tesi di Laurea, Ingegneria Trento 2002 All the web sites cited in this document must be considered part of this bibliography list. Marco Ciolli, Dipartimento di Ingegneria Civile e Ambientale