l 6 - geographic data bases

Upload: priscila-quintela

Post on 07-Jan-2016

229 views

Category:

Documents


0 download

DESCRIPTION

geographic

TRANSCRIPT

  • L 6. Geographic Databases 1

    Introduction to Geoinformatics

    L-6. Creating and Maintaining Geographic Databases

    Dr. Gyrgy SZAB associate professor

    Budapest University of Technology and EconomyDepartment of Photogrammetry and Geoinformatics

    [email protected]

    ContentsOVERVIEW

    After people, the database is arguably the most important part of a GIS because ofthe 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 ScienceCH 10. pp. 251-274.

    The six component parts of a GIS

    Data

    Software

    Procedure

    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

    Web & Application Services

    Data Management Services

    USER level

    WEB services

    Integrated Data Base Management

    Typical GIS ArchitectureDBMS Data Models

    History: File storage: physical storage: records, fields, keys Hierarchical model: logical hierarchy explicitly stored by

    pointers Network model: cross connections between hierarchical

    elementsPresent: 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

  • L 6. Geographic Databases 2

    Files

    Phisycal storage: Developement dependency Weak consistency: insert, delete, modify Fix, variable record size

    Hierarchical Model Explicit

    Connections -Pointers

    Logical hierarcy

    Redundancy Sensitivity

    Network Model

    Explicit Connections -Pointers

    Cross connection No redundancy Sensitivity

    Relational Database Management System - RDBMS

    Standardised storage: 2D Tables, Field, Entities, Keys Components: Relational functions, Tables, Integrity

    constrains Consistency, Security, Authorisation SQL language

    Object Oriented Model Near to Real

    World Model Ecapsulation Objects sets Inheritance Polymorphism Methods High

    Consistency

    The roles of GIS and DBMS

  • L 6. Geographic Databases 3

    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 (A) STATES table; (B) POPULATION table

    Parts of GIS database tables for U.S states(C) joined tableCOMBINED STATES and POPULATION

    (B) cleaned data in a GIS DBMS

    Tax assessment database

    (A) raw data

    Tax assessment database

    (D) joined table

    (C) data partially normalized into three subtables

    SQL QuerySQL 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 databasestructures

    DML (data manipulation language) used to retrieve and manipulate data DCL (data control language) handle authorization and access

    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 FROM [WHERE ][][];

  • L 6. Geographic Databases 4

    Find Parcels where Value is greater than 300,000 $ and

    the zoning type is Residental

    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"));

    Results of a SQL query against the tables in Figure 10.3C

    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

    (Source: after Zeiler 1999)

    (Source: after Zeiler 1999)

    Examples of spatial analysis methods on geometries

  • L 6. Geographic Databases 5

    The Database Design ProcessConceptual model Model the users view Define objects and their relationships Select geographic representationLogical model Match to geographic database types Organize geographic database structurePhysical model Define database schema

    Stages in database design

    (Source: after Zeiler 1999)

    Four levels of data model available for use in GIS projects in Users view

    Object hierarchy Object Super Class Object Sub Class-1

    Object Sub Class-n

    Object Set

    6000 7000 8000 9000

    7200

    7240

    Boundary Trafic Vegetation Hidrology

    VaterTerestrialAerial

    7210 7220 7230

    Highway Mani road Unpaved road

    Secondary r.

    7221 7222 7223

    Gov. Municipal Private

    Object propertiesObj.

    Geometry Attributes

    vector raster

    Metr. Top. Doc. Fact

    Object Catalog TableObject Name -Feature Class

    ObjectHierarchy

    Geometry Legend Attributes Req. Geom.accuracy

    Main_line W_net L ID, material, diameter, pressure, build_date, soil,

    Sec_line W_net L ID, material, diameter, pressure, user_name

    Stopcock W_net P ID, diamater1, diameter2, pressure

    Parcel User A ID, parc_id, owner, adress, consumption

    Block User A ID, Block_name, unit_price

    Public_area Municipal A ID, Street_name

    Error Event P ID, Name, Err_type, date, Damage_cost

  • L 6. Geographic Databases 6

    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 entiregeometry 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

    Normalized database topology model

    Physical database topology model

    Indexing 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)

    An example of a B-tree index A multilevel grid geographic database index

  • L 6. Geographic Databases 7

    The point quadtree geographic database index

    (Source: after van Oosterom 2005. Reproduced by permission of John Wiley & Sons, Inc.)

    The region quadtree geographic database index

    (Source: www.cs.umd.edu/~brabec/quadtree. Reproduced by permission of Hanan Smaet and Frantisek Brabec)

    Linear quadtree search orderThe R-tree geographic database index

    (Source: After van Oosterom 2005. Reproduced by permission of John Wiley, Inc.)

    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

    Area in area test using MBREditing and Maintenance

    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 andmaintenance 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.

  • L 6. Geographic Databases 8

    Multi-user editing of continous databases

    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 transactionsVersioning 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

    Database transactions

    (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

    MerciGrazie

    Gracias

    Obrigado Danke

    Japanese

    English

    French

    Russian

    German

    Italian

    Spanish

    Brazilian PortugueseArabic

    Traditional Chinese

    Simplified Chinese

    Hindi

    Tamil

    Thai

    KoreanKsznmHungarian