Download geographic objects

Document related concepts

Dual space wikipedia , lookup

Line (geometry) wikipedia , lookup

Space wikipedia , lookup

Four-dimensional space wikipedia , lookup

Transcript
Spatial Databases: Lecture 2
DT249-4 DT228-4 Semester 2
2009-10
Pat Browne
http://www.comp.dit.ie/pbrowne/Spatial%20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm
Outline
 Based on Chapter 2 of Spatial Databases:
With Application to GIS by Philippe
Rigaux, Michel Scholl, and Agnès Voisard
 We look briefly at conceptual models but
focus on logical models that represent
spatial objects.
 The logical models covered are
 Basic vector for objects
 Spaghetti, network and topological
Definitions
 Conceptual Modelling is independent of
implementation. Consists of representations of
objects and their relationships. Can be
represented using Entity Relationship Diagrams
(ERD) or the Unified Modelling Language
(UML). Example: the object Dublin of the class
city is the capital of the Republic of Ireland which
is of the class country. Later in the course will
use Protégé to study conceptual models.
Definitions: Conceptual Model
 At the conceptual level, the focus is on the
data types of the application, their
relationships, and their constraints. The
actual implementation details are left out
at this step of the design process. Plain
text combined with simple but consistent
graphic notation is often used to express
the conceptual data model.
Definitions: Conceptual Model
 The Entity Relationship (ER) model is one of the
most widely used conceptual design tools, but it
has long been recognized that it is difficult to
capture spatial semantics with ER diagrams.
The first difficulty lies with geometric attributes,
which are complex, and the second difficulty lies
with spatial relationships. Several researchers
have proposed extensions to the existing
modelling languages to support spatial data
modelling. The pictogram-enhanced ER (PEER)
model
Definitions: Conceptual Model
Definitions
 In graph theory, a planar graph1 is a graph
that can be drawn so that no edges
intersect (or that can be embedded) in the
plane. A nonplanar graph cannot be drawn
in the plane without edge intersections.
Definitions(*)
 A theme can be represented as a class in
Object Orientation (OO) or a relation (or
table) in database theory. A theme has a
class and instances. Examples: rivers,
cities, counties.
 Themes can be combined to produce a
map. The map usually focuses on the
themes and locations of interest for a
given application.
Definitions(*)
 A theme is a collection of geographic objects. A
geographic object which corresponds to a real
world object has two components:
 A description, attributes
 A spatial component, geometry
 We are interested in the software representation
of geographic objects which can be represented
at various levels of abstraction (e.g. realityconcept-code).
Notation
 Tuple [] : ordered object different types
 List <> : ordered objects of the same type
 Sets {} : unordered objects of same type.
 Or | : may have alternative composition
or definition.
Definitions(*)
 Atomic geographic object: e.g. county
 Complex geographic object: e.g. province
which consists of counties, forming a
spatial hierarchy.
 Theme = {geographic-object}
 Geographic-object =
{ <description, spatial-part> |
<description, {geographic-object}>}
A geographic object
© Worboys and Duckham (2004) GIS: A Computing Perspective, Second Edition, CRC Press
Definitions
 A theme is a set of homogeneous geographic
objects, which have the same structure and
type. A theme is a particular abstraction of space
with a single ‘type’ of object in mind. Examples
include rivers, road, & cities, where each theme
could have its own schema in a relation system,
or its own class in an object oriented system. For
example, we could have a city table or class
consisting of name, population, & geometry.
Definitions
 A theme is represented in the GIS logical model
, which is also known as a geographical model.
 A spatial data model represents the geometry
and topology of spatial objects. It represents
concepts (themes and schemas) which are
realised as instances (object level).
 Instances (extension) should satisfy the spatial
theory (intension).
 “GIS software is an implementation of formal
theories of geographic space” [Bittner and
Frank]1. An implementation can be considered
as a model of a theory.
Representations of spatial objects
Logical Models
 To model the spatial component of a geographic
objects we need:
 geometric information (coordinates)
 topological information (connectedness1)
 We will look at
 Euclidean Space2, represented as coordinates in 2,
called the embedding or search space.
 Object based models, entity or features.
 Field based models, tessellation.
 Half-plane representation
 Realms
 Generalized maps (n-GMAPs)
Geographic Space: Object Model
 A geographic object has:
 1 ) Identity
 2) description, a set of attributes
 3) spatial component, coords+topology
 A spatial object represents a single conceptual object
e.g. a house.
 Different user groups are interested in different spatial
objects e.g. geologists, administrators.
 Each group are interested in different interpretations of
space. They define an appropriate set of themes1 that
reflect their interpretation.
Geographic Space: Object Model
 Types of spatial object classified by dimension:
 1 ) Zero-dimensional objects or points
 2) One dimensional linear objects.
 3) Two dimensional surface objects.
 Lets call this the object’s geometry.
 An object may have more than one geometry
e.g. depending on scale a city could be
represented by a point or polygon (the DBMS
could hold both representations).
Geographic Space: 0-D objects
 We use zero-dimensional objects or points
when we are primarily interested in
representing location rather than shape.
Geographic Space: 1-D objects
 We use one-dimensional linear objects
when we are primarily interested in
representing networks or polygons with
polylines.
 A polyline is a finite set of line segments
(edges) such that the endpoints (vertex) is
shared by exactly two segments except for
the end points (extreme points) which
belong to only one segment.
Geographic Space: 1-D objects
 A polyline may be closed if its two extreme
points are identical.
 A simple polyline has no pairs of nonconsecutive edges intersect at any point
 A polyline P may be monotone with respect to a
line L if every line L’ orthogonal to L meets P at
one point at most . The monotone property
captures the intuitive idea of ‘simple shape’ and
is important for query algorithms.
Geographic Space: 1-D objects
Extreme point
vertex
vertex
Line segment
Extreme point
Polyline
Non-simple polyline
Simple closed polyline
Geographic Space: 1-D objects
L
P
Monotone polyline
Non-monotone polyline
Geographic Space: 2-D objects
 Two dimensional (2-D) or surface objects are
often used to represent land parcels,
administrative regions. It is usually possible to
compute are area for 2-d objects. 2-D objects
have a boundary.
 A polygon is simple if its boundary is a simple
polyline.
 A P polygon is convex if for any pair of points A,
B in P the line segment is fully in P.
Convex Polygons
 Convexity is an important concept & will
be used later in the course to study
predicates and operations. Intuitively all
points in a convex polygon are inter-visible
and the inter-visibility relation is transitive.
This is not the case for non-convex
polygons.
Non-Convex Polygons
B
A
In a non-convex polygon
inter-visibility is not
transitive. A & B are
visible from each other,
B & C are visible from
each other, but C is not
visible from A.
C
Geographic Space: 2-D objects
 A P polygon is monotone if its boundary
δP can be split into exactly two monotone
polylines MC1 and MC2. The monotonicity is
usually expressed with respect to the axis
(X and Y)
 A 2-D object need not be connected, we
can have a country that includes islands. A
region is defined as a set of polygons.
Geographic Space: 2-D objects
Simple
polygon
Non-simple
polygon
Geographic Space: 2-D objects
Convex
polygon
Monotone polygon with
respect to the X axis
Geographic Space: 2-D objects
Polygon
with hole
Region or set of
polygons
Choice of geometry
 The choice 0,1, or 2-D objects depends on
the application. An airport could be viewed
as a set polygons by a passenger
navigating between airport buildings, but
as a vertex on a set of edges representing
that passengers overall route.
 Do we need to store all possible
representations?
 Can they be derived from each other?
Approximation of the world
 Linear and surface objects are defined in
terms of line segments (or edges), which
only approximate the real world object.
The larger number of line segments the
better the approximation is, there is often
a trade-off between faithful
approximation and an efficient
representation.
Approximation of the world
 The true length of a geographic line is
usually longer than the length of its
stored polyline or polygon
representation
Representation Modes
 We need to represent an infinite point set of
continuous Euclidean Space with the finite
discrete space of a computer.
 Tessellation Mode1: Approximates the
continuous space by a discrete space e.g. raster
maps represent a tessellation of the earths
surface.
 Vector Mode: Constructing appropriate data
structures, e.g. using coordinates to represent
line segments.
Representation Modes
 For example, in tessellation mode a city is
represented as a set of non-overlapping cells
that cover the city’s interior. In vector mode the
city is represented as a list of points describing
the boundary polygon.
 Tessellation can be regular or irregular.
 We must distinguish between the tessellation of
space and the ‘display’ of a map as raster image
of an underlying vector data structure.
Tessellation can be regular or
irregular
Various regular tessellations made up of one or more regular objects
Two irregular triangular
tessellations based on the
same vertex set.
Raster Map
Most maps are displayed as raster even though the underlying
representation is vector.
Vector Map
The small rectangles represent the centers of suburban regions e.g. Castleknock
Approx. Objects in tessellation
Mode
 The notation <>
represents an ordered
list. Each cell is
represented on the list by
a number counting from
the top left.
 <24,25,…,47,55,56>
 We will not cover
tessellation mode which
includes raster data.
32
24
25
26
27
33
34
35
36
37
43
44
45
46
47
54
55
38
Notation
 Tuple [] : ordered object different types
 List <> : ordered objects of the same type
 Sets {} : unordered objects of same type.
 Or | : may be composed in more than one
way. This may be interpreted as exclusiveor
Vector Mode
 There are many ways to represent spatial
objects using the points, line segments,
and polygons. We start with a simple
representation and note its limitations.
Vector Mode: Simple
Representation
 A polyline is represented by a list of points
<p1,…pn>.
 <pi,pi+1> for i<n, represents an edge
 A polygon is also a list of points with edge
<pn,p1> which ensures that the polygon
is closed.
 A region is a set of polygons
Vector Mode: Simple
Representation
 This simple representation can be denoted
as follows




point : [x:real, y:real]
polyline: <point>
polygon: <point>
region: {polygon}
Vector Mode: Simple
Representation
 Has 2n possible representations.
 Various constraints not enforced:
 No structural distinction between polyline and
polygon. Hence programs must handle
differences.
 No rules regarding convexity
 No rules for simple polygon
 No rules for regions, polygons can be
adjacent, overlapping, or disconnected.
Vector Mode: Simple
Representation
<[4,4],[6,1],[3,0],[0,2],[2,2]> using coordinate notation
[4,4]
[0,2]
[2,2]
[6,1]
[3,0]
Vector Mode: Simple
Representation
L1 = <1,2,3> vertex notation
L2 = <4,5,6,7,8,9,10,11,12>
9
11
L2
L1
10
2
5
8
12
7
1
3
4
6
Vector Mode: Simple
Representation
Definition of polyline does not cover a single vertex acting as endpoint
for three edges, hence we represent L3 as a set of polylines
L3 = {<13,14,19>,<15,16,19>,17,18,19>}
L3
14
13
19
16
15
17
18
Vector Mode: Simple
Representation
Region one consisting of adjacent P2 and P3
{<5,6,12,10,11>,<6,7,8,9,10,12>}
2
1
P1
4
5
3
7
6
11
P4
P3
P2
8
13
12
10
14
15
9
16
Vector Mode: Summary of Simple
Representation
 Vector mode more compact than raster.
 There is a trade-off between the power of
representation and the complexity of the
structure used to represent spatial objects.
 The simple vector representation fails to
represent and enforce constraints, which
are necessary to ensure the correct
semantics and integrity of the data.
Vector Mode: Summary of Simple
Representation
 Given the simple representation there is
no way to distinguish




A simple polygon from a non-simple one
A convex polygon from a non-convex polygon
A polygon from a polyline
A set of adjacent polygons from a set of
disjoint intersecting polygons
Representing collections of objects.
Logical Models
 Collections of spatial objects will have
interesting spatial relationships.
 Topological relationships include
adjacency, overlapping, distjointness, and
inclusion.
 The explicit representation of such
relationships provides more knowledge
and increases the usefulness of the data.
Spaghetti Model (*)
 The simplest vector data model is the spaghetti
model. It is a line for line translation of the paper
map (see next slide). Only the basic connectivity
is explicitly represented. A polygon is stored as a
list of co-ordinates, shared boundaries of
adjacent polygons being stored twice. Spatial
relationships must be derived through
computation. Unstructured geometry, presenting
a visual representation of the geometric data,
contains a minimum of information.
Spaghetti Model (*)
Spaghetti Model(*)
 The Spaghetti Model can be denoted as
follows




point : [x:real, y:real]
polyline: <point>
polygon: <point>
region: {polygon}
Spaghetti Model(*)
 Only basic connectivity.
 Boundaries represented twice.
 Lines may cross without explicit
intersection.
 Has advantage of simplicity.
 Topology or connectivity must be
computed each time that it is required. It is
not stored in model.
Network Model(*)
 Designed to represent network for
navigation and route planning.
 Based on the mathematics of Graph
Theory.
 Topological relationships between points
and polylines are stored.
Network Model
 The Network Model can be denoted as





point : [x:real, y:real]
node: [ point, <arc>]
arc: [node-start,node-end, <point>]
polygon: <point>
region: {polygon}
Network Example: Water
Facility Data Types
House
Main
Meter
Lateral
Pump
Fitting
Valve
Hydrant
Pump
House
Street
Along with the Network Model there
is much additional information. There
are geographic objects.
Network Example: Water
Facility Data Types
Main
Meter
Lateral
Pump
Fitting
Valve
Hydrant
Along with the Network Model there
is much additional information. There
are geographic objects.
Topological Model(*)
 Topological network induces planar
subdivisions into adjacent polygons some
of which are constructive and do not
correspond to actual geographic objects.
The triangles provide a
uniformity of representation,
they do not necessarily
correspond to real world entities.
Topological Model(*)
 Topological Model can be denoted as
 point : [x:real, y:real]
 node: [ point, <arc>]
 arc: [node-start,node-end, left-ply,
right-poly <point>]
 polygon: <arc>
 region: {polygon}
Topological Model(*)
c
b
N2
d
P2
P1
f
a
e
N1
[3,0]
Polygon P1: <a, b, f>
Polygon P2: <c,d,e,f>
Arc f:[N1,N2,P1,P2,<>]
Node N1:[[3,0],<a,f,e>]
Topological Model(*)
 Advantages:
 Geometry is shared not duplicated.
 Data model represents adjacent
polygons, hence they do not have to be
computed on demand.
 Facilitates consistent update, only one
copy of boundary to update.
 Can facilitate networking and routing.
Topological Model(*)
 Disadvantages:
 More complex than Spaghetti model,
may slow down processing.
 Some of the structural information may
have no semantics in the real world.
 Addition of new objects requires the precomputation of part of the planer graph.
Georelational data model of
Arc/Info1
The coordinate and attributive values are stored separately. The basic objects of
the model are the geometric ones: the points, lines and polygons. The
coordinates of each object with a unique identification number are stored in
binary files. The attributive values and the description of topology are stored in
RDBMS tables, originally in INFO tables. The records are linked to the geometry
by the identification numbers.
Summary of Spatial Representation
 Two modes : tessellation and vector. Vector mode is the
main focus of this course.
 Classifying objects by dimension, 0-D,1-D, 2-D.
 Modelling single spatial objects:
 Simple vector representation of single objects.
 Modelling Collections of objects
 Spaghetti Model for collection of objects
 Network model for connected networks
 Topological model includes polygon adjacency and shared
geometry.
 We must distinguish between topology and geometry.
Summary of Spatial Representation
 Two modes : tessellation and vector. Vector
mode is the main focus of this course.
 Classifying objects by dimension, 0-D,1-D, 2-D.
 Modelling single spatial objects:
 Simple vector representation of single objects.
 Modelling Collections of objects
 Spaghetti Model for collection of objects
 Network model for connected networks
 Topological model includes polygon adjacency and
shared geometry.