Download Spatial Concepts and Data Models

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Database wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Clusterpoint wikipedia , lookup

Functional Database Model wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
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
– 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)
Part I. Models of spatial information
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
Spatial object types in OGIS Data Model
http://www.opengis.org/techno/specs.htm
Exercise
Example Object
City (in small scale map)
River
Country
Hawaiian islands
Bus route
OGIS Spatial Object
Type
Dimension
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)…
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
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
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?
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.
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)
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?
• Interior, boundary, exterior
– Let A be an object in a “Universe” U.
U
A
Green is A interior
( Ao )
Red is boundary of A (A)
Blue –(Green + Red) is

(
A
)
A exterior
• 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).
• 9-intersection model can be supported in SQL3
• So you can do the following queries in SDBMS:
SELECT Parcel.name
FROM Parcel, SoilUnit
WHERE 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
Part II. DB Design
Extending conceptual DB design tools with Spatial
Concepts
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
Pictogram – spatial object type
• Basic shape
Pictogram – spatial object type
• Multishape example:
– Hawaiian islands
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
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)
ERD with pictogram
As spatial data type (point, line, polygon), and spatial operations (within, crosses)
are defined, spatial semantics are captured better
UML with pictogram
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
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
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