The GIS Database
Chapter 8 – Part 1
Lecture 8 1
Entity
Bangor
– Penobscot
County, Maine,
United States
– Centroid -
44.801N , -6778W
– Area 34.4 square
miles
– Elevation – 158
feet
– Population 31,473
Lecture 8 2
What is a database?
A database is any organized collection of
data. Some examples common examples:
– a telephone book
– T.V. Guide
– airline reservation system
– motor vehicle registration records
– papers in your filing cabinet
– files on your computer hard drive.
Lecture 8 3
Database Definitions
What is a database?
It’s an organized collection of data, it need not be a computer
based system.
What is a database management system
(DBMS)?
A software system designed to:
– Organize that data in a flexible manner,
– Provide tools to add, modify or delete data from the database,
– Query the data,
– Produce reports summarizing selected contents.
Lecture 8 4
What is the ultimate purpose of
a database management
system?
Data Information Knowledge Action
Is to transform
Lecture 8 5
Features of a DBMS
Database Management Systems provide features
to maintain database:
– Data independence - It refers to the immunity of user
applications to make changes in the definition and
organization of data.
– Integrity and security - refers to maintaining and
assuring the accuracy and consistency of data over
its entire life-cycle
Lecture 8 6
Features of a DBMS
Database Management Systems provide features
to maintain database:
– Transaction management - A transaction comprises
a unit of work performed within a DBMS against a
database, and treated in a coherent and reliable way
independent of other transactions. Transactions in a
database environment have two main purposes:
• To provide isolation from other transactions.
• To have an “all or nothing” effect.
Transactions must pass the ACID test (atomic, consistent,
isolated and durable
Lecture 8 7
Features of a DBMS
Database Management Systems provide features
to maintain database:
– Concurrency control - ensures that correct results for
concurrent operations are generated, while getting
those results as quickly as possible.
– Backup and recovery
– Provides a language for the creation and querying of
the database.
– A language for writing application programs
Lecture 8 8
Selecting a Database
Management System
Database management systems (or DBMSs)
can be divided into two categories:
– Desktop databases are oriented toward single-user
applications and reside on standard personal
computers (hence the term desktop).
– Server databases contain mechanisms to ensure the
reliability and consistency of data and are geared
toward multi-user applications.
Lecture 8 9
Relational Databases
• The relational database model is the most
dominant model in both the corporate and GIS
world, due to its flexibility, organization, and
functioning..
• It was defined by Edgar F. Codd (1970).
• It can accommodate a wide range of data types.
• It is not necessary to know beforehand the types
of processing that will be performed on the
database.
Lecture 8 10
Relational Database Terminology
• Each table contains the data for a single entity.
• Each instance of an entity is a row/record/tuple in
the table. This is a specific instance of the entity.
• Columns contain attributes/fields that describe the
entity.
– Attributes in a column must be from the same domain
(text, integer, date).
– An attribute may have a range (e.g.; 0 ≤ integers ≤ 100)
– Column order has no significance.
• Tables are related through keys.
Lecture 8 11
Attributes
• An entity is represented by a set of attributes,
that is descriptive properties possessed by all
members of an entity set.
Domain – the set of permitted values for each
attribute
• Attribute types:
– Simple and composite attributes.
– Single-valued and multi-valued attributes
• E.g. multivalued attribute: phone-numbers
– Derived attributes
• Can be computed from other attributes
• E.g. age, given date of birth
Lecture 8 12
Relational Database Terminology
Lecture 8 13
Record, row,
tuple
A specific
instance of the
entity
Attribute, column
Entity
Keys
• A super key of an entity set is a set of one or
more attributes whose values uniquely
determine each entity.
• A candidate key of an entity set is a minimal
super key
– Customer-id is candidate key of customer
– account-number is candidate key of account
• Although several candidate keys may exist, one
of the candidate keys is selected to be the
primary key.
Lecture 8 14
Super Key
Lecture 8 15
ID, RollNumber, RegNo, Name, Place, Standard
ID, RegNo, Name
RegNo, Name, Place, Standard
RollNunmber, Name Place
ID, Place
RegNo
Candidate Keys
Lecture 8 16
ID
RollNumber
RegNo
Primary Key
Lecture 8 17
ID
Keys
• A composite key/concatenated is a key
with more than one attribute.
Lecture 8 18
http://ecomputernotes.com/images/Composite%20Key.jpg
Keys
• A foreign key is an attribute that is a key of
one or more relations other than the one in
which it appears.
Lecture 8 19
Foreign Key
Primary Key Foreign Key
Primary Key Foreign Key
Primary Key Foreign Key
20
Lecture 8
Keys
• Given the importance of keys, there are
usually some restrictions on them: e.g.,
null values are not allowed.
• Keys are also used to index a database.
– Too few keys may result in difficulty in
searching and sorting the database.
Lecture 8 21
Physical Database Structure
The physical design of the database specifies
the physical configuration of the database on
the storage media.
– This includes detailed specification of data
elements, data types, indexing options and other
parameters residing in the DBMS data dictionary.
– It is the detailed design of a system that includes
modules & the database's hardware & software
specifications of the system.
Lecture 8 22
https://en.wikipedia.org/wiki/Database_design
Logical Database Structure
• Several logical data structures are used to
express the relationships between
individual data elements or records in a
database.
• Common logical data structures are
hierarchical, network, and relational, with
relational being predominant.
Lecture 8 23
Conceptual Structure
• The conceptual structure is often
represented as a schema.
• A schema describes the database
structure in a shorthand notation.
• One example is the entity-relationship
(ER) diagram.
Lecture 8 24
Entity Relationship Diagram
ENTITY
RELATIONSHIP
ATTRIBUTE
Rectangles represent entity sets.
Diamonds represent relationship
sets.
Lines link attributes to entity sets and
entity sets to relationship sets.
Ellipses represent attributes
Double ellipses represent
multivalued attributes.
Dashed ellipses denote derived
attributes.
Underline indicates primary key
attributes.
Lecture 8 25
Entity Relationship Diagram
Student Enrolls In Courses
ID
Name Address
Phone
Major
Advisor Credits
GPA
Number
Name
Credits
Time
Room
Instructor
Lecture 8 26
Entity Relationship Model
• The result is a diagram of all of the entities, their
attributes, and the relationships between entities
– Each entity becomes a table.
• Student table
• Course table
– Each relationship (usually) becomes a table.
• Enrolls, which allows you to join information from both tables.
Lecture 8 27
Types of Relationships between
Entities
• 1:1 – one faculty member is assigned to one
office.
• 1:M (M:1) – one faculty member teaches
many courses.
• M:N – many students take many courses.
• All of these relationships can exist between
attribute tables.
Lecture 8 28
Table Join
Lecture 8 29
Table Joins
• Table joins depend on the data not the
attribute name.
• There are many different types of table
joins.
• Tables can be joined regardless of the
relationship EXCEPT:
– When joining to the feature attribute table in a
GIS, the relationship must be 1:1 or M:1
– Other relationships must use the relate.
Lecture 8 30
One-to-One Join
Employee-id Job
1 Digislave
2 Useless Supervisor
Employee-id name
1 Tom
2 John
Join Employee-id to Employee-id
After join
Employee-id Job Name
1 Digislave Tom
2 Useless Supervisor John
A join does not permanently alter the table structure
Lecture 8 31
Many-to-One Join
Symbol Description
Qa Quaternary Alluvium
Qe Quaternary Eolian
Pa Permian Abo
Polygon Id Symbol
1 Qa
2 Qa
3 Pa
4 Qe
Polygon ID Symbol Description
1 Qa Quaternary Alluvium
2 Qa Quaternary Alluvium
3 Pa Permian Abo
4 Qe Quaternary Eolian
After Join on Symbol
Lecture 8
32
Lecture 8
Relate in a GIS
33
https://courses.washington.edu/gis250/lessons/tables/images_av3/relate
_table1.gif
Relational Algebra
• Codd’s specification of a relational
database relied on relational algebra.
• Relational algebra takes tables/relations
as inputs and returns tables as outputs.
• The algebra combines or splits tables by
rows or by columns to generate either a
subset of tables or an expanded tables.
Lecture 8 34
Tables comprise the fundamental building blocks of any
database.
The table above contains the employee information for an organization --
characteristics like name, date of birth and title.
Fundamental Building Blocks
Lecture 8 35
Relational Algebra
• Five basic operators
– select: 
– project: 
– union: 
– difference: –
– Cartesian product: x
• The operators take one or two
relations as inputs and produce a new
relation as a result.
Lecture 8 36
Relational Algebra
• Derived Relational operators
– Intersection 
– Divide (not used very often)
– Join
• These can be expressed using
different combinations of the
fundamental operators.
Lecture 8 37
Select Operation – Example
 Relation r A B C D








1
5
12
23
7
7
3
10
 A=B ^ D > 5 (r)
A B C D




1
23
7
10
Select from relation r
where A=B AND D>5
Lecture 8 38
Database Queries
• Queries may be made of one table or
several tables at the same time.
• In many systems querying is facilitated by
icons, or menus, or queries by example
(QBE – a graphical query language ).
Lecture 8 39
Structured Query Language
(SQL)
• DDL – Data Definition Language; used to
create and manage the database.
• DDM – Data Manipulation Language; used
to query the database.
Lecture 8 40
SQL
• SQL: widely used non-procedural language
– E.g. find the name of the customer with customer-id 192-83-
7465
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
• Application programs generally access databases
through one of
– Language extensions to allow embedded SQL
– Application program interface (e.g. ODBC/JDBC) which
allow SQL queries to be sent to a database
Lecture 8 41
Attribute Queries
Lecture 8 42
Lecture 8 43
Lecture 8 44
The ArcGIS Attribute Query
Interface
State’s Table is Open
Lecture 8 45
Lecture 8 46
Options
Related tables
Select by attributes
Switch selection
Clear selection
Zoom to selected
Delete Selected
Table is Open
Lecture 8 47
No Table is Open
Selection-
>Select by
Attributes from
the Menu Bar
Lecture 8 48
A Spatial Query in SQL
SELECT city.name, city.geometry
FROM city, county
WHERE county.name=‘Penobscot’AND
city.geometry INSIDE county.geometry
city.population>30000;
Lecture 8 49
Spatial Selection
Lecture 8 50
Spatial Data
• Spatial data has a structure that does not
necessarily fit with tabular structure.
• To construct a spatial object requires
several table joins.
• Spatial indexing is very different from the
type of indexing used in a relational
database.
Lecture 8 51
Geometry
Point Curve Surface
LineString Polygon MultiSurface
Line LinearRing
MultiCurve
MultiPolygon MultiLineString
Composed
Type
Relationship
SpatialReferenceSystem
GeometryCollection
MultiPoint
Spatial Types – OGC Simple Features
Lecture 8 52
Standard GIS Data Model
Linked
spatial
and
attribute
(tabular)
data.
Lecture 8 53
File-based Data Models
• Coverages
– Developed for
workstation Arc/Info
~ 1980
– Complex structure,
proprietary format
– Attributes in Info
tables
• Shapefiles
– Developed for
ArcView ~ 1993
– Simpler structure in
public domain
– Attributes in dBase
(.dbf) tables
Geographic coordinates and attributes
are stored in separate but linked files
Arc
Info
Lecture 8 54
Storing Data
Coverages Shapefiles
Maine
Counties
MCD
Info
Maine
Counties.shp
Counties.shx
Counties.dbf
MCD.shp
MCDshx
MCD.dbf
Lecture 8 55
Coverages and Shapefiles
– Coverages are stored partially in their own folder and
partially in the common INFO folder.
– Shapefiles are stored in three to five files (with
extensions .shp, .shx, .dbf, .sbx and .sbn).
– Coverages store common boundaries between
polygons only once, to avoid redundancy.
– Shapefiles store all the geometry of each polygon
regardless of redundancy.
– Coverage features are single lines or single polygons.
– Shapefiles allow features to have multiple,
disconnected, intersecting and overlapping
components.
Lecture 8 56
Geodatabase Model
• Stores geographic coordinates as one attribute
(shape) in a relational database table
• Uses MS Access for “Personal Geodatabase”
(single user)
• Uses a file system for a “File Geodatabse”
(FGDB).
• Uses Oracle, Sybase, Ingress or other commercial
relational databases for “Enterprise
Geodatabases” (many simultaneous users)
Lecture 8 57
• There are some differences in queries between
shapefiles and geodatabases
– "STATE_NAME" LIKE 'Miss%' * in a geodatabase
– "OWNER_NAME" LIKE '_atherine smith' ?
– UPPER("LAST_NAME") = 'JONES'
– UCASE ("LAST_NAME") = 'JONES' geodatabase
– "POP2000" IS NULL
– "POP2000" IS NOT NULL
– "HOUSEHOLDS" > "MALES" * ("POP90_SQMI" + "AREA")
Lecture 8 58
The ArcGIS Geodatabase
Lecture 8 59
Key
Characteristics
ArcSDE File Geodatabase
Personal
Geodatabase
Number of Users Multiuser Single user & small
workgroups
Single userS
Storage Format Oracle
Microsoft SQL
Server
IBM DB2
IBM Informix
Each dataset is a
separate file
Microsoft Access
File
Versioning
Support
Supported Not supported Not supported
Database
Administration
Tools
Full DBMS
functions
File system
management
Windows file
system
management
Elements of a Geodatabase
Feature Dataset
Feature Class
Relationship Class
Geometric Network
Annotation Class
Object Class
Lecture 8 60
Elements of a Geodatabase
• Objects , Object Classes
• Features , Feature Classes
• Feature Datasets
• Validation Rules, Domains
• Relationships , Relationship Classes
• Spatial References
• Geometric Networks
Lecture 8 61
Objects and Object Classes
• An object is an instance of an object class
• All objects in an object class have the same
properties and behavior
• An object can be related to other objects via
relationships
Lecture 8 62
Attribute
Object
Object class
Feature
Feature class
Relationship
Relationship class
Network
Column, Field
Row
Table
Row with geometry column
Table with geometry column
Row with two foreign keys
Table with two foreign key columns
Tables linking elements to features
Relational view
Object view
Lecture 8 63
Features
• Spatial object
• Location
• Attribute of type Geometry
• Spatial relationships
• Instance of a feature class
Lecture 8 64
FeatureClasses
• Same type of geometry
• Same type of spatial reference system
• Store spatial objects (features)
Lecture 8 65
Feature Datasets
• Container
• Same spatial reference
• Analogous to a coverage
Lecture 8 66
Assignment
• Read Chapter 8
• Problems: 1, 2, 4, 5, 9, 10, 11, 12, 15
Lecture 8 67

Lecture-8-The-GIS-Database-Part-1.ppt

  • 1.
    The GIS Database Chapter8 – Part 1 Lecture 8 1
  • 2.
    Entity Bangor – Penobscot County, Maine, UnitedStates – Centroid - 44.801N , -6778W – Area 34.4 square miles – Elevation – 158 feet – Population 31,473 Lecture 8 2
  • 3.
    What is adatabase? A database is any organized collection of data. Some examples common examples: – a telephone book – T.V. Guide – airline reservation system – motor vehicle registration records – papers in your filing cabinet – files on your computer hard drive. Lecture 8 3
  • 4.
    Database Definitions What isa database? It’s an organized collection of data, it need not be a computer based system. What is a database management system (DBMS)? A software system designed to: – Organize that data in a flexible manner, – Provide tools to add, modify or delete data from the database, – Query the data, – Produce reports summarizing selected contents. Lecture 8 4
  • 5.
    What is theultimate purpose of a database management system? Data Information Knowledge Action Is to transform Lecture 8 5
  • 6.
    Features of aDBMS Database Management Systems provide features to maintain database: – Data independence - It refers to the immunity of user applications to make changes in the definition and organization of data. – Integrity and security - refers to maintaining and assuring the accuracy and consistency of data over its entire life-cycle Lecture 8 6
  • 7.
    Features of aDBMS Database Management Systems provide features to maintain database: – Transaction management - A transaction comprises a unit of work performed within a DBMS against a database, and treated in a coherent and reliable way independent of other transactions. Transactions in a database environment have two main purposes: • To provide isolation from other transactions. • To have an “all or nothing” effect. Transactions must pass the ACID test (atomic, consistent, isolated and durable Lecture 8 7
  • 8.
    Features of aDBMS Database Management Systems provide features to maintain database: – Concurrency control - ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible. – Backup and recovery – Provides a language for the creation and querying of the database. – A language for writing application programs Lecture 8 8
  • 9.
    Selecting a Database ManagementSystem Database management systems (or DBMSs) can be divided into two categories: – Desktop databases are oriented toward single-user applications and reside on standard personal computers (hence the term desktop). – Server databases contain mechanisms to ensure the reliability and consistency of data and are geared toward multi-user applications. Lecture 8 9
  • 10.
    Relational Databases • Therelational database model is the most dominant model in both the corporate and GIS world, due to its flexibility, organization, and functioning.. • It was defined by Edgar F. Codd (1970). • It can accommodate a wide range of data types. • It is not necessary to know beforehand the types of processing that will be performed on the database. Lecture 8 10
  • 11.
    Relational Database Terminology •Each table contains the data for a single entity. • Each instance of an entity is a row/record/tuple in the table. This is a specific instance of the entity. • Columns contain attributes/fields that describe the entity. – Attributes in a column must be from the same domain (text, integer, date). – An attribute may have a range (e.g.; 0 ≤ integers ≤ 100) – Column order has no significance. • Tables are related through keys. Lecture 8 11
  • 12.
    Attributes • An entityis represented by a set of attributes, that is descriptive properties possessed by all members of an entity set. Domain – the set of permitted values for each attribute • Attribute types: – Simple and composite attributes. – Single-valued and multi-valued attributes • E.g. multivalued attribute: phone-numbers – Derived attributes • Can be computed from other attributes • E.g. age, given date of birth Lecture 8 12
  • 13.
    Relational Database Terminology Lecture8 13 Record, row, tuple A specific instance of the entity Attribute, column Entity
  • 14.
    Keys • A superkey of an entity set is a set of one or more attributes whose values uniquely determine each entity. • A candidate key of an entity set is a minimal super key – Customer-id is candidate key of customer – account-number is candidate key of account • Although several candidate keys may exist, one of the candidate keys is selected to be the primary key. Lecture 8 14
  • 15.
    Super Key Lecture 815 ID, RollNumber, RegNo, Name, Place, Standard ID, RegNo, Name RegNo, Name, Place, Standard RollNunmber, Name Place ID, Place RegNo
  • 16.
    Candidate Keys Lecture 816 ID RollNumber RegNo
  • 17.
  • 18.
    Keys • A compositekey/concatenated is a key with more than one attribute. Lecture 8 18 http://ecomputernotes.com/images/Composite%20Key.jpg
  • 19.
    Keys • A foreignkey is an attribute that is a key of one or more relations other than the one in which it appears. Lecture 8 19
  • 20.
    Foreign Key Primary KeyForeign Key Primary Key Foreign Key Primary Key Foreign Key 20 Lecture 8
  • 21.
    Keys • Given theimportance of keys, there are usually some restrictions on them: e.g., null values are not allowed. • Keys are also used to index a database. – Too few keys may result in difficulty in searching and sorting the database. Lecture 8 21
  • 22.
    Physical Database Structure Thephysical design of the database specifies the physical configuration of the database on the storage media. – This includes detailed specification of data elements, data types, indexing options and other parameters residing in the DBMS data dictionary. – It is the detailed design of a system that includes modules & the database's hardware & software specifications of the system. Lecture 8 22 https://en.wikipedia.org/wiki/Database_design
  • 23.
    Logical Database Structure •Several logical data structures are used to express the relationships between individual data elements or records in a database. • Common logical data structures are hierarchical, network, and relational, with relational being predominant. Lecture 8 23
  • 24.
    Conceptual Structure • Theconceptual structure is often represented as a schema. • A schema describes the database structure in a shorthand notation. • One example is the entity-relationship (ER) diagram. Lecture 8 24
  • 25.
    Entity Relationship Diagram ENTITY RELATIONSHIP ATTRIBUTE Rectanglesrepresent entity sets. Diamonds represent relationship sets. Lines link attributes to entity sets and entity sets to relationship sets. Ellipses represent attributes Double ellipses represent multivalued attributes. Dashed ellipses denote derived attributes. Underline indicates primary key attributes. Lecture 8 25
  • 26.
    Entity Relationship Diagram StudentEnrolls In Courses ID Name Address Phone Major Advisor Credits GPA Number Name Credits Time Room Instructor Lecture 8 26
  • 27.
    Entity Relationship Model •The result is a diagram of all of the entities, their attributes, and the relationships between entities – Each entity becomes a table. • Student table • Course table – Each relationship (usually) becomes a table. • Enrolls, which allows you to join information from both tables. Lecture 8 27
  • 28.
    Types of Relationshipsbetween Entities • 1:1 – one faculty member is assigned to one office. • 1:M (M:1) – one faculty member teaches many courses. • M:N – many students take many courses. • All of these relationships can exist between attribute tables. Lecture 8 28
  • 29.
  • 30.
    Table Joins • Tablejoins depend on the data not the attribute name. • There are many different types of table joins. • Tables can be joined regardless of the relationship EXCEPT: – When joining to the feature attribute table in a GIS, the relationship must be 1:1 or M:1 – Other relationships must use the relate. Lecture 8 30
  • 31.
    One-to-One Join Employee-id Job 1Digislave 2 Useless Supervisor Employee-id name 1 Tom 2 John Join Employee-id to Employee-id After join Employee-id Job Name 1 Digislave Tom 2 Useless Supervisor John A join does not permanently alter the table structure Lecture 8 31
  • 32.
    Many-to-One Join Symbol Description QaQuaternary Alluvium Qe Quaternary Eolian Pa Permian Abo Polygon Id Symbol 1 Qa 2 Qa 3 Pa 4 Qe Polygon ID Symbol Description 1 Qa Quaternary Alluvium 2 Qa Quaternary Alluvium 3 Pa Permian Abo 4 Qe Quaternary Eolian After Join on Symbol Lecture 8 32
  • 33.
    Lecture 8 Relate ina GIS 33 https://courses.washington.edu/gis250/lessons/tables/images_av3/relate _table1.gif
  • 34.
    Relational Algebra • Codd’sspecification of a relational database relied on relational algebra. • Relational algebra takes tables/relations as inputs and returns tables as outputs. • The algebra combines or splits tables by rows or by columns to generate either a subset of tables or an expanded tables. Lecture 8 34
  • 35.
    Tables comprise thefundamental building blocks of any database. The table above contains the employee information for an organization -- characteristics like name, date of birth and title. Fundamental Building Blocks Lecture 8 35
  • 36.
    Relational Algebra • Fivebasic operators – select:  – project:  – union:  – difference: – – Cartesian product: x • The operators take one or two relations as inputs and produce a new relation as a result. Lecture 8 36
  • 37.
    Relational Algebra • DerivedRelational operators – Intersection  – Divide (not used very often) – Join • These can be expressed using different combinations of the fundamental operators. Lecture 8 37
  • 38.
    Select Operation –Example  Relation r A B C D         1 5 12 23 7 7 3 10  A=B ^ D > 5 (r) A B C D     1 23 7 10 Select from relation r where A=B AND D>5 Lecture 8 38
  • 39.
    Database Queries • Queriesmay be made of one table or several tables at the same time. • In many systems querying is facilitated by icons, or menus, or queries by example (QBE – a graphical query language ). Lecture 8 39
  • 40.
    Structured Query Language (SQL) •DDL – Data Definition Language; used to create and manage the database. • DDM – Data Manipulation Language; used to query the database. Lecture 8 40
  • 41.
    SQL • SQL: widelyused non-procedural language – E.g. find the name of the customer with customer-id 192-83- 7465 select customer.customer-name from customer where customer.customer-id = ‘192-83-7465’ • Application programs generally access databases through one of – Language extensions to allow embedded SQL – Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database Lecture 8 41
  • 42.
  • 43.
  • 44.
  • 45.
    The ArcGIS AttributeQuery Interface State’s Table is Open Lecture 8 45
  • 46.
  • 47.
    Options Related tables Select byattributes Switch selection Clear selection Zoom to selected Delete Selected Table is Open Lecture 8 47
  • 48.
    No Table isOpen Selection- >Select by Attributes from the Menu Bar Lecture 8 48
  • 49.
    A Spatial Queryin SQL SELECT city.name, city.geometry FROM city, county WHERE county.name=‘Penobscot’AND city.geometry INSIDE county.geometry city.population>30000; Lecture 8 49
  • 50.
  • 51.
    Spatial Data • Spatialdata has a structure that does not necessarily fit with tabular structure. • To construct a spatial object requires several table joins. • Spatial indexing is very different from the type of indexing used in a relational database. Lecture 8 51
  • 52.
    Geometry Point Curve Surface LineStringPolygon MultiSurface Line LinearRing MultiCurve MultiPolygon MultiLineString Composed Type Relationship SpatialReferenceSystem GeometryCollection MultiPoint Spatial Types – OGC Simple Features Lecture 8 52
  • 53.
    Standard GIS DataModel Linked spatial and attribute (tabular) data. Lecture 8 53
  • 54.
    File-based Data Models •Coverages – Developed for workstation Arc/Info ~ 1980 – Complex structure, proprietary format – Attributes in Info tables • Shapefiles – Developed for ArcView ~ 1993 – Simpler structure in public domain – Attributes in dBase (.dbf) tables Geographic coordinates and attributes are stored in separate but linked files Arc Info Lecture 8 54
  • 55.
  • 56.
    Coverages and Shapefiles –Coverages are stored partially in their own folder and partially in the common INFO folder. – Shapefiles are stored in three to five files (with extensions .shp, .shx, .dbf, .sbx and .sbn). – Coverages store common boundaries between polygons only once, to avoid redundancy. – Shapefiles store all the geometry of each polygon regardless of redundancy. – Coverage features are single lines or single polygons. – Shapefiles allow features to have multiple, disconnected, intersecting and overlapping components. Lecture 8 56
  • 57.
    Geodatabase Model • Storesgeographic coordinates as one attribute (shape) in a relational database table • Uses MS Access for “Personal Geodatabase” (single user) • Uses a file system for a “File Geodatabse” (FGDB). • Uses Oracle, Sybase, Ingress or other commercial relational databases for “Enterprise Geodatabases” (many simultaneous users) Lecture 8 57
  • 58.
    • There aresome differences in queries between shapefiles and geodatabases – "STATE_NAME" LIKE 'Miss%' * in a geodatabase – "OWNER_NAME" LIKE '_atherine smith' ? – UPPER("LAST_NAME") = 'JONES' – UCASE ("LAST_NAME") = 'JONES' geodatabase – "POP2000" IS NULL – "POP2000" IS NOT NULL – "HOUSEHOLDS" > "MALES" * ("POP90_SQMI" + "AREA") Lecture 8 58
  • 59.
    The ArcGIS Geodatabase Lecture8 59 Key Characteristics ArcSDE File Geodatabase Personal Geodatabase Number of Users Multiuser Single user & small workgroups Single userS Storage Format Oracle Microsoft SQL Server IBM DB2 IBM Informix Each dataset is a separate file Microsoft Access File Versioning Support Supported Not supported Not supported Database Administration Tools Full DBMS functions File system management Windows file system management
  • 60.
    Elements of aGeodatabase Feature Dataset Feature Class Relationship Class Geometric Network Annotation Class Object Class Lecture 8 60
  • 61.
    Elements of aGeodatabase • Objects , Object Classes • Features , Feature Classes • Feature Datasets • Validation Rules, Domains • Relationships , Relationship Classes • Spatial References • Geometric Networks Lecture 8 61
  • 62.
    Objects and ObjectClasses • An object is an instance of an object class • All objects in an object class have the same properties and behavior • An object can be related to other objects via relationships Lecture 8 62
  • 63.
    Attribute Object Object class Feature Feature class Relationship Relationshipclass Network Column, Field Row Table Row with geometry column Table with geometry column Row with two foreign keys Table with two foreign key columns Tables linking elements to features Relational view Object view Lecture 8 63
  • 64.
    Features • Spatial object •Location • Attribute of type Geometry • Spatial relationships • Instance of a feature class Lecture 8 64
  • 65.
    FeatureClasses • Same typeof geometry • Same type of spatial reference system • Store spatial objects (features) Lecture 8 65
  • 66.
    Feature Datasets • Container •Same spatial reference • Analogous to a coverage Lecture 8 66
  • 67.
    Assignment • Read Chapter8 • Problems: 1, 2, 4, 5, 9, 10, 11, 12, 15 Lecture 8 67