4 Vector Analysis Ca
4 Vector Analysis Ca
4 Vector Analysis Ca
ANALYSIS
Cecilia Akselsson
[email protected]
Overview of Topics
1
Basic Geometric Vector Operations
Euclidian Distance
(’as-the-crow-flies’)
Pythagorean Theorem
B
z2=x2+y2
z= x2+y2
z
A x
2
Euclidian Distance
(’as-the-crow-flies’)
B (Xb;Yb)
2 2
D (A,B) = (Xa-Xb) + (Ya-Yb)
A (Xa;Ya)
B (Xb;Yb) B
A (Xa;Ya)
A
3
Distance in a network
(ex: sum of segments 1,3,5,7, using PT b/w
breakpoints)
6 B
7
5
4
3
2
1
Topographical Distance
(DEM analysis)
Use the PT 3-dimensionally and repetitively
4
Topographical Distance
B (Xb;Yb;Zb)
2 2 2
D (A,B) = (Xa-Xb) + (Ya-Yb) + (Za-Zb)
Pythagorean Theorem
A (Xa;Ya;Za)
Sphericalavstånd
Sfäriskt Distance
(avstånd
(airline routes)
mellan två objekt på jordensyta med
hänsyn tagen till jordens form)
B
A
5
Length of a line:
Line Length: 5+7+3+4 = 19
Sum of all line segments b/w start
and end node.
● Line segement lengths are computed
using the Pythagorean Theorem.
●
7
4
5
3 ●
●
●
Also equals
point # 5
1
1 n
Area = ∑ y i ( x i +1 − x i −1 )
2 i =1
6
Computing Polygon Area:
5 Point # xi yi
(i)
0 1 4
4 1 3 4
2 5 2
3 2 1
3
4 1 3
5 3 4
2
1
= * [4 * (5 - 1) + 2 * (2 - 3) + 1 * (1 - 5) + 3 * (3 - 2)]
1 2
1
= 2 * [16 + (-2) + (-4) + 3]
0 1 2 3 4 5
= 6.5
7
Find intersection b/w two line
segments:
[eg. bridge/river, flight paths, find
combinations (new polygons) b/w districts
and land use, etc.]
Equation of a straight line: y=mx+b
Y 1
●
●2
m = slope
●2 b = y-intercept
1 ●
X
( y 2 − y1) ( y 2 − y1) b = y − mx
m= m=
( x 2 − x1) ( x 2 − x1) b = y − mx
Y 1
● y = mL1 x + bL1
y = m L 2 x + bL 2
mL1 x + bL1 = mL 2 x + bL 2 →
● 2
mL1 x − mL 2 x = bL 2 − bL1 →
x=
(bL 2 − bL1)
●2
1 ● (mL1 − mL 2 )
X
8
m, b och x are now known, therefore the value of y at
the intersection can be derived: y=mx+b
Y 1
●
●2
●2
1 ●
X
Point-in-polygon:
Draw a straight line in any direction from the point of
interest. Count the number of intersections with the
polygon border. If the # of intersections is odd, the
point is in the polygon
Polygon No. Of
Intersections
1 1
2 2
3 4
WHY?
-Identify polygon using the mouse
-Idenfity which polygon (disctrict) a certain town (point) is in
9
Point-in-polygon:
Algorithm fails: When the plumb line completely
coincides with the border of a polygon (d), or when
the plumb line passes right through a node (b,c)
Vector Overlay
1.Points on Polygons
2.Lines on Polygons
3.Polygons on Polygons
10
Points on Polygons:
ID Well depth
1 8m
●2 ●7 2 3m
●4 ●6
●1 3 5m
●3 ●5
4 7.5 m
5 4m
6 12 m
+
7 6m
ID Soil type
1 2 3 1 Clay
2 Loam
3 Sand
Points on Polygons:
1. Decide which points lie in which polygons (as previous)
2. Transfer the ATTRIBUTES from the polygons to those points
that fall within them (many-to-one)
3. Result: POINT LAYER with their original + polygon attributes!
NOTE – The opposite is impossible
●2
1 ●4 2 ●7
●6 3
●1 ●3 ●5
ID Well depth Soil type
1 8m Sand
2 3m Clay
3 5m Loam
4 7.5 m Loam
5 4m Sand
6 12 m Loam
7 6m Sand
11
Lines on Polygons:
ID Stream
length
2 ●
● 1 24 m
1 3 2 14 m
● ●
3 37 m
ID Land
Parcel
1 2 3
1 A
2 B
3 C
Lines on polygons:
Decide which line segments fall into which polygons
Transfer the attributes from the polygons to those parts
of the line segment that fall within them
New start and end nodes are established (lines divided
into smaller lines)
Calculation of intersections required, lines divided into
smaller lines ● 5
4●
3 ●
6 7 ID Stream Land
● 1 2 ● ● ● length Parcel
●
1 24 m C
2 24 m B
3 24 m A
4 24 m B
5 14 m B
6 37 m B
7 37 m C
12
Polygons on Polygons:
ID County
A Lund
B Malmö
A B
ID Radon
1 Concentration
2 1 Low
2 High
Polygons on Polygons:
All points of intersection are assigned
- new nodes
- new polygons are created with attributes from both input
layers
13
Vector Data Editing and Post-
overlay Clean-up Operations
1.Clip
2.Update
3.Dissolve
4.Merge
5.Eliminate
14
Clip: Same principle as polygon on polygon overlay
15
Update:
16
Merge: Bringing together 2 adjacent (in space) data
layers in order to create a larger database
+ =
17
Advanced Distance Operations -
Buffer Zones
Buffer Zones
18
Buffer Zones
1. Create parallel lines on each side of the original line
segment, with the same length, but at a distance equal
to the buffer distance
Buffer distance
Buffer Zones
2. Connect end points with arcs having a radius equal
to the buffer distance
Buffer distance
Buffer distance
19
Buffer Zones
Two major steps:
• Calculation of co-ordinates (buffer) for every single
element
2. Merging of overlapping buffer zones
Tranport of toxins on
large raod
Shown in attribute table
and map
20
Create 50 m buffer around the roads
21
Critical for an operation’s accuracy,
precision: Degree of generalization
22