spatial concepts and data models

28
Spatial Concepts and Data Models Reading: Shekhar & Chawla Chapter 2 November 22, 2005

Upload: gabby

Post on 12-Jan-2016

80 views

Category:

Documents


0 download

DESCRIPTION

Spatial Concepts and Data Models. Reading: Shekhar & Chawla Chapter 2 November 22, 2005. Outlines. This chapter introduces spatial data model from Spatial ORDBMS perspectives Main concern is to define spatial data types and spatial operators in DBMS level - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Spatial Concepts  and Data Models

Spatial Concepts and Data Models

Reading: Shekhar & Chawla Chapter 2

November 22, 2005

Page 2: Spatial Concepts  and Data Models

Outlines

• This chapter introduces spatial data model from Spatial ORDBMS perspectives– Main concern is to define spatial data types and spatial

operators in DBMS level – You’re encouraged to compare this with GIS perspectives where

file-system is prevalent

• Models of spatial information– Object vs. field view define different spatial data types– Operations on different spatial data types

• Database design– Conceptual DB design tools can be extended to accommodate

into spatial concepts (consensus is still lacking in this regard)

Page 3: Spatial Concepts  and Data Models

Part I. Models of spatial information

Page 4: Spatial Concepts  and Data Models

Two common views• Object view

measures space– Forest stands are

seen as three polygon

• Field view measures attribute– Forest stands are

seen as mathematical function given spatial framework

Page 5: Spatial Concepts  and Data Models

Spatial object types in OGIS Data Model

http://www.opengis.org/techno/specs.htm

Page 6: Spatial Concepts  and Data Models

Exercise

Example Object OGIS Spatial Object Type

Dimension

City (in small scale map)

River

Country

Hawaiian islands

Bus route

Page 7: Spatial Concepts  and Data Models

Operations on spatial data type

• What are the examples of operations on different data type (e.g. string, number)?

• Let’s say you define spatial data type, then what kind of operations would you build in your SDBMS?

• Introducing the typology of operations on different spatial data types (field and object)…

Page 8: Spatial Concepts  and Data Models

Types of field operations

• Local: value of the new field at a given location in the spatial frame-work depends only on the value of the input field at that location (e.g. Thresholding)

• Focal: value of the resulting field at a given location depends on the values that the input field assumes in a small neighborhood of the location (e.g. Gradient)

• Zonal: Zonal operations are naturally associated with aggregate operators or the integration function. An operation that calculates the average height of the trees for each species is a zonal operation.

Worboy M, 1995, GIS: A Computing Perspectives

Page 9: Spatial Concepts  and Data Models

Exercise

• Classify following operations on elevation field– Identify peaks (points higher than its

neighbors)– Identify mountain ranges (elevation over 2000

feet)– Determine average elevation of a set of river

basins

Page 10: Spatial Concepts  and Data Models

Natural language that describes relationships between spatial objects

• The relationships between you (or your house) and UW campus can be described differently– I’m passing by U-Village in the left hand side– I live north of UW campus– My house is 4 miles from UW campus

• Can be seen as operations between point (you) and polygon (UW Campus)

• Q. Which of the above would you find it easier to identify?• Q. how our brain structures geographic space

– We are terrible in estimating distances, maybe only slightly better in retaining direction and orientation, but fairly good when it comes to remembering topological relationships (from the text p. 11)

• Q. Which of the above measures topological relationship?• Q. Which of the above reveals metric information?

Page 11: Spatial Concepts  and Data Models

Topology and metrics

• Topology– properties of geometric figures that are invariant

under continuous deformation (this kind of spatial relationship will remain the same after projection or transformation which is common in GIS)

– E.g. adjacency, containment, and overlap– Learned by humans at a very early age

• Metric– E.g. size, shape, distance, or direction– Refine, rather than define, spatial relations– Can be expressed either quantitative or qualitatively– E.g. 10 degree, NW, North of, Near

Mark DM, 1999, Spatial Representation: A Cognitive View. In Maguire, D. J., Goodchild, M. F., Rhind, D. W., and Longley, P. (editors) Geographical Information Systems: Principles and Applications, 2nd edition, v. 1, pp. 81-89.

Page 12: Spatial Concepts  and Data Models

Types of object operations

• Topological– Inside (point, region) – Touches (region, region)– Overlap (region, region)

• Metric– Euclidean-distance (point, point)– Direction (point, point)– Length (arc)– Area (region)

Page 13: Spatial Concepts  and Data Models

Egenhofer’s 9-intersection model

• Many spatial relations between objects are topological in nature

• Many spatial objects take the form of polygon (or region) at some level

• What is the topological relationship between polygon object A and polygon object B?

• Can we formalize them?

Page 14: Spatial Concepts  and Data Models

• Interior, boundary, exterior– Let A be an object in a “Universe” U.

Green is A interior

Red is boundary of A

Blue –(Green + Red) isA exterior

)( oA

)( A

)( AA

U

Page 15: Spatial Concepts  and Data Models

• 9 intersections – A and B are spatial objects in a two dimensional

plane.– intersections between interior, boundary, exterior of A,

B– Can be arranged as a 3 by 3 matrix– Matrix element take a value of 0 (false) or 1 (true).

Page 16: Spatial Concepts  and Data Models
Page 17: Spatial Concepts  and Data Models

• 9-intersection model can be supported in SQL3

• So you can do the following queries in SDBMS:SELECT Parcel.nameFROM Parcel, SoilUnitWHERE Within(Parcel.geo, SoilUnit.geo)AND SoilUnit.category = 4;

• Commercial SDBMS includes topological operators in their module– Oracle Spatial– Informix Spatial DataBlade

http://publibfp.boulder.ibm.com/epubs/pdf/9119.pdf

Page 18: Spatial Concepts  and Data Models

Part II. DB DesignExtending conceptual DB design tools with Spatial

Concepts

Page 19: Spatial Concepts  and Data Models

Example: ERD for State-park database

Spatial entity is represented with multi-valued attributes (e.g. Lineid, Pointid) Spatial attributes are simply treated as any other nonspatial attributes

Page 20: Spatial Concepts  and Data Models

Pictogram – spatial object type

• Basic shape

Page 21: Spatial Concepts  and Data Models

Pictogram – spatial object type

• Multishape example:– Hawaiian islands

Page 22: Spatial Concepts  and Data Models

Pictogram – spatial object type

• Derived shape example – City center point from boundary polygon– The shape of the US can be derived from the

US from the shapes of its state boundaries

Page 23: Spatial Concepts  and Data Models

Pictogram – spatial object type

• Alternate shape example: – A road is represented as a polygon for

construction or as a line for navigation– A river can be represented as a polygon or a

line depending on the scale (multiple representation)

Page 24: Spatial Concepts  and Data Models

ERD with pictogram

As spatial data type (point, line, polygon), and spatial operations (within, crosses) are defined, spatial semantics are captured better

Page 25: Spatial Concepts  and Data Models

UML with pictogram

Page 26: Spatial Concepts  and Data Models

Exercise

• Draw the ERD or UML of your project database with pictogram– Make sure to indicate specifics of spatial

object type that conform to OGIS spec.• (1) basic shape • (2) multishape if any• (3) derived shape if any• (4) alternate shape if any

Page 27: Spatial Concepts  and Data Models

Discussions

• As most of you use relational database, our ability to extend relational database to spatial concept is limited. In other words, you can’t define spatial data type or spatial functions (or operators)

• How would you store field value (e.g. elevation) in relational database?

• Can you link your table to raster image?• Can you write the SQL that returns the distance between

two points?• Can you write the SQL that returns whether point A is

within region B? Hint: can be done if spatial attribute is treated as

nonspatial attribute, also use derived attribute

Page 28: Spatial Concepts  and Data Models

P4

• Populate your database• Use Select * from tablename• Turn in the printout of results of select

statement (or capture images)• Indicate spatial data type of two spatial

entities using pictogram (hand-written) over your final ERD or UML

• Indicate spatial reference system of your database