gisc 6382 applied gis ut-dallas briggs 1 the geodatabase

62
GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

Upload: benedict-barber

Post on 19-Dec-2015

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs1

The Geodatabase

Page 2: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs2

Geodatabase Fundamentals

• Spatial data formats

• Geodatabase data structure

• Personal vs. enterprise geodatabase

• Components of geodatabase

• Building geodatabase

Page 3: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs3

Geographic Feature Data Formats

• Formats are based on representations (models) of the real world that can be placed in a GIS to produce maps, perform interactive queries, and execute analyses.

– CAD – first computer mapping model/format.

• Binary file format with little attribute information.

– Coverage – native ArcInfo 7 format.

• Based on Georelational data model.

• Vector data is maintained in indexed binary files and partitioned from, but linked to attribute tables by a common identifier.

• Topological relationships are maintained.

• Shortcomings – features aggregated into collections of points, lines & polygons with generic behavior. The behavior of a line representing a road is the same as the behavior of a line representing a stream.

Page 4: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs4

Geographic Feature Data Formats

• Shapefile – introduced with ArcView

– Also georelational data model – nontopological vector data format.

– Very prolific format – much GIS data in Shapefile format.

– Simpler than coverage because they do not store topological associations among different features and feature classes.

– Limited analysis capabilities due to lack of topology

• Geodatabase – introduced in ArcInfo 8.

– Object-oriented model – can characterize features more naturally by defining object types, topological, spatial and general relationships, and interactions.

– Geodatabase features can be stored in a single database.

– Create custom features in addition to points, lines, polygons

– Brings physical model closer to logical model.

Page 5: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs5

Supported Data Types

• ArcInfo 8 supports four representations of geographic data.

– Vector data for representing features.

– Raster data for images, grids, and surfaces.

– Triangulated irregular networks (TINS) for surfaces.

– Tabular data.

• Locators and addresses for finding a geographic position from an address.

• Locators apply national postal conventions to convert an address to a position.

– Note: in AI8.1, geodatabases do NOT store TINS. They must be kept in coverage workspaces.

Page 6: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs6

What is a Geodatabase?

• A new type of geographic data format (GDF) for ArcInfo 8.

• Based on Object-Oriented Model

• Users can add behavior, properties, rules and relationships to data

• Implemented as extension to standard relational database technology

• Supports topologically integrated feature classes

• Extends the coverage model with support for complex networks, relationships among feature classes, and other object-oriented features

• Provides platform for development of custom data models using visual tools like CASE (Computer Aided Software Engineering) tools and UML (Unified Modeling Language) notation

Page 7: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs7

ArcCatalog Is the Principal User Interface Used to Define

and Manage the Geodatabase

Page 8: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs8

Geodatabase Framework

O ra c le 8 i S Q L S e rver In fo rm ix D B 2 O th e rs

A rcS D E G e od a tab a se

M S A cce ss

P e rso n a l G e o da tab a se

G e og ra ph ica lly E n h an ced D a ta ba ses in A rc In fo 8A rcC a ta log

A rcM ap

ArcCatalog

ArcMap

Page 9: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs9

Personal (single-user) Geodatabase

• Personal Geodatabase.

– Implemented as a Microsoft Access database (*.mdb file) by using MS jet engine which is installed with AI8. MS access is not needed.

– Can be placed on local or network drives.

– Generally used for personal or small work-group use.

– Can handle small to moderately sized datasets.

– Personal geodatabase can yield decent performance for datasets of 250,000 objects or less, maximum size is 2.0 GB

– Full functionality of geodatabase served through ArcSDE except versioning.

• Versioning – allows many editors to work concurrently and includes framework to resolve edit conflicts.

– If a personal geodatabase is deleted its gone.

Page 10: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs10

Enterprise (Multi-user) Geodatabase

• ArcSDE Geodatabase– ArcSDE is the multi-user data access extension to ArcInfo (bundled

w/software) that serves geodatabases to AI applications running on pc’s on TCP/IP network.

– Used for demanding datasets requiring concurrent editing by multiple users.

– Created by installing a DBMS and ArcSDE on a server.– ArcCatalog only creates and deletes connections to ArcSDE

geodatabases.– Can be deployed on UNIX or Windows NT.

• Many use UNIX platform for ArcSDE and DBMS and NT for AI applications

– ArcSDE is centrally tuned and managed by a DBA.– Can build SQL applications to access tables in a remote geodatabase.

Page 11: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs11

Geodatabase Elements

• Objects & Object classes

• Features & Feature classes

• Feature datasets

• Spatial references

• Domains

• Subtypes

• Relationships & Relationship classes

• Geometric networks

• Labels and Annotation

Page 12: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs12

Objects & Object Classes

• Geodatabases organize geographic data into a hierarchy of data objects.

• Objects are instances of an object class that have properties and behavior.

• Objects can be related to other objects via relationships

• Objects have unique system identifiers (OID)

• Object classes are tables in a geodatabase storing non-spatial data (e.g., Parcel owners)

• Objects in an object class have the same

– Properties - stored in the table as attributes

– Behavior - implemented as a component

Page 13: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs13

Object Classes (tables)

A r

ow s

tore

s an

Obj

ect

Pump Table

OID Pump Type Inlet Size …….

175 Axial Flow 24” …….

… ………… ………… …….

Page 14: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs14

Features and Feature Classes

• Features are objects with required shape (Points, Multi-points, Lines & Polygons) that represent a real world object in a layer on a map.

• Features classes are collections of features with same type of feature geometry and attributes.

• A feature class is also an object class which stores spatial objects (features) (e.g., Parcels).

• All the features in a feature class are in the same spatial reference.

• Feature classes which store topological features must be contained within a feature dataset to ensure a common spatial reference.

Page 15: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs15

Feature ClassesA

row

sto

res

feat

ure

Feature Class Table

Lateral Water Lines

OID Shape Type …….

583 X,Y,Z,M

(BLOB)

Domestic …….

… ………… ………… …….

BLOB: Binary Large Object Block

Page 16: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs16

Feature Datasets

• Containers for feature classes

• Shared spatial reference

• Analogous to a coverage

– less restrictive

• May also contain

– relationship classes

– geometric networks

– Annotations

Page 17: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs17

Building a Geodatabase

• Building a geodatabase– Designing the geodatabase

• (Think before your create)

– Creating a new geodatabase • (Name and location only)

– Defining the geodatabase structure • (Schema and data)

– Entering spatial data • (Loading or automation)

– Define additional properties • (Validataion, relationships, networks)

Design geodatabase

Create a newgeodatabase

Defining GDBstructure

Entering spatial data

Define additionalproperties

Geodatabase

Page 18: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs18

Designing a Geodatabase

• Conceptual Plan: Current and future needs– Data contents– Coordinate system– Data validation and modification rules– Relationships among objects– Custom objects

• Logical Design– Can use CASE tools

• What needs to store (Not how to store)• UML Use Case

– Microsoft Visio Enterprise Edition

Microsoft Visio Enterprise Version

Page 19: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs19

Creating a New Geodatabase

• Create a new geodatabase using ArcCatalog– Create new– Rename default name

Page 20: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs20

Defining Geodatabase Structure

• Create from scratch manually.– Use tools in ArcCatalog to create schema

• Importing existing database schema– Can convert by importing schema from

existing datasets

• Use CASE tools and UML to automate database creation.– Can use CASE tools to create new

custom objects and/or generate a geodatabase schema from UML

• CASE (Computer Aided Software Engineering)

• UML (Unified Modeling Language)

Page 21: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs21

Create schema from scratch manually

• Define structure using ArcCatalog– Feature datasets

– Feature classes

– Tables

– Relationship classes

• What to Define?– Database name

– Field name and properties

– Spatial reference

– Table relationship parameters

Page 22: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs22

Importing existing database schema

• Import data and/or database schema– Shape files, coverage,

features class – INFO, dBase tables

• Options while importing– Rename object– Rename or exclude attribute

columns– Modify spatial reference– Insert feature class into

feature dataset

Page 23: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs23

Use CASE tools and UML to define database structure

• Physical Design using UML– Feature class, relationship class,

subtype and/or domain schema

– Design large database with visualization and documentation of data relationship and attributes

• Edit ESRI Object Model diagram– Create customize objects inherited

from ESRI objects (ArcObjects)

– Export structure to Microsoft Repository, then to ArcCatalog

• Visual Basic with GIS Applications (Visual Basic + MapObjects), Substitute Computer Techniques

• GIS Application Software Development (ArcObjects + UML)

Page 24: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs24

Entering Spatial Data

• Spatial data automation options– Analog data: digitizing or scanning– Arc/Info formats: importing and loading – Other digital data: data conversion

• Data Mapping– Vector geometry types (p. 81)

• X, Y: Points, multipoints, lines, polygons• Z: Optional position in Z (e.g. elevation)• M: Optional linear measurement (e.g. milepost)

– Field mapping (p. 82)

• Spatial Reference

Page 25: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs25

Importing Vs. Loading

• Importing– Creates new features within a new feature class or

geodatabase table. • The features class or table cannot exist before importing

– Database schema is imported at the same time

• Loading– Appends features into an existing feature class. – Existing feature class have the same schema with the

data sources• Simple Data Loader (ArcCatalog)• Object Loader Wizard (ArcMap)

Page 26: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs26

Defining additional database properties

• Leveraging geodatabase advantages– Add validation rules: subtype and domain– Define relationships between tables– Create topological structure (Geometric

network)– Create annotation

Page 27: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs27

Spatial Reference

• Spatial Reference– Coordinate system– Spatial domain– Precision

• Cautions– All feature classes within a feature

dataset share the same spatial reference.

– Once created, the spatial domain for feature dataset/class cannot be changed.

– Data outside extent of dataset need to be created in a new feature dataset or standalone feature class.

Page 28: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs28

Coordinate system

• Projection system & parameters– Geographic, UTM and State plane– Datum, central Meridian, standard

parallels, false northing and easting

• Define Coordinate system for feature dataset/classes– Select: a predefined coordinate

system– Import: from existing geodatabase– Create: a new coordinate system– Modify: current coordinate system– Save: for future use

Page 29: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs29

Spatial Domain

• Spatial Domain– The allowable coordinate range for the geographic

coordinates– X/Y Domain:

• MinX, MaxX, MinY, MaxY

– Z Domain: • Min, Max

– M Domain: • Min, Max

Page 30: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs30

Precision

• Precision– The number of system units per one unit of measure

(of distance). Precision determines the resolution of a map (geodatabase)

– For example: map unit is meter• Precision of 1: 1 system unit = 1 meter (resolution)

• Precision of 1000: 1000 systems units = 1 meter– 1 systems unit = 0.001 meter = 1 millimeter (resolution)

– E.g. Map unit feet, Precision of 12, Resolution?

12 system units = 1 foot 1 system unit = 1/12 foot = 1 inch (resolution)

Page 31: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs31

Determine Precision Based on Map Resolution

• Formula: – Resolution = Map unit / precision– Precision = Map unit / resolution

• Determine precision of a new geodatabase– Digitizing table resolution is 0.002 inches,

map scales is 1:10,000, map unit is meter

Geodatabase resolution = 0.002 inches * 10,000 = 20 inches 20 inches = 20 /39.37 meters = .508 meter ~ 0.5 meter Precision = 1 meter / 0.5 meter = 2

Page 32: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs32

Geodatabase Storage and Precision• Coverage/Shapefile storage:

– Single floating point precision (6-7 digits)

– Double floating point precision (13-14 digits)

• Geodatabase storage– As Integer: 4 byte integer– Stores 2.14 billion system units

• max = 2,147,483,648

• Coordinate are– Multiplied by precision when

stored– Divided by precision when used

Map units (Use) Floating Point123.456 (m)

System units (Store) Integer

123,456

Multiply by precision123.456*1000

Divide by precision123,456/1000

Page 33: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs33

Check Geodatabase Precision with Range

• Range in Map Unit (RangeMU)– Larger of width or height

• Width = MaxX –MinX• Height= MaxY – MinY

– Example• 1,000,000 – 200,000 = 800,000

(Width) RangeMU• 4,060,000 – 3,750,000 = 310,000

(Height)

• Range in system unit (RangeSU)– RangeSU = RangeMU * Precision– RangeSU = 800,000 * 1000 =

800,000,000 < 2.14 billion

• Is OK to accept 1000 as precision?

2 billion

4 billion

2 billion

200,000,000 mm x3,750,000,000 mm y

Page 34: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs34

Re-center Coordinates using shift

• Problem: – At desire precision, data is outside extent

• Solution– Shift the center of geodatabase space to the center of the data– Shift = the difference between the center of your data and

GDBCenterMU• Formula:

– Center of geodatabase space in map units (GDBCenterMU)• (2,147,483,648/2)/precision = (2,147,483,648/2)/1000=1,073,741.824

– Center of your data• (DataMinX + DataMaxX)/2 and (DataMinY + DataMaxY)/2

– Shift• ShiftX = (DataMinX + DataMaxX)/2 – GDBCenterMU• ShiftY= (DataMinY + DataMaxY)/2 – GDBCenterMU

– Update (MinX, MinY) with (ShiftX, ShiftY)

Page 35: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs35

Geodatabase Storage and Shift• The geodatabase will

– Subtract shift, then multiply coordinate by precision when stored

– Divide coordinates by precision, then add shift when used

Map units (Use) Floating Point

3,000,000.456 (m)

System units (Store) Integer

1,000,000,456

Subtract shift(3,000,000.456 – 2,000,000)

Add shift1,000,000.456 + 2,000,000

Multiply by precision1,000,000.456*1000

Divide by precision1,000,000,456/10002 billion

4 billion

2 billion

200,000,000 mm x3,750,000,000 mm y

Page 36: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs36

Subtype and Attribute Domain

• Subtype

• Attribute domain– Rang domain– Coded value domain

• Associating domain with subtype

• Attribute validation rules– Split and merge domain policies

Page 37: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs37

Why Subtypes and Attribute Domains

• Data Integrity– Prevent illegal attribute assignment to features, tables with out-of-range

data values– For certain critical field, provide predefined codes as the only valid values

• Data Efficiency– Associate different subset of a feature class with different default values,

attribute validation rules– Allow efficient choice from a set of valid value descriptions rather than

manually input the value itself

Streets

Primary

ST, RD, AV, BLVD

Secondary

Ln, Cir,Pl

PowerPoles

Wood

20-30

Steel

30-50

Page 38: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs38

Subtype

• Subtype– Feature class’ “subclasses” that allow you to further

distinguish objects without creating new feature classes– Logical groups of a subset of records within a feature

class based on single column’s values– Same subtype has similar attribute values and behaviors

• Create Subtype– Can choose default subtype– Require integer values (long/short), user adds descriptions– Can have different default values and domains for each

field to improve data efficiency

Page 39: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs39

Creating Subtypes

• Define subtypes using ArcCatalog

– For feature class or table properties

1. Select column to create subtype

2. Enter subtype code and description

3. Enter default values and domains for each subtype

4. Set default subtype

1

2

3

4

Page 40: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs40

Display and Edit Subtypes in ArcMap• Displaying

– Subtype can have unique classification

– Subtype descriptions are listed in TOC

– Symbols can be modified as desired

• Adding new features– Use Editor Target list to add

feature with chosen subtype

• Editing existing features/records– Can apply subtype after data entry– Subtype fields shows description,

not code– Changing the subtype updates the

default values for other fields

Page 41: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs41

Domain

• Define a set of legal values for a field’s attributes– Range: specifies a valid range of values for a numerical attributes

• A water pipe must be between 1 and 100 inches wide

– Coded value: specifies a valid set of values for an attributes. Can apply to any type of attributes

• Parcels can only have RES or VAC land use values

• Validation methods– Pulldown list of descriptions (coded values) prevents error– Validation during edit session prevents range error

• A geodatabase property– Can apply to entire field or individual field subtype– Multiple objects in the same database may use the same domain– Cannot edit domain referenced by another subtype

Page 42: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs42

Creating Range Domains1. Click on existing or

blank domain2. Enter the name and

description for the domain

3. Enter the domain prosperities

– Field type– Domain type: Range– Minimum value– Maximum value– Split policy– Merge policy

1

2

3

Page 43: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs43

Creating Coded Value Domains

1. Click on existing or blank domain

2. Enter the name and description for the domain

3. Enter the domain prosperities

– Field type– Domain type: Coded

Values– Split policy– Merge policy

4. Enter the coded values• Code• Description

1

2

3

4

Page 44: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs44

Associating domains to entire fields• Provide validation for

records within a specified field– Domain must be

defined as same field type

Diameter_L is floatOnly float domain appear

Page 45: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs45

Associating domains to subtype• Provide validation for

records within subtype– Domain must be

defined as same field type

Subtype field grouped into four codes

Each code has its own domain for other attributes

Page 46: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs46

Editing records that have coded value domains

• ArcMap only shows valid domain description– View codes in table by changing the appearance of

the table

Page 47: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs47

Editing records that have range domains

• Perform edit in ArcMap• Validate selection verifies fields

with a range domain– Invalid features remain selected

Angle has a range domain of 0 -359

Page 48: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs48

Split Domain policies

• Split policies on edited feature’s attributeOwner Zoning Value

M. Murad R-4 36000

Owner Zoning Value

M. Murad R-0 24000

M. Murad R-0 12000

Split Policy duplicatedefault value

geometric

ratio

Page 49: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs49

Merge Domain policies

• Merge policies on edited feature’s attribute

District Yield %harvested

California 69000 43

District Yield %harvested

Glenwood 24000 35

Lakeview 45000 47

Merge Policydefault value

sumvalues

weightedaverage

Page 50: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs50

Table Association and Table Join• Table association

– Attributes about a feature can be stored• Feature class table (Feature class)• Separate table (Object class)

– Associate tables with common column (key) values• Primary keys: Common field on original table• Foreign keys: Common field on destination table

• Table join– Merge two tables together into one table logically or physically (in ArcMap).

Page 51: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs51

Relationship and Relationship Class

• Relationship– Persistent and Dynamic association between objects in the

geodatabase• Change to origin table can been seen when the destination access the

relationship.• The relationship exist unless deleted. No merging of two tables

– Common field with same data type• Between non-spatial objects (rows in tables)• Between spatial objects (features in feature classes) • Between spatial and non-spatial objects

– Non relationship based on BLOB fields• No relationship based on location

• Relationship class– A geodatabase relationship is stored in relationship classes. It is save

as a record (row) in a relationship table.

Page 52: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs52

Geodatabase Relationship

• Characteristics of relationship– Persisted relationship in the geodatabase– Can enforce dependent behavior– Can edit, query, and symbolized across relationship– Can only relate tables within the same geodatabase– Do not support access to stacked relationships

• If A B, BC; then A can not access C unless AC

Origin

Destination

Page 53: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs53

Creating Relationship Classes• Relationship properties

– Relationship name

– Origin and destination tables

– Relationship type • Simple or composite

– From-to, to-from labels

– Messaging direction

– Cardinality (1-1, 1-M, M-N)

– Foreign key, primary key

Page 54: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs54

Table Relationship Cardinality

• Cardinality– Defines how many A objects are related to B objects– Influence relationship properties and uses

• 1-1 (one-to-one) • 1-M (one-to-many) • M-N (many to many)

One parcel has one owner

One parcel has many owners

Many parcels have many owners

Page 55: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs55

Relationship Type

• Simple – Peer-to-peer relationship that are between two or more objects that

exist independently of each other

– Delete origin objects, related objects in destinations table continuous to exist – FK value is deleted

– Can have one-to-one, one-to-may, or many-to-many cardinality

• Composite– The life time of one object controls the lifetime of its related

objects

– Destination objects cannot exist without origin object

– Can only have one-to-one, and one-to-many cardinality.

Page 56: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs56

Keys, Path Labels and Messaging Notification

• From origin to destination based on common field– Primary Key (PK): On origin (Parcels)– Foreign Key (FK): On destination (Owners)

• Path labels– Forward (From-to): To navigate the relationship from the origin

table to the destination table. (E.g. Is owned by)– Backward (To-from): To navigate the relationship from the

destination table to the origin table. (E.g. owns)

• Messaging Notification– Direction to propagate standard message between related objects– Used to trigger behavior (e.g. cascade move, custom)

• Origin to destination, destination to origin, both, none

Page 57: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs57

Relationship Rules and Validation• Property set after creating the relationship class

– Controls which object subtypes from origin class can be related to which object subtypes in destination class

– Also the valid cardinality range for all permissible subtype pairs.

• Cardinality (1-1, M-1, M-n) does determine or control the actual quantity (and types) of related records

• Validate Selection check for attribute violation– After validation, all invalid records remain selected

Page 58: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs58

Open Related Table in ArcMap

1. Add origin table, destination table, or both

– Table appears in Table of Contents Source tab

2. Open table3. Use Options > Related Tables

Page 59: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs59

Querying related tables• Query records from first table using Option> Select Attribute…

• Click Options>Relationship> Path Label name to refresh related table

• Selected records highlighted in related table, regardless of messaging

Page 60: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs60

Symbolizing and labeling with related fields

• Properties Fields tabRelated Fields

Page 61: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs61

Displaying and editing related records

• Classification based related fields appears in the Table of contents

• Fields in related table appear in Attribute dialog

Page 62: GISC 6382 Applied GIS UT-Dallas Briggs 1 The Geodatabase

GISC 6382 Applied GIS UT-Dallas Briggs62

Reading

• MacDonald, Chapter 1, 3, 4, 5

• Zeiler, Chapter 1-5