Structured Query Language - glacier.utsc.utoronto.ca

Post on 27-Oct-2021

2 views 0 download

transcript

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)

Relational Databases Example

Relational Databases Example

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

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 …)

Spurious/Sliver Polygon Removal

Perimeter vs Area?

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:

Mathematical/Logical Operations for

Transformation of Attribute Data

Logical Operations

Venn Diagram vs Truth Table?

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 …)

Buffering (Simple Distance; Spatial)

Operations That Depend on

Connectivity

Manhatten Metric?

Routing?

Least cost routing (raster)?

Underserviced Areas

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

Spatial Filtering/Neighborhood Operations

Remote Sensing – High and Low Pass Filters

Digital Elevation Models

First and Higher Order Derivatives

Maximum Downward Gradient

Slope & Aspect

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

Surface Representation: 2D – DEM/Grid

Hill-Shading (shaded relief

require slope + aspect

calculation)

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)

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

Clumping; Dilation/Spreading

Also known as Cost-Distance analysis or

Least Cost Routing

Line of Sight Maps (Viewshed)

Shaded Relief

Map

Irradiance

Mapping

Attributes Computed From DEM’s

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

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