Intro to GIS Winter 2011 Geodatabases
DATABASES
What is a Database? A database is an integrated set of data on a particular area and subject Databases form the basis of all GIS vector analysis and decision-making Databases must be structured and indexed to provide good query performance
Database Management Systems (DBMS) Relational (RDBMS) Object (ODBMS) Object Relational (ORDMS)
Relational Database (RDBMS) A relational database comprises of a set of related tables tied together by a common attribute value Each table is a list of records containing attributes about objects
Object (ODBMS) & Object-Relational (ORDBMS) Designed to address the weaknesses of RDBMS such as Geometry and attribute data are stored in separate databases Poor performance for many types of geographic query ODBMS can provide object-oriented storage and query tools Geographic extensions to standard RDBMS can provide similar functionality
Data Structure record: a row in a geographic database; represents one feature (a.k.a. tuple, row ) attribute: a column in a geographic database; each attribute: a column in a geographic database; each record contains one attribute value (a.k.a. field, column )
Principles of a RDBMS One value in each cell at the intersection of a row and a column All values in a column are about the same subject (and have the same type of number) Each row is unique Each column has a unique name (13 characters) There is no significance to the sequence of columns There is no significance to the sequence of rows
What is a Geographic Database? contain one or more tables with a geographic component (a shape attribute)
ESRI Geodatabase Features have: Shapes Spatial Reference Attribute Subtypes Features can be: Constrained (domains) Validated by Rules Complex behavior Relationships
ESRI Geodatabase
Types of Geodatabases Personal File Single-user Microsoft Access Up to 2GB storage Single-user ArcSDE Multi-User, supports versioning Oracle, Microsoft SQL Server, IBM DB2, IBM Informix, PostgreSQL Storage limit based on DB File folder structure Up to 1TB storage ESRI Comparison of Geodatabases
Default Geodatabase stores all datasets in one convenient location set a database for each project helps with data management add datasets and save resulting datasets
JOINING & RELATING TABLES
Joins & Relates Allows GIS user to map attributes that may not be present in the original table Join: appending the fields of one table to those of another through an attribute or field common to both tables Relate: an operation that establishes a temporary connection between records in two tables using a key common to both
Spatial Join: a type of table join operation in which fields from one layer's attribute table are appended to another layer's attribute table based on the relative locations of the features in the two layers
Joins & Relates when to use a join: relationship between tables is oneto-one, or many-to-one when to use a relate: relationship between tables is one-to-many
One-to-One Many-to-One
Joins & ArcGIS Non-spatial data can be added into ArcGIS in.dbf or.xls format Common fields must match exactly Example: Multnomah County and Multnomah County NOT: Multnomah County and Multnomah Joins are temporary To make permanent, export data to a new shapefile
Working in Excel No hidden spaces in the cells Column is formatted correctly - text if a text field, numerical if a number field, etc. No column (field) names are longer than 13 characters, have no spaces or symbols
DATABASE QUERIES
Attribute-Based Queries Selects records in a GIS database or table based on values of one or more attributes SQL: structured query language
Spatial Query Selects features based on location or spatial relationship with other GIS data (i.e., intersects, contains, within, etc.)
Joins, Relates & Queries ArcGIS Demo