spatial databases: lecture 2 dt249-4 dt228-4 semester 2 2009-10 pat browne...

66
Spatial Databases: Spatial Databases: Lecture 2 Lecture 2 DT249-4 DT228-4 DT249-4 DT228-4 Semester 2 Semester 2 2009-10 2009-10 Pat Browne Pat Browne //www.comp.dit.ie/pbrowne/Spatial%20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005

Upload: russell-williamson

Post on 18-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Spatial Databases: Lecture 2Spatial Databases: Lecture 2DT249-4 DT228-4 DT249-4 DT228-4 Semester 2 Semester 2

2009-102009-10

Pat BrownePat Browne

http://www.comp.dit.ie/pbrowne/Spatial%20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Page 2: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

OutlineOutline

Based on Chapter 2 of Based on Chapter 2 of Spatial Databases: Spatial Databases: With Application to GIS by Philippe With Application to GIS by Philippe Rigaux, Michel Scholl, and Agnès Voisard Rigaux, Michel Scholl, and Agnès Voisard

We look briefly at We look briefly at conceptual modelsconceptual models but but focus on focus on logical modelslogical models that represent that represent spatial objects.spatial objects.

The logical models covered areThe logical models covered are Basic vector for objectsBasic vector for objects Spaghetti, network and topologicalSpaghetti, network and topological

Page 3: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

DefinitionsDefinitions

Conceptual ModellingConceptual Modelling is independent of is independent of implementation. Consists of representations of implementation. Consists of representations of objects and their relationships. Can be objects and their relationships. Can be represented using Entity Relationship Diagrams represented using Entity Relationship Diagrams (ERD) or the Unified Modelling Language (UML). (ERD) or the Unified Modelling Language (UML). Example: the object Dublin of the class city is Example: the object Dublin of the class city is the capital of the Republic of Ireland which is of the capital of the Republic of Ireland which is of the class country. Later in the course will use the class country. Later in the course will use Protégé to study conceptual models.Protégé to study conceptual models.

Page 4: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions: Conceptual ModelDefinitions: 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.

Page 5: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions: Conceptual ModelDefinitions: 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

Page 6: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions: Conceptual ModelDefinitions: Conceptual Model

Page 7: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

DefinitionsDefinitions

IIn graph theory, a n graph theory, a planar graphplanar graph11 is a is a graph that can be drawn so that no edges graph that can be drawn so that no edges intersect (or that can be embedded) in the intersect (or that can be embedded) in the plane. A nonplanar graph cannot be drawn plane. A nonplanar graph cannot be drawn in the plane without edge intersections.in the plane without edge intersections.

Page 8: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions(*)Definitions(*)

A A themetheme can be represented as a class in can be represented as a class in Object Orientation (OO) or a relation (or Object Orientation (OO) or a relation (or table) in database theory. A theme has a table) in database theory. A theme has a class and instances. Examples: rivers, class and instances. Examples: rivers, cities, counties.cities, counties.

Themes can be combined to produce a Themes can be combined to produce a mapmap. The map usually focuses on the . The map usually focuses on the themes and locations of interest for a themes and locations of interest for a given application.given application.

Page 9: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions(*)Definitions(*)

A theme is a collection of A theme is a collection of geographic objectsgeographic objects. A . A geographic object which geographic object which correspondscorresponds to a real to a real world object has two components:world object has two components: A description, attributesA description, attributes A spatial component, geometryA spatial component, geometry

We are interested in the software representation We are interested in the software representation of of geographic objectsgeographic objects which can be represented which can be represented at various at various levels of abstractionlevels of abstraction (e.g. reality- (e.g. reality-concept-code). concept-code).

Page 10: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

NotationNotation

Tuple [] : ordered object different typesTuple [] : ordered object different types List <> : ordered objects of the same typeList <> : ordered objects of the same type Sets {} : unordered objects of same type.Sets {} : unordered objects of same type. Or | : may have alternative composition Or | : may have alternative composition

or definition.or definition.

Page 11: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions(*)Definitions(*)

Atomic geographicAtomic geographic object: e.g. county object: e.g. county Complex geographicComplex geographic object: e.g. province object: e.g. province

which consists of counties, forming a which consists of counties, forming a spatial hierarchy.spatial hierarchy.

Theme = {geographic-object}Theme = {geographic-object} Geographic-object =Geographic-object =

{ <description, spatial-part> | { <description, spatial-part> |

<description, {geographic-object}>}<description, {geographic-object}>}

Page 12: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

A geographic objectA geographic object

© Worboys and Duckham (2004) GIS: A Computing Perspective, Second Edition, CRC Press

Page 13: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Definitions Definitions

A theme is a set of A theme is a set of homogeneoushomogeneous geographic geographic objects, which have the same structure and objects, which have the same structure and type. A theme is a particular abstraction of type. A theme is a particular abstraction of space with a single ‘type’ of object in mind. space with a single ‘type’ of object in mind. Examples include rivers, road, & cities, where Examples include rivers, road, & cities, where each theme could have its own schema in a each theme could have its own schema in a relation system, or its own class in an object relation system, or its own class in an object oriented system. For example, we could have a oriented system. For example, we could have a city table or class consisting of name, city table or class consisting of name, population, & geometry.population, & geometry.

Page 14: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

DefinitionsDefinitions

A theme is represented in the GIS A theme is represented in the GIS logical model logical model , , which is also known as a which is also known as a geographical model.geographical model.

A spatial data model represents the geometry A spatial data model represents the geometry and topology of spatial objects. It represents and topology of spatial objects. It represents concepts (themes and schemas) which are concepts (themes and schemas) which are realised as instances (object level).realised as instances (object level).

Instances (extension) should satisfy the spatial Instances (extension) should satisfy the spatial theory (intension).theory (intension).

““GIS software is an implementation of formal GIS software is an implementation of formal theories of geographic spacetheories of geographic space” [Bittner and ” [Bittner and Frank]Frank]11. An implementation can be considered as . An implementation can be considered as a model of a theory.a model of a theory.

Page 15: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Representations of spatial objectsRepresentations of spatial objectsLogical ModelsLogical Models

To model the spatial component of a To model the spatial component of a geographic objects we need:geographic objects we need: geometric information (coordinates) geometric information (coordinates) topological information (connectednesstopological information (connectedness11) )

We will look at We will look at Euclidean SpaceEuclidean Space22, represented as coordinates in , represented as coordinates in 22, ,

called the called the embeddingembedding or or searchsearch space. space. Object based models, entity or features.Object based models, entity or features. Field based models, tessellation.Field based models, tessellation. Half-plane representationHalf-plane representation RealmsRealms Generalized maps (n-GMAPs)Generalized maps (n-GMAPs)

Page 16: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: Object ModelGeographic Space: Object Model

A geographic object has:A geographic object has: 1 ) Identity1 ) Identity 2) description, a set of attributes2) description, a set of attributes 3) spatial component, coords+topology3) spatial component, coords+topology

A spatial object represents a single conceptual object A spatial object represents a single conceptual object e.g. a house.e.g. a house.

Different user groups are interested in different spatial Different user groups are interested in different spatial objects e.g. geologists, administrators.objects e.g. geologists, administrators.

Each group are interested in different interpretations of Each group are interested in different interpretations of space. They define an appropriate set of space. They define an appropriate set of themesthemes11 that that reflect their interpretation.reflect their interpretation.

Page 17: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: Object ModelGeographic Space: Object Model

Types of spatial object classified by dimension:Types of spatial object classified by dimension: 1 ) Zero-dimensional objects or points1 ) Zero-dimensional objects or points 2) One dimensional linear objects.2) One dimensional linear objects. 3) Two dimensional surface objects.3) Two dimensional surface objects.

Lets call this the object’s Lets call this the object’s geometrygeometry.. An object may have more than one geometry An object may have more than one geometry

e.g. depending on scale a city could be e.g. depending on scale a city could be represented by a point or polygon (the DBMS represented by a point or polygon (the DBMS could hold both representations).could hold both representations).

Page 18: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 0-D objectsGeographic Space: 0-D objects

We use zero-dimensional objects or points We use zero-dimensional objects or points when we are primarily interested in when we are primarily interested in representing location rather than shape.representing location rather than shape.

Page 19: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 1-D objectsGeographic Space: 1-D objects

We use one-dimensional linear objects We use one-dimensional linear objects when we are primarily interested in when we are primarily interested in representing networks or polygons with representing networks or polygons with polylinespolylines..

A polyline is a finite set of line segments A polyline is a finite set of line segments (edges) such that the endpoints (vertex) is (edges) such that the endpoints (vertex) is shared by exactly two segments except for shared by exactly two segments except for the end points (extreme points) which the end points (extreme points) which belong to only one segment. belong to only one segment.

Page 20: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 1-D objectsGeographic Space: 1-D objects

A polyline may be A polyline may be closedclosed if its two extreme if its two extreme points are identical.points are identical.

A A simple polylinesimple polyline has no pairs of non- has no pairs of non-consecutive edges intersect at any pointconsecutive edges intersect at any point

A polyline A polyline PP may be may be monotonemonotone with respect to a with respect to a line line LL if every line if every line L’L’ orthogonal to orthogonal to LL meets meets P P at at one point at most . The monotone property one point at most . The monotone property captures the intuitive idea of ‘simple shape’ and captures the intuitive idea of ‘simple shape’ and is important for query algorithms. is important for query algorithms.

Page 21: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Extreme point vertex

vertex

Extreme point

Polyline

Geographic Space: 1-D objectsGeographic Space: 1-D objects

Line segment

Non-simple polyline Simple closed polyline

Page 22: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

L

P

Monotone polylineNon-monotone polyline

Geographic Space: 1-D objectsGeographic Space: 1-D objects

Page 23: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 2-D objectsGeographic Space: 2-D objects

Two dimensional (2-D) or surface objects are Two dimensional (2-D) or surface objects are often used to represent land parcels, often used to represent land parcels, administrative regions. It is usually possible to administrative regions. It is usually possible to compute are area for 2-d objects. 2-D objects compute are area for 2-d objects. 2-D objects have a have a boundaryboundary..

A polygon is A polygon is simplesimple if its boundary is a simple if its boundary is a simple polyline.polyline.

A A PP polygon is polygon is convexconvex if for any pair of points if for any pair of points AA, , BB in in PP the line segment is fully in the line segment is fully in PP..

Page 24: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Convex PolygonsConvex Polygons

Convexity is an important concept & will Convexity is an important concept & will be used later in the course to study be used later in the course to study predicates and operations. Intuitively all predicates and operations. Intuitively all points in a convex polygon are inter-visible points in a convex polygon are inter-visible and the inter-visibility relation is transitive. and the inter-visibility relation is transitive. This is not the case for non-convex This is not the case for non-convex polygons.polygons.

Page 25: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Non-Convex PolygonsNon-Convex Polygons

A

C

B

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.

Page 26: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 2-D objectsGeographic Space: 2-D objects

A A PP polygon is polygon is monotonemonotone if its boundary if its boundary δδPP can be split into exactly two monotone can be split into exactly two monotone polylines polylines MCMC11 and and MCMC22. The monotonicity is . The monotonicity is

usually expressed with respect to the axis usually expressed with respect to the axis ((X X and and YY))

A 2-D object need not be connected, we A 2-D object need not be connected, we can have a country that includes islands. A can have a country that includes islands. A regionregion is defined as a set of polygons. is defined as a set of polygons.

Page 27: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 2-D objectsGeographic Space: 2-D objects

Simple polygon

Non-simple polygon

Page 28: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 2-D objectsGeographic Space: 2-D objects

Convex polygon

Monotone polygon with respect to the X axis

Page 29: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Geographic Space: 2-D objectsGeographic Space: 2-D objects

Polygon with hole

Region or set of polygons

Page 30: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Choice of geometryChoice of geometry

The choice 0,1, or 2-D objects depends on The choice 0,1, or 2-D objects depends on the application. An airport could be viewed the application. An airport could be viewed as a set polygons by a passenger as a set polygons by a passenger navigating between airport buildings, but navigating between airport buildings, but as a vertex on a set of edges representing as a vertex on a set of edges representing that passengers overall route. that passengers overall route.

Do we need to store all possible Do we need to store all possible representations?representations?

Can they be derived from each other?Can they be derived from each other?

Page 31: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Approximation of the worldApproximation of the world

Linear and surface objects are defined in Linear and surface objects are defined in terms of line segments (or edges), which terms of line segments (or edges), which only approximate the real world object. only approximate the real world object. The larger number of line segments the The larger number of line segments the better the approximation is, there is often better the approximation is, there is often a trade-off between faithful a trade-off between faithful approximation and an approximation and an efficientefficient representation. representation.

Page 32: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Approximation of the worldApproximation of the world

The true length of a geographic line is The true length of a geographic line is usually longer than the length of its usually longer than the length of its stored polyline or polygon stored polyline or polygon representationrepresentation

Page 33: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Representation ModesRepresentation Modes

We need to represent an infinite point set of We need to represent an infinite point set of continuous Euclidean Space with the finite continuous Euclidean Space with the finite discrete space of a computer.discrete space of a computer.

Tessellation ModeTessellation Mode11: Approximates the : Approximates the continuous space by a discrete space e.g. raster continuous space by a discrete space e.g. raster maps represent a tessellation of the earths maps represent a tessellation of the earths surface.surface.

Vector ModeVector Mode: Constructing appropriate data : Constructing appropriate data structures, e.g. using coordinates to represent structures, e.g. using coordinates to represent line segments.line segments.

Page 34: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Representation ModesRepresentation Modes

For example, in tessellation mode a city is For example, in tessellation mode a city is represented as a set of non-overlapping cells represented as a set of non-overlapping cells that cover the city’s interior. In vector mode the that cover the city’s interior. In vector mode the city is represented as a list of points describing city is represented as a list of points describing the boundary polygon.the boundary polygon.

Tessellation can be regular or irregular.Tessellation can be regular or irregular. We must distinguish between the tessellation of We must distinguish between the tessellation of

space and the ‘display’ of a map as raster image space and the ‘display’ of a map as raster image of an underlying vector data structure.of an underlying vector data structure.

Page 35: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Tessellation can be regular or Tessellation can be regular or irregularirregular

Two irregular triangular tessellations based on the same vertex set.

Various regular tessellations made up of one or more regular objects

Page 36: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Raster MapRaster Map

Most maps are displayed as raster even though the underlying representation is vector.

Page 37: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector MapVector Map

The small rectangles represent the centers of suburban regions e.g. Castleknock

Page 38: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Approx. Objects in tessellation Approx. Objects in tessellation ModeMode

The notation <> The notation <> represents an ordered represents an ordered list. Each cell is list. Each cell is represented on the list by represented on the list by a number counting from a number counting from the top left.the top left.

<24,25,…,47,55,56><24,25,…,47,55,56> We will not cover We will not cover

tessellation mode which tessellation mode which includes raster data.includes raster data.

2424 2525 2626 2727

3232 3333 3434 3535 3636 3737 3838

4343 4444 4545 4646 4747

5454 5555

Page 39: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

NotationNotation

Tuple [] : ordered object different typesTuple [] : ordered object different types List <> : ordered objects of the same typeList <> : ordered objects of the same type Sets {} : unordered objects of same type.Sets {} : unordered objects of same type. Or | : may be composed in more than one Or | : may be composed in more than one

way. This may be interpreted as exclusive-way. This may be interpreted as exclusive-or or

Page 40: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector ModeVector Mode

There are many ways to represent spatial There are many ways to represent spatial objects using the points, line segments, objects using the points, line segments, and polygons. We start with a simple and polygons. We start with a simple representation and note its limitations.representation and note its limitations.

Page 41: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

A polyline is represented by a list of points A polyline is represented by a list of points <p<p11,…p,…pnn>>. .

<p<pii,p,pi+1i+1>> for for i<n i<n, represents an edge, represents an edge

A polygon is also a list of points with edge A polygon is also a list of points with edge <p<pnn,p,p11> > which ensures that the polygon which ensures that the polygon

is closed.is closed. A region is a set of polygons A region is a set of polygons

Page 42: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

This simple representation can be denoted This simple representation can be denoted as followsas follows point : point : [x:real, y:real][x:real, y:real] polyline: polyline: <point><point> polygon: polygon: <point><point> region: region: {polygon}{polygon}

Page 43: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

Has Has 2n2n possible representations. possible representations. Various constraints not enforced:Various constraints not enforced:

No No structuralstructural distinction between polyline and distinction between polyline and polygon. Hence programs must handle polygon. Hence programs must handle differences. differences.

No rules regarding convexityNo rules regarding convexity No rules for simple polygonNo rules for simple polygon No rules for regions, polygons can be No rules for regions, polygons can be

adjacent, overlapping, or disconnected.adjacent, overlapping, or disconnected.

Page 44: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

[4,4]

[2,2]

[3,0]

[0,2]

[6,1]

<[4,4],[6,1],[3,0],[0,2],[2,2]> using coordinate notation

Page 45: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

3

L1 = <1,2,3> vertex notation

L2 = <4,5,6,7,8,9,10,11,12>

2

1

L1

L2

4

5

6

8

7

9

10

11

12

Page 46: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

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

1413

17

16

15

18

19

Page 47: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

10

Vector Mode: Simple Vector Mode: Simple RepresentationRepresentation

Region one consisting of adjacent P2 and P3

{<5,6,12,10,11>,<6,7,8,9,10,12>}

15 12

11

6 7

9

514

16

13 8P2 P3

P4

P1

2

4

1

3

Page 48: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Summary of Simple Vector Mode: Summary of Simple RepresentationRepresentation

Vector mode more compact than raster.Vector mode more compact than raster. There is a trade-off between the There is a trade-off between the power of power of

representationrepresentation and the and the complexity of the complexity of the structurestructure used to represent spatial objects. used to represent spatial objects.

The simple vector representation fails to The simple vector representation fails to represent and enforce constraints, which represent and enforce constraints, which are necessary to ensure the correct are necessary to ensure the correct semantics and integrity of the data.semantics and integrity of the data.

Page 49: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Vector Mode: Summary of Simple Vector Mode: Summary of Simple Representation Representation

Given the simple representation there is Given the simple representation there is no way to distinguish no way to distinguish A simple polygon from a non-simple oneA simple polygon from a non-simple one A convex polygon from a non-convex polygonA convex polygon from a non-convex polygon A polygon from a polylineA polygon from a polyline A set of adjacent polygons from a set of A set of adjacent polygons from a set of

disjoint intersecting polygonsdisjoint intersecting polygons

Page 50: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Representing collections of objects.Representing collections of objects.Logical ModelsLogical Models

Collections of spatial objects will have Collections of spatial objects will have interesting interesting spatial relationshipsspatial relationships..

Topological relationships include Topological relationships include adjacency, overlapping, distjointness, and adjacency, overlapping, distjointness, and inclusion.inclusion.

The explicit representation of such The explicit representation of such relationships provides more knowledge relationships provides more knowledge and increases the usefulness of the data.and increases the usefulness of the data.

Page 51: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Spaghetti ModelSpaghetti Model (*) (*)

The simplest vector data model is the The simplest vector data model is the spaghetti spaghetti modelmodel. It is a line for line translation of the paper . It is a line for line translation of the paper map (see next slide). Only the basic connectivity map (see next slide). Only the basic connectivity is explicitly represented. A polygon is stored as is explicitly represented. A polygon is stored as a list of co-ordinates, shared boundaries of a list of co-ordinates, shared boundaries of adjacent polygons being stored twice. Spatial adjacent polygons being stored twice. Spatial relationships must be derived through relationships must be derived through computation. Unstructured geometry, presenting computation. Unstructured geometry, presenting a visual representation of the geometric data, a visual representation of the geometric data, contains a minimum of information.contains a minimum of information.

Page 52: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Spaghetti ModelSpaghetti Model (*) (*)

Page 53: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Spaghetti Model(*)Spaghetti Model(*)

The Spaghetti Model can be denoted as The Spaghetti Model can be denoted as followsfollows point : point : [x:real, y:real][x:real, y:real] polyline: polyline: <point><point> polygon: polygon: <point><point> region: region: {polygon}{polygon}

Page 54: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Spaghetti Model(*)Spaghetti Model(*)

Only basic connectivity.Only basic connectivity. Boundaries represented twice.Boundaries represented twice. Lines may cross without explicit Lines may cross without explicit

intersection.intersection. Has advantage of simplicity.Has advantage of simplicity. Topology or connectivity must be Topology or connectivity must be

computed each time that it is required. It is computed each time that it is required. It is not stored in model.not stored in model.

Page 55: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Network Model(*)Network Model(*)

Designed to represent network for Designed to represent network for navigation and route planning. navigation and route planning.

Based on the mathematics of Graph Based on the mathematics of Graph Theory.Theory.

Topological relationships between points Topological relationships between points and polylines are stored.and polylines are stored.

Page 56: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

The Network Model can be denoted as The Network Model can be denoted as point : point : [x:real, y:real] node: node: [ point, <arc>] arc: arc: [node-start,node-end, <point>] polygon: polygon: <point> region: region: {polygon}

Network ModelNetwork Model

Page 57: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

House

PumpHouse

Pump

Meter

Valve

Hydrant

Fitting

Main

Street

Lateral

Network Example: Water Network Example: Water Facility Data TypesFacility Data Types

Along with the Network Model there is much additional information. There are geographic objects.

Page 58: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Pump

Meter

Valve

Hydrant

Fitting

Main

Lateral

Network Example: Water Network Example: Water Facility Data TypesFacility Data Types

Along with the Network Model there is much additional information. There are geographic objects.

Page 59: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Topological Model(*)Topological Model(*)

Topological network induces planar Topological network induces planar subdivisions into adjacent polygons some subdivisions into adjacent polygons some of which are constructive and do not of which are constructive and do not correspond to actual geographic objects.correspond to actual geographic objects.

The triangles provide a uniformity of representation, they do not necessarily correspond to real world entities.

Page 60: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Topological Model can be denoted as Topological Model can be denoted as point : point : [x:real, y:real] node: node: [ point, <arc>] arc: arc: [node-start,node-end, left-ply, right-poly <point>]

polygon: polygon: <arc> region: region: {polygon}

Topological Model(*)Topological Model(*)

Page 61: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Topological Model(*)Topological Model(*)

P1P2

a

b

c

d

e

f

Polygon P1: <a, b, f>

Polygon P2: <c,d,e,f>

Arc f:[N1,N2,P1,P2,<>]

Node N1:[[3,0],<a,f,e>]

N1

[3,0]

N2

Page 62: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Advantages:Advantages: Geometry is shared not duplicated.Geometry is shared not duplicated. Data model represents adjacent Data model represents adjacent

polygons, hence they do not have to be polygons, hence they do not have to be computed on demand.computed on demand.

Facilitates consistent update, only one Facilitates consistent update, only one copy of boundary to update.copy of boundary to update.

Can facilitate networking and routing.Can facilitate networking and routing.

Topological Model(*)Topological Model(*)

Page 63: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Disadvantages:Disadvantages: More complex than Spaghetti model, More complex than Spaghetti model,

may slow down processing.may slow down processing. Some of the structural information may Some of the structural information may

have no semantics in the real world.have no semantics in the real world. Addition of new objects requires the pre-Addition of new objects requires the pre-

computation of part of the planer graph.computation of part of the planer graph.

Topological Model(*)Topological Model(*)

Page 64: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

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.

Page 65: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Summary of Spatial RepresentationSummary of Spatial Representation

Two modes : tessellation and vector. Vector mode is the Two modes : tessellation and vector. Vector mode is the main focus of this course.main focus of this course.

Classifying objects by dimension, 0-D,1-D, 2-D.Classifying objects by dimension, 0-D,1-D, 2-D. Modelling single spatial objects:Modelling single spatial objects:

Simple vector representation of single objects.Simple vector representation of single objects.

Modelling Collections of objectsModelling Collections of objects Spaghetti Model for collection of objectsSpaghetti Model for collection of objects Network model for connected networksNetwork model for connected networks Topological model includes polygon adjacency and shared Topological model includes polygon adjacency and shared

geometry.geometry.

We must distinguish between topology and geometry.We must distinguish between topology and geometry.

Page 66: Spatial Databases: Lecture 2 DT249-4 DT228-4 Semester 2 2009-10 Pat Browne 20Databases%20SDEV4005/Spatial%20Databases%20SDEV4005.htm

Summary of Spatial RepresentationSummary of Spatial Representation

Two modes : tessellation and vector. Vector Two modes : tessellation and vector. Vector mode is the main focus of this course.mode is the main focus of this course.

Classifying objects by dimension, 0-D,1-D, 2-D.Classifying objects by dimension, 0-D,1-D, 2-D. Modelling single spatial objects:Modelling single spatial objects:

Simple vector representation of single objects.Simple vector representation of single objects. Modelling Collections of objectsModelling Collections of objects

Spaghetti Model for collection of objectsSpaghetti Model for collection of objects Network model for connected networksNetwork model for connected networks Topological model includes polygon adjacency and Topological model includes polygon adjacency and

shared geometry.shared geometry.