Download presentation
Presentation is loading. Please wait.
Published byClaude Sharp Modified over 9 years ago
1
L4-Vector Algorithms L4 – Vector Algorithms NGEN06(TEK230) – Algorithms in Geographical Information Systems Abdulghani Hasan
2
L4-Vector Algorithms Background Almost all analysis of vector data in GIS is actually based on a small set of basic algorithms. Ddistances between objects Topological relationships between objects (such as point-in polygon)
3
L4-Vector Algorithms Background Degenerate cases that might occur in vector algorithms, such as a point is inside the polygon boundary in a point-in-polygon analysis will be disregarded.
4
L4-Vector Algorithms Aim To present details of some of the fundamental vector algorithms. To understand what the GIS program actually computes with the vector data. Write own small computer program that perform basic vector computations.
5
L4-Vector Algorithms Content 1.Area of a polygon 2.Side function 3.Line segment intersection 4.Point-in-polygon 5.Distance between a point and an infinite straight line 6.Distance between a point and a line 7.Distance between two lines 8.Distance between two polygons
6
L4-Vector Algorithms Area of a polygon valid for simple connected polygons, i.e., polygons without holes
7
L4-Vector Algorithms Area of a polygon valid for simple connected polygons, i.e., polygons without holes
8
L4-Vector Algorithms Area of a polygon valid for simple connected polygons, i.e., polygons without holes
9
L4-Vector Algorithms Area of a polygon
10
L4-Vector Algorithms Side function = -1, if the point p lies on the left side of the line segment (q to r) = 0, if the point p is collinear to the line segment = 1, if the point p lies on the right side of the line segment (q to r) side(q, r, p )
11
L4-Vector Algorithms Line segment intersection
12
L4-Vector Algorithms Point-in-polygon 1. semi-line method 2. angle method Both methods handle arbitrary polygons BUT not degenerated cases like point lies on the border of a polygon To deal with the degenerated cases properly exact geometric computations are often required
13
L4-Vector Algorithms Point-in-polygon 1. semi-line method The number of intersection is odd The point is inside the polygon The number of intersection is even The point is outside the polygon
14
L4-Vector Algorithms Point-in-polygon Compute the angles scalar (dot) product cross product For inverse arccos function The angle is between 0 an π For inverse arcsin function The angle is between´-π/2 to π/2 Trigonometric functions are computationally demanding
15
L4-Vector Algorithms Distance between a point and an infinitely long straight line For two point object use Pythagorean theorem In GIS we do not have any infinitely long lines
16
L4-Vector Algorithms Distance between a point and a line point p is in the middle of l point p is in the end of l or at the border between middle and end
17
L4-Vector Algorithms Distance between two line segments line segments are parallel The shortest distance between the segments is equal to the shortest distance between an end point in one of the segments and interior point or an end point in the other line segment. line segments are non-parallel The shortest distance must include an end-point of any of the line segments..
18
L4-Vector Algorithms Distance between two lines Calculate the shortest distances from each point (the nodes and the break points) to all line segments in the other line. Do the same for both lines. The distance between the two lines is equal to the shortest of all of the distances to the points
19
L4-Vector Algorithms Distance between two polygons centroid=( p1+ p2+…+ pn)/n
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.