structured query language - glacier.utsc.utoronto.ca

27
Lecture 03 - Relational Databases Primary Key attribute value which allows users to uniquely identify a row in a table Secondary Key – attribute value which must also be used to uniquely identify a row in a table Tuples – occurrences of an entity (a row in a relational table) Foreign Key – an attribute (in a relation) that is a primary key in another relation SELECT <attribute(s)/field(s)> FROM <table(s)> WHERE <condition(s)> Structured Query Language SELECT [lucode] FROM [lumap] WHERE [area] > 100 and [location] INSIDE [orange county] CREATE DELETE INSERT ALTER UPDATE … (run first)

Upload: others

Post on 27-Oct-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Structured Query Language - glacier.utsc.utoronto.ca

Lecture 03 - Relational Databases

Primary Key – attribute value which allows users to uniquely identify a row

in a table

Secondary Key – attribute value which must also be used to uniquely identify

a row in a table

Tuples – occurrences of an entity (a row in a relational table)

Foreign Key – an attribute (in a relation) that is a primary key in another

relation

SELECT <attribute(s)/field(s)> FROM <table(s)> WHERE <condition(s)>

Structured Query Language

SELECT [lucode] FROM [lumap] WHERE [area] > 100 and [location] INSIDE

[orange county]

CREATE

DELETE

INSERT

ALTER

UPDATE …

(run first)

Page 2: Structured Query Language - glacier.utsc.utoronto.ca

Relational Databases Example

Page 3: Structured Query Language - glacier.utsc.utoronto.ca

Relational Databases Example

Page 4: Structured Query Language - glacier.utsc.utoronto.ca

Database Creation for Vector GIS

1) Input of spatial data

2) Input of attribute data

3) Linking of spatial and attribute data

Digitization? Polygon: Last Point = First Point

Page 5: Structured Query Language - glacier.utsc.utoronto.ca

Topology And Vector Operations

Planar Enforcement: area objects in one class or layer cannot overlap and must

exhaust the space of a layer (Topology – how objects relate to each

other)

Point In Polygon, Line On Polygon, Polygon On Polygon (Transfer Rules?)

(Subtract)

(Dissolve)

(Merge)

(Clip with …)

Page 6: Structured Query Language - glacier.utsc.utoronto.ca

Spurious/Sliver Polygon Removal

Perimeter vs Area?

Page 7: Structured Query Language - glacier.utsc.utoronto.ca

Classes of Operations for Spatial Analysis

Attribute Operations:

On one or more attributes of an entity

On one or more attributes of multiple entities that overlap in space

Distance/Location Operations:

Locate entities with respect to simple distance (Euclidian) or location

criteria

Creation of buffer zones around an entity

Spatial/Topological Relations:

Model spatial interactions over a connected net

Do objects overlay?

Manipulation of data - Simple to Complex

Discrete Entities & Continuous Data Distributions (differences?)

(i.e. Vector vs Raster?)

Analysis operations (for working with entities) include:

Page 8: Structured Query Language - glacier.utsc.utoronto.ca

Mathematical/Logical Operations for

Transformation of Attribute Data

Page 9: Structured Query Language - glacier.utsc.utoronto.ca

Logical Operations

Venn Diagram vs Truth Table?

Page 10: Structured Query Language - glacier.utsc.utoronto.ca

Simple/Complex Arithmetical

Operations

Statistical Analysis

Excel Formulas; SQL Functions; Active Columns; Field Calculator

Excel Formulas; SQL Functions; External software (Statistica, S-Plus, SPSS, etc …)

Page 11: Structured Query Language - glacier.utsc.utoronto.ca

Buffering (Simple Distance; Spatial)

Page 12: Structured Query Language - glacier.utsc.utoronto.ca

Operations That Depend on

Connectivity

Manhatten Metric?

Routing?

Least cost routing (raster)?

Underserviced Areas

Page 13: Structured Query Language - glacier.utsc.utoronto.ca

Spatial Analysis Using

Continuous FieldsSpatial operations include:

Interpolation Spatial Filtering

First and higher-order derivatives The derivation of surface topology:

Contiguity assessment (clumping) drainage networks and catchment delineating

Non-linear dilation Viewsheds, Shaded relief, irradiance

(spreading with friction)

Map Algebra

Neighborhood Operations

Page 14: Structured Query Language - glacier.utsc.utoronto.ca

Spatial Filtering/Neighborhood Operations

Remote Sensing – High and Low Pass Filters

Page 15: Structured Query Language - glacier.utsc.utoronto.ca

Digital Elevation Models

Page 16: Structured Query Language - glacier.utsc.utoronto.ca

First and Higher Order Derivatives

Maximum Downward Gradient

Page 17: Structured Query Language - glacier.utsc.utoronto.ca

Slope & Aspect

(Rate of change of slope) (Rate of change of aspect)

Page 18: Structured Query Language - glacier.utsc.utoronto.ca

Surface Representation: 2D – DEM/Grid

Hill-Shading (shaded relief

require slope + aspect

calculation)

Page 19: Structured Query Language - glacier.utsc.utoronto.ca

Drainage Networks

Derivation of surface topology (hydrologically corrected)

Allows calculation of drainage networks and streams, watersheds,

drainage divides/ridges (movement of erosional material and water flow)

Local drain direction (ldd)

Page 20: Structured Query Language - glacier.utsc.utoronto.ca

Drainage Networks Usage

Wetness Index Map (moisture content/retention)

Stream Power Index (erosive power)

Sediment Transport Index (erosion/deposition processes)

Stream Channels (how many cells feeding this one)

Ridges (Cells with no upstream elements – nothing feeding them)

Catchments/Watersheds

Hydrological and

Geomorphological

modelling

Page 21: Structured Query Language - glacier.utsc.utoronto.ca

Clumping; Dilation/Spreading

Also known as Cost-Distance analysis or

Least Cost Routing

Page 22: Structured Query Language - glacier.utsc.utoronto.ca

Line of Sight Maps (Viewshed)

Page 23: Structured Query Language - glacier.utsc.utoronto.ca

Shaded Relief

Map

Page 24: Structured Query Language - glacier.utsc.utoronto.ca

Irradiance

Mapping

Page 25: Structured Query Language - glacier.utsc.utoronto.ca

Attributes Computed From DEM’s

Page 26: Structured Query Language - glacier.utsc.utoronto.ca

Example – Specific GIS

Questions

Provided with a digital elevation model (DEM) and a table containing (x,y)

locations and zinc concentration (POINTS) outline the methods by which you

could determine those areas which have zinc concentration >100mg. Express

this as a percentage of the total area being examined.

Given a raster surface, LANDUSE and two vector drawings, PRECIP and

ROAD_BUFFER_200M, describe the methodology to determine those areas

with: an agricultural landuse; precipitation between 100 and 200mm; and

within 200m of a road. Use only vector operations.

A

B

Page 27: Structured Query Language - glacier.utsc.utoronto.ca

Example – Specific GIS Questions

You are hired as a consultant to do an initial search for possible sites on which to locate a

landfill. You have: basemaps for the area (which also include road types and water

courses); a vegetation map; a landuse map; a hazardous waste site map for the area; an

archeological site map for the area; a DEM.

Your restrictions on determining possible sites are as follows: the landfill site cannot be

within 500m of a water course/body, wetland/marsh, existing waste site or archeological

site. The population density must be less than 1 person per square kilometre. It cannot be

located on prime agricultural land. It must be located within 300m of a paved two or four

lane highway/road. The area must be relatively flat (less than 5 degree slope). The area

must be larger than 200 hectares.

Your final image must show all areas which fall within the imposed restrictions.

C