You are on page 1of 38

Chapter 3:

Computational Geometry, Continued

• Operations on points, lines and segments


– Elementary operations
• Translation
• Rotation
• Scaling
• Symmetry
– Intersection of lines and segments
– Generalization of polylines.
• Operations on polygons

COSC 624 1
Representation:
• Point : (x, y) or: (x, y, z), sometimes: (x, y, z, t)

• Segment: set of points located on a line and limited by


two extremities

• => representation using parametric equation:

x = xa +t (xb-xa)
with o  t  1
y = ya +t (yb-ya)

COSC 624 2
Representation of segments:
y y
B(xb,yb) B t>1
t=1

0<t<1
A
t=0
A(xa,ya) t<0

Origin Origin x
x

Representation Parametric
by extremities Representation

x = xa + t (xb-xa)
y = ya + t (yb-ya) with o  t  1

COSC 624 3
Generalization and Detailization

Generalization

Detailization

COSC 624 4
• Generalization of a Polyline:

Points whose distance to the


polyline is inferior to a
certain threshold

Initial polyline Generalized polyline

COSC 624 5
• Intersection of two segments:

intersection

Intersecting segments Segments without intersection

COSC 624 6
Intersections of a segment with a polygon

Test of a segment with a polygon


(After rotation)
(before rotation)

COSC 624 7
Point-in-polygon algorithm:
half-line Jordan theorem

1 2
1
Candidat point

22 3 4 5 Half-line
1
1
3 4
1 2
3 number of intersections
1 with the edges

A point is inside a polygon, iff the number of intersection is odd


A point is outside a polygon, iff the number of intersection is even

COSC 624 8
• Minimum Bounding Rectangle (MBR)

Polygon

Minimum Bounding rectangle

COSC 624 9
• Operations on polygons

• Union, intersection, difference


• Centroid
• Area computation
• Clipping of polygon
• Rubber-sheeting

COSC 624 10
• Union and intersection of two polygons:

Polygon A

Polygon B

Two polygon A and B Union of A and B Intersection of A and B

COSC 624 11
• Splitting two polygons into parallel slabs:

Polygone A

Polygone B

COSC 624 12
• Comparing trapezoidal slabs
POLYGONES DECOUPES INTERSECTION UNION

Slabs

COSC 624 13
For any polygon possibly non concave:

• Triangulation from the origin

COSC 624 14
• Different centroids:

Defined from vertices coordinates Defined as the center of gravity

Eventually moving the centroid inside the polygon

COSC 624 15
• Clipping of an object with
a rectangular window:

Graphic object Graphic object

Window Window

Before clipping After clipping

COSC 624 16
• Rubber-sheeting

Control
Initial points
map to move

New Fixed
map control
points

COSC 624 17
3.3 Modeling Geographic data

• A geographic data model is a set of


constructs for describing and representing
selected aspects of the real world in a
computer.

Q: How to make geographic


objects computing-oriented?
COSC 624 18
Outline

3.3.1 Overview
3.3.2 Vector modeling
3.3.3 Raster modeling

COSC 624 19
3.3.1 Overview: Modeling

• The real world can only be depicted in a GIS through


the use of models that define phenomena in a manner
that computer systems can interpret, as well perform
meaningful analysis.
• Modeling presents the principles for:
• Spatial information system design methodologies,
• Conceptual modeling of spatial objects,

COSC 624 20
Data A subset of a
Modeling reality of
Real World particular interest
Abstraction
Levels

External External External External


Model-1 Model-2 Model-3 … Model-n

Schematic
representation of
Users define their Conceptual Model
phenomena and how
own subset of the
they are related.
real world

A computing
Logical Model oriented
representation of
the conceptual
model.
Physical Model
Deals with storage
devices, file
structure, access
COSC 624 methods, etc. 21
Conceptual Modeling: The ER Approach
Entity or Entity
Association
Class
(Relationship
)

Entity_Name Entity_Name
Association
-Attribute 1 - Attributes
- Attribute 1
0-N 0-1
-Attribute 2 - Attribute 2
… …

Minimum
Cardinality
Attributes Maximum Attributes
or Cardinality or
Properties Properties

Cardinalities: are expressed by numbers defining the minimum and maximum


number of entities in a relationship in both the forward and backward direction.

COSC 624 22
3.3.2 Vector modeling
There are two significant model categories:
Graphic Models: Vector and Raster
• Deals with the models used in representing GIS data graphically
(Vector vs. Raster)
Database Models/Structures:
• deals with real-world entities translated into database objects,
- simple lists, sequential files, indexed files, hierarchal
files, network files, relational database, etc.

COSC 624 23
Real World  Data Needed
The real world model determines which data need to be acquired
• An entity is the basic carrier of information
– Real-world phenomenon not divisible into
phenomena of the same kind

• An entity consists of:


• Type Classification
• Attributes
• Relationships

COSC 624 24
Entity: Type Classification
• Assumes identical occurrences can be classified
• Each entity type must be unique (no ambiguity)
– e.g., house classified under house; not industrial building
• Some entities may need to be categorized
– e.g., roadways as a class: with categories for national
highways, urban roads, private roads
• Entity type also known as qualitative data
– or in statistics the ‘nominal scale’

COSC 624 25
Entity: Attributes
• Each entity type may have one or more attributes
– e.g., buildings may have attributes characterizing material
(frame or masonry), as well number of stories
• Attributes may describe quantitative data ranked in
three levels of accuracy

Ordinal (Ranks) Interval (numeric) Ratio (scale)


– Good – Age – Length
– Better – Income – Area
– Best

COSC 624 26
Real World  Data Modeling

Simplified model of real world

• The process of interpreting reality by using both a


real world and a data model is called data modeling.

Source: Bernhardsen, Tor. (1999). 2 nd Ed. Geographic Information Systems: An Introduction. p 38.

COSC 624 27
Real World 
Modeling
Process
• A process of interpreting
reality by using a real world
and a data model.

Source: Bernhardsen, Tor. (1999). 2 nd Ed.


Geographic Information Systems: An
Introduction. p 39. Fig 3.2.
COSC 624 28
Modeling: Geometric & Attribute Data
• Geographical data can be divided into geometric data & attribute data.
• Attribute data can in turn be subdivided into qualitative data and
quantitative data.

Source: Bernhardsen, Tor. (1999). 2 nd Ed. Geographic Information Systems: An Introduction. p. 40.

COSC 624 29
Modeling: Attribute Data

• Attribute data consist of qualitative (type of object) or quantitative data


(ordinal, interval, ratio)
• Quantitative data can be categorized into:
• ordinal data, which specify quality by the use of text;
• interval data, data arranged into classes along a continuous scale; and
• ratio data, data measured in relation to a zero starting point).
COSC 624 30
Source: Bernhardsen, Tor. (1999). 2 nd Ed. Geographic Information Systems: An Introduction. pp 40.
Modeling: Entity Relations

Relationships between entities:


• Pertains/belong to: A depth figure pertains to a specific place, or a
pipe belongs to a larger network of contiguous pipes
• Comprises: A country comprises states, which in turn comprise
townships.
• located in/on: A particular building is located on a specific
property.
• borders on: Two properties have a common border.
COSC 624 31
Source: Bernhardsen, Tor. (1999). 2 nd Ed. Geographic Information Systems: An Introduction. pp 40.
Data Model  Entities as Objects

• Real-world entities correspond to database


objects
– entity as carrier of information  object(s)

Image: Bernhardsen, Tor. (1999). 2 nd Ed. Geographic Information Systems: An Introduction. p 42.

COSC 624 32
Objects are characterized by:
• Type (unique ID, type code/object class)
• Attributes (qualitative/quantitative data)
• Relations (calculable vs. attributable)
• Geometry (point, line, area/polygon)
• Quality (accuracy, resolution, coverage extent, representation, etc.)

• Real world models & entities cannot be realized directly in databases,


partly because a single entity may comprise several objects.

• E.g., a Road may be represented as a compilation of all the


roadway sections between intersections/stop signs, with each of
the sections carrying object information.

• Prior to creating GIS data the criteria for dividing a roadway in


sections must be selected before the roadway can be described.
COSC 624 33
Object as Spatial Component

Source: Bernhardsen, Tor. (1999). 2 nd Ed. Geographic Information Systems: An Introduction. p 43.

COSC 624 34
Graphical Representation of Objects

• Spatial Component:
– Points (no dimensions): simplest graphical representation.
• Eg. corner or property boundary, coordinate of a building location.
• Scale determines whether object is defined as point or an area.
• Large-scale representation of a building may be shown as an area,
whereas in small-scale it likely would be a point (symbol)
– Lines (one dimension): Connect at least two points & used to
represent objects that may be defined in one dimension.
• Eg. property boundaries, electric power lines, telecommunication
cables.
• Roads & rivers may be either lines or areas, depending on the scale.

COSC 624 35
– Areas/polygons (two dimensions): Used to
represent objects defined in two dimensions.
• Eg. Lake, area of woodland, township.
• Again, scale determines whether object represented by
area or point.
• Areas are delineated by at least three connecting lines,
each of which comprise points.

COSC 624 36
Attribute Representation of Objects:
• Attribute values: same as entity attributes of real-world model.
– Describe an objects features-- qualitative (type of object) or
quantitative data (ordinal, interval, ratio).
– In practice object attributes are stored in tables, with objects on lines
and attributes in columns.
• Relations:
1. May be calculated from
a) Coordinates of an object. Eg. line intersections or area overlaps
b) Object structure (relation). Eg. beginning & end points of a line,
lines that form a polygon, or locations of polygon on either side of a
line
2. Relations that must be entered as attributes. Eg. Levels of crossing
roads that don’t intersect, division of a county into townships

COSC 624 37
• Quality:
– Graphical accuracy (such as +/- 1.0 m accuracy)
– Updating (when & how data should be updated)
– Resolution/detailing (whether roads should be
represented by lines or both edges)
– Extent of geographical coverage, attributes included, etc
– Logical consistency between geometry & attributes
– Representation: discrete vs. continuous
– Relevance: (where input may be a surrogate for original
data that are unobtainable)

COSC 624 38

You might also like