Sunteți pe pagina 1din 8

Introduction to Geoinformatics

L-6. Creating and Maintaining Geographic


Databases
Dr. Gyrgy SZAB associate professor

Budapest University of Technology and Economy


Department of Photogrammetry and Geoinformatics
gyszabo@eik.bme.hu

Contents
OVERVIEW
After people, the database is arguably the most important part of a GIS because of
the costs of collection and maintenance, and because the database forms the basis of
all queries, analysis, and decision making.
LEARNING OBJECTIVES
Understand the role of database management systems in GIS;
Recognize structured query language (SQL) statements;
Understand the key geographic database data types and functions;
Be familiar with the stages of geographic database design;
Understand the key techniques for structuring geographic information, specifically
creating topology and indexing;
Understand the issues associated with multi-user editing and versioning.

Longley, Goodchild, Maguire, Rhind (2011): Geographical Information Systems and Science
CH 10. pp. 251-274.

The six component parts of a GIS


Software

Data

Data Base Management Systems


Limitation of the analog libraries: storage place, limited
access, problematic retrieving
Limitation of the traditional data repositories: structural
and storage are dissimilar, verification, consistency weak,
slow retrieval, limited user access, restricted application of
data
Database Management Systems: Standardized, structured
digital storage, verified, controlled access, fast retrieval,
Wide range access and application
Physical/Logical/Structural independency, Security
management, authorization

Procedure

Typical GIS Architecture

DBMS Data Models


USER level

Web & Application


Services

WEB services

Integrated Data
Base Management
Data Management
Services

L 6. Geographic Databases

History:
File storage: physical storage: records, fields, keys
Hierarchical model: logical hierarchy explicitly stored by
pointers
Network model: cross connections between hierarchical
elements
Present:
Relational model (RDBMS): 2D tables, fields, keys, foreign
keys, relations, functions, normalisation
Object-oriented model(ODBMS): near to real world model
encapsulation, objects sets, inheritance, polymorphisms,
methods
Object-Relational (ORDBMS): hybrid solution to extent the
RDBMS engine with ODBMS object management

Files

Hierarchical Model
Explicit
Connections Pointers
Logical
hierarcy
Redundancy
Sensitivity

Phisycal storage:

Developement dependency

Weak consistency: insert, delete, modify

Fix, variable record size

Relational Database Management


System - RDBMS

Network Model
Explicit
Connections Pointers
Cross connection
No redundancy
Sensitivity

Standardised storage: 2D Tables, Field, Entities, Keys


Components: Relational functions, Tables, Integrity
constrains
Consistency, Security, Authorisation
SQL language

The roles of GIS and DBMS

Object Oriented Model


Near to Real
World Model
Ecapsulation
Objects sets
Inheritance
Polymorphism
Methods
High
Consistency

L 6. Geographic Databases

Parts of GIS database tables for U.S states


(A) STATES table; (B) POPULATION table

Storing Data in DBMS Tables

The lowest level of user interaction with a geographic database is usually the object
class (also called a layer or feature class), which is an organized collection of data on a
particular theme
Object classes are stored in a standard database table, a two-dimensional array of rows
and columns.
Rows contain objects (instances of object classes)
Columns contain object properties or attributes
The data stored at individual row, column intersections are usually referred to as values.
Geographic database tables are distinguished from non-geographic tables by the
presence of a geometry column.
Tables are joined together using common row/column values or keys.
Following joins, all tables can be treated as a single table
Lists Codds five principles for the efficient and effective design of tables and
introduces the concept of normal forms
Normal forms improve the simplicity and stability of a database and reduce redundancy
of tables by splitting them into sub-tables that are re-joined at query time

Parts of GIS database tables for U.S states

Tax assessment database

(C) joined tableCOMBINED STATES and POPULATION

(A) raw data

(B) cleaned data in a GIS DBMS

Tax assessment database


(C) data partially
normalized into
three subtables

SQL Query
SQL Simple /Standard Query Language ISO 9075
There are three key types of SQL statements:
DDL (data definition language) used to create, alter and delet relational database
structures
DML (data manipulation language) used to retrieve and manipulate data
DCL (data control language) handle authorization and access

(D) joined table

L 6. Geographic Databases

Simple Queries in Geomedia:


ANALYSIS->ATTRIBUTE QUERY based on the selected feature
class attributes creation a general SQL QUERY in the FILTER field:
The general sintax:
SELECT
<fields- Attributes>
FROM <tables Feature Classes >
[WHERE
<logical expressions>]
[<grouping>]
[<order by>];

Find Parcels where Value is


greater than 300,000 $ and
the zoning type is Residental

Results of a SQL query against the tables in


Figure 10.3C

SELECT Tab10_3a.ParcelNumb, Tabl0_3c.Address,


Tabl0_3a.AssessedValue
FROM (Tabl0_3b INNER JOIN Tabl0_3a ON
Tabl0_3b.ZoningCode =
Tabl0_3a.ZoningCode) INNER JOIN
Tabl0_3c ON Tabl0_3a.OwnersName =
TablO_3c.OwnerName
WHERE (((Tabl0_3a.AssessedValue) >300000) AND
((Tabl0_3b.ZoningType) ="Residential"));

Geographic Database Types and


Functions

The geometry class hierarchy


Testing spatial relationships between these geometric objects (there are
nine methods)
Each takes as input two geometries and evaluates whether the
relationship is true or not.
The full set of Boolean operators to test the spatial relationships
between geometries is: Equals, Disjoint, Intersects, Touches, Crosses,
Within, Contains, Overlaps, Relate
Methods support spatial analysis on these geometries: Distance,
Buffer, ConvexHull, Intersection, Union, Difference, SymDifference

Geometry class hierarchy


(Source: after OGC 1999, reproduced
by permission of Open Geospatial Consortium, Inc.)

Examples of possible relations for two


geographic database operators

Examples of spatial
analysis methods on
geometries
(Source: after Zeiler 1999)

(Source: after Zeiler 1999)

L 6. Geographic Databases

Stages in database design

The Database Design Process


Conceptual model
Model the users view
Define objects and their relationships
Select geographic representation
Logical model
Match to geographic database types
Organize geographic database structure
Physical model
Define database schema

(Source: after Zeiler 1999)

Four levels of data model available for use in


GIS projects in Users view

Object hierarchy
Boundary

Object Super Class

Vegetation

6000 7000
Aerial

Object Sub Class-1

Trafic

8000

Terestrial

Hidrology

9000

Vater

7200
Secondary r. Unpaved
Highway Mani road
road

Object Sub Class-n

7210

Object Set

Gov.

7221

Object properties
Obj.

vector
Metr.

Top.

raster
Doc.

L 6. Geographic Databases

Fact

Private

7222 7223

Object Catalog Table


Object
Name
Feature Class

Object
Hierarchy

Geometry

Legend

Attributes

Main_line

W_net

ID, material, diameter, pressure,


build_date, soil,

Sec_line

W_net

ID, material, diameter, pressure,


user_name

Stopcock

W_net

ID, diamater1, diameter2, pressure

Parcel

User

ID, parc_id, owner, adress,


consumption

Block

User

ID, Block_name, unit_price

Public_area

Municipal

ID, Street_name

Error

Event

ID, Name, Err_type, date,


Damage_cost

Attributes

Geometry

7220 7230 7240


Municipal

Req. Geom.
accuracy

Normalized database topology model

Structuring geographic
information Topology creation
Normalized Model focuses on the storage of an arc-node data structure (ArcGIS):
Normalized because each object is decomposed into individual topological primitives
for storage in a database and then subsequent reassembly when a query is posed.
Normalized approach advantages are: similarities to the familiar arc-node concept,
geometry is only stored once, access can be via an SQL API
Normalized approach disadvantages are: query performance suffers, standard
referential integrity rules in DBMS have no provision for the complex topological
relationships, updates are problematic due to cascading effects
Physical Model topological primitives are not stored in the database and the entire
geometry is stored together for each object (Geomedia):
Only other things required to be stored are the specific set of topology rules
Topological relationships are then computed on-the-fly whenever they are required by
client applications.
Requires an external client or middle-tier application for validating topological
integrity

Physical database topology model

Indexing

An example of a B-tree index

L 6. Geographic Databases

Geographic databases tend to be very large and geographic queries


computationally expensive
Indexes speed up searching by allowing random instead of sequential
access.
A database index is, conceptually speaking, an ordered list derived
from the data in a table.
DBMS one-dimensional B-tree (Balanced Tree) index that is found in
most major commercial DBMS.
Since these 1D indexes are very poor at indexing geographic objects,
several geographic indexing techniques have been developed
(Quadtree, R-Tree)

A multilevel grid geographic database index

The region quadtree geographic database index

The point quadtree


geographic database index

(Source: after van Oosterom 2005. Reproduced by


permission of John Wiley & Sons, Inc.)

(Source: www.cs.umd.edu/~brabec/quadtree. Reproduced by permission of


Hanan Smaet and Frantisek Brabec)

The R-tree geographic database index

Linear quadtree search order

(Source: After van Oosterom 2005. Reproduced by


permission of John Wiley, Inc.)

Area in area test using MBR

Editing and Maintenance


An MBR can be used to
determine objects definitely in
the study area (green) because
of no overlap, definitely out
(yellow), or possibly in (blue).
Objects possibly in can then be
analyzed further using their
exact geometries. Note the red
object that is actually
completely outside, although
the MBR suggests it may be
partially within the study area

L 6. Geographic Databases

Editing is the process of making changes to a geographic


database by adding new objects or changing existing
objects as part of data load or database update and
maintenance operations.
A database update is any change to the geometry and/or
attributes of one or more objects or any change to the
database schema.
Contemporary GIS come equipped with an extensive array
of tools for creating and editing geographic object
geometries and attributes.

Multi-user editing of continous


databases

Database transactions

Transactions
A group of edits to a database is referred to as a
transaction.
Many geographic transactions extend to hours, weeks, and
months, and are called long transactions
Versioning
Identifies two kinds of versioning
Pessimistic locking locks out all but one user during an
update operation
Optimistic versioning allows multiple users to update at
the same time

(A)linear short transactions

(B) branching version tree

Version reconciliation
For Version 5 the user chooses via the GUI
the geometry edit made in Version 3
instead of 1 or 4.

Thank You

Hindi

English

Thai

Gracias
Russian

Spanish

Obrigad
o

Traditional Chinese

Brazilian Portuguese

Arabic

Danke
German

Grazie
Italian

Merci

Simplified Chinese

French

Japanese
Tamil

Ksznm

Korean

Hungarian

L 6. Geographic Databases

S-ar putea să vă placă și