GIS Database: linking
spatial and attribute data
Benjamin Ghansah
Department of
Koforidua Technical University
What is a database?
An integrated set of data on a particular subject
Basis of all analysis and decision making
Database Management Systems
(DBMS)
Specialist software designed to handle multi-user access to integrated set of
data
Need good design, structuring and indexing to provide good analysis and
access
Security and integrity
Maintenance issues
Types of DBMS
Relational databases
Dominate GIS industry
Object databases
More capable of storing complex geographic data types
Not commercially successful
Object-relational databases
Hybrid approach
Supports geographic object types and functions
Functionality of a DBMS
Data model
Data input
Index
Queries- language - SQL
Security
Controlled update
Backup and recovery
Database administration tools
Applications
Programmable API
Why use a database?
Storing data in a structured database
Reduces redundancy and duplication
Decreases maintenance costs – better organisation
Applications are data independent – multiple applications
can use same data and evolve separately
User knowledge can be transferred between applications
as database constant
Data sharing facilitated – provides corporate view for
management
Security and standards can be established
GeoDatabase
Stores spatial features and geometry in same RDBMS (ORACLE or Access)
Feature classes can be created alone or grouped in a feature dataset
Can store behaviour
Personal geodatabase or enterprise geodatabase
The roles of GIS and DBMS
Tasks
Data load
Editing
Mapping
Analysis
Storage
Indexing
Security
Query
Geographic Information
System
Object-Relational
Management System
Data
Databases in a GIS (a DBMS)
5 principles for designing tables
One value in each cell
All values in a column are about the same
subject
Each row is unique
No significance in order of columns
No significance in order of rows
Databases in a GIS (a DBMS)
Relational databases comprise tables
Each geographic class is stored as a table
Database tables can be joined together to create new relations, or views of
the database
Tables can be joined together using common keys
ID Settlement
name
Settlement
status
Settlement
population
County name
6 Bantry Town 28266 Ballia
1 Gitting Village 243 Downshire
2 Boston Town 31520 Downshire
4 Pondside City 112510 Mereshire
5 Craddock Town 21940 Mereshire
3 Puffin Village 412 Ballia
6 Bantry Town 28266 Ballia
7 Digby Village 940 Mereshire
ID County
name
County
population
County area County
capital
1 Downshire 632511 142 Formage
2 Ballia 1520388 205 Bunden
3 Mereshire 490265 170 Pondside
What is wrong with the first table?
Joins and relates
Attributes can either be stored in feature table or as a
separate table
Tables can be associated with each other using a common
key value
Join appends the attributes from one table to another
Relate defines a relationship between two tables
Practical last week (Populations and Japan)
Must know the relationship before connecting the
tables (cardinality)
Joins and relates (in ArcGIS)
Join (tables appended):
One-to-one: Census district has a population density
Many-to-one: e.g soil layer – many polygons have one soil type
GIS: Typically, a data table is joined to a layer based on the value
of a field that can be found in both tables
Relate (tables remain separate)
One-to-many: Employer has many employees
Many-to-many: Many people many live in many places
GIS: defines a relationship between two tables, related data is
accessed when you work with the layer's attributes
ID Settlement
name
Settlement
status
Settlement
population
County name
1 Gitting Village 243 Downshire
2 Boston Town 31520 Downshire
3 Puffin Village 412 Ballia
4 Pondside City 112510 Mereshire
5 Craddock Town 21940 Mereshire
6 Bantry Town 28266 Ballia
7 Digby Village 940 Mereshire
ID County
name
County
population
County area County
capital
1 Downshire 632511 142 Formage
2 Ballia 1520388 205 Bunden
3 Mereshire 490265 170 Pondside
Structured Query Language (SQL)
Standard language for defining and manipulating data held in a database
Data Definition Language
eg CREATE TABLE
Data Manipulation Language
eg SELECT
SQL Tools in ArcMap
Selection
 Select by Attribute
 Select by Location
Some database operations
Selection
Subset of records
Project
Subset of fields
Union
Combines records from tables
Join
Combines fields from tables using common field as link
Relate
Tables remain separate but linked through common field
Geographical queries
9 methods for testing spatial
relationships
Equals
Disjoint
Touches
Crosses
Within
Contains
Overlaps
Relate
• ISO and Open GIS Consortium core geographic
types and functions
• 7 methods supporting
spatial analysis
– Distance
– Buffer
– Convex Hull
– Intersection
– Union
– Difference
– SymDifference
Longley et al, p.232-233
Structured Query Language (SQL)
Standard language for defining and manipulating data held in a database
Data Definition Language
eg CREATE TABLE
Data Manipulation Language
eg SELECT

EMT366_lecture_GIS database linking spatial and attribute data-4.ppt

  • 1.
    GIS Database: linking spatialand attribute data Benjamin Ghansah Department of Koforidua Technical University
  • 2.
    What is adatabase? An integrated set of data on a particular subject Basis of all analysis and decision making
  • 3.
    Database Management Systems (DBMS) Specialistsoftware designed to handle multi-user access to integrated set of data Need good design, structuring and indexing to provide good analysis and access Security and integrity Maintenance issues
  • 4.
    Types of DBMS Relationaldatabases Dominate GIS industry Object databases More capable of storing complex geographic data types Not commercially successful Object-relational databases Hybrid approach Supports geographic object types and functions
  • 5.
    Functionality of aDBMS Data model Data input Index Queries- language - SQL Security Controlled update Backup and recovery Database administration tools Applications Programmable API
  • 6.
    Why use adatabase? Storing data in a structured database Reduces redundancy and duplication Decreases maintenance costs – better organisation Applications are data independent – multiple applications can use same data and evolve separately User knowledge can be transferred between applications as database constant Data sharing facilitated – provides corporate view for management Security and standards can be established
  • 7.
    GeoDatabase Stores spatial featuresand geometry in same RDBMS (ORACLE or Access) Feature classes can be created alone or grouped in a feature dataset Can store behaviour Personal geodatabase or enterprise geodatabase
  • 8.
    The roles ofGIS and DBMS Tasks Data load Editing Mapping Analysis Storage Indexing Security Query Geographic Information System Object-Relational Management System Data
  • 9.
    Databases in aGIS (a DBMS) 5 principles for designing tables One value in each cell All values in a column are about the same subject Each row is unique No significance in order of columns No significance in order of rows
  • 10.
    Databases in aGIS (a DBMS) Relational databases comprise tables Each geographic class is stored as a table Database tables can be joined together to create new relations, or views of the database Tables can be joined together using common keys
  • 11.
    ID Settlement name Settlement status Settlement population County name 6Bantry Town 28266 Ballia 1 Gitting Village 243 Downshire 2 Boston Town 31520 Downshire 4 Pondside City 112510 Mereshire 5 Craddock Town 21940 Mereshire 3 Puffin Village 412 Ballia 6 Bantry Town 28266 Ballia 7 Digby Village 940 Mereshire ID County name County population County area County capital 1 Downshire 632511 142 Formage 2 Ballia 1520388 205 Bunden 3 Mereshire 490265 170 Pondside What is wrong with the first table?
  • 12.
    Joins and relates Attributescan either be stored in feature table or as a separate table Tables can be associated with each other using a common key value Join appends the attributes from one table to another Relate defines a relationship between two tables Practical last week (Populations and Japan) Must know the relationship before connecting the tables (cardinality)
  • 13.
    Joins and relates(in ArcGIS) Join (tables appended): One-to-one: Census district has a population density Many-to-one: e.g soil layer – many polygons have one soil type GIS: Typically, a data table is joined to a layer based on the value of a field that can be found in both tables Relate (tables remain separate) One-to-many: Employer has many employees Many-to-many: Many people many live in many places GIS: defines a relationship between two tables, related data is accessed when you work with the layer's attributes
  • 14.
    ID Settlement name Settlement status Settlement population County name 1Gitting Village 243 Downshire 2 Boston Town 31520 Downshire 3 Puffin Village 412 Ballia 4 Pondside City 112510 Mereshire 5 Craddock Town 21940 Mereshire 6 Bantry Town 28266 Ballia 7 Digby Village 940 Mereshire ID County name County population County area County capital 1 Downshire 632511 142 Formage 2 Ballia 1520388 205 Bunden 3 Mereshire 490265 170 Pondside
  • 15.
    Structured Query Language(SQL) Standard language for defining and manipulating data held in a database Data Definition Language eg CREATE TABLE Data Manipulation Language eg SELECT
  • 16.
    SQL Tools inArcMap Selection  Select by Attribute  Select by Location
  • 17.
    Some database operations Selection Subsetof records Project Subset of fields Union Combines records from tables Join Combines fields from tables using common field as link Relate Tables remain separate but linked through common field
  • 20.
    Geographical queries 9 methodsfor testing spatial relationships Equals Disjoint Touches Crosses Within Contains Overlaps Relate • ISO and Open GIS Consortium core geographic types and functions • 7 methods supporting spatial analysis – Distance – Buffer – Convex Hull – Intersection – Union – Difference – SymDifference Longley et al, p.232-233
  • 21.
    Structured Query Language(SQL) Standard language for defining and manipulating data held in a database Data Definition Language eg CREATE TABLE Data Manipulation Language eg SELECT