Download presentation
Presentation is loading. Please wait.
1
Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics
2
Area of a polygon Polygon without holes Polygon with holes (5,1) (11,3) (14,6) (7,4) (6,8) (12,7) (8,6) (3,5) Given: cyclic list of points with their coordinates.
3
Idea: area under edge (6,8) (12,7) (6,8) (12,7) Area = width times average height = (12 - 6) * (8 + 7)/2 = 45
4
Area, continued Edges at “upper side” give positive contribution Edges at “lower side” give negative contribution
5
Area formula Assume points given clockwise Area(P) = (X 1 - X n )(Y 1 + Y n )/2 + (X i+1 - X i )(Y i + Y i+1 )/2 i=1 n-1
6
Center of mass of a polygon Take arbitrary point p Make triangles: each side of the polygon and point p Determine weight (area) and center of mass per triangle Compute weighted average of the centers of mass Counterclockwise triangles: positive weight; clockwise triangles: negative weight p
7
Center of mass of a polygon Center of mass of weighted points: weighted average of the x-coordinates and of the y- coordinates 20 21 11 -12 -8 5
8
Buffer of a polyline Buffer = Minkowski sum with a disk A polyline gives a polygon with holes
9
Buffer computation: divide & conquer 1.Split polyline in two 2.Compute the buffer of the halves recursively 3.Merge the buffers to one buffer
10
Buffer complexity Two non-intersecting line segments S 1 and S 2 Consider the buffers of S 1 and S 2 They intersect at most twice So a set of buffers of non-intersecting line segments is a set of pseudo-discs
11
Buffer complexity Theorem (13.9 of computational geometry book): Let S be a collection of [polygonal] pseudodiscs with n edges in total. Then the complexity of their union is O(n) Corollary: The buffer of a polygonal line consisting of n edges (or n+1 points) has complexity O(n)
12
Assume we merge the buffers of polylines having m 1 and m 2 edges Do an “ordinary” line sweep over the O(m 1 ) + O(m 2 ) segments and circular arcs of the buffers Cost: O((m 1 +m 2 +k) log (m 1 +m 2 +k)) time for the merge Merge buffers to one
13
How many intersection points? In general: m 1 and m 2 line segments can intersect m 1 m 2 times, so k m 1 m 2 Here: Every intersection point is a vertex of the buffer after the merge, so of a polyline with m 1 +m 2 edges This new buffer has complexity O(m 1 +m 2 ) according to the corollary, so k = O(m 1 +m 2 ) Hence, the merge takes O((m 1 +m 2 ) log (m 1 +m 2 )) time
14
The algorithm If n >1, split polyline with n edges into two parts with n/2 edges each Compute the buffer of each part recursively Merge the buffers of the parts into one using plane sweep, in O(n log n) time Recurrence: T(n) = 2 T(n/2) + O(n log n) Gives T(n) = O(n log 2 n) time (e.g. by induction)
15
Description: measures and use Mathematical description statistics Sets of numbers (1-dimensional point set) Describe with: - average - range [min,max] - variance, standard deviation - histogram (by fixed-interval classification)
16
Geometric description Description of a point, polyline, polygon - location- size - orientation- shape Description of a point set - clustering- density Description of distance - two points- two polylines - two polygons Description of similarity in shape - two polylines- two polygons
17
Description of location Description of object as two coordinates (point) For a point: trivial Center of mass: for polyline or polygon; can lie outside polygon Center of largest inscribed circle: for polygon
18
Applications of location Symbolizing a city as point object during map generalization Place to put information (name) of polygon Preparation for cluster analysis type that only applies to point (set)
19
Description of size For point: not applicable For polyline: length For polygon: area or diameter or width Diameter: largest distance between two points in the object Width: smallest distance between two parallel lines that contain the object
20
Applications of size Length polyline for network analysis (shortest routes) Area preservation during map generalisation Cartograms
21
Description of orientation For polyline: - direction of vector between endpoints For polygon: - direction of diagonal - direction of parallel lines that define width - direction of line that minimizes the average distance of all points in polygon to that line
22
Description of shape by a number Elongatedness: 1.27 * area / diameter 2 Compactness: 0.32 * area / (radius smallest enclosing circle) 2 Circularity: 12.6 * area / perimeter 2 All between 0 and 1
23
Application of shape by a number Analysis of voting districts: when making districts for voting and representatives, the areas must have “nice” shape to group shared interests of the population (zoning = making districts)
24
Description of shape by skeleton Internal skeleton, also: medial axis, or centerline Voronoi diagram of the edges of the polygon
25
Applications of shape by skeleton Replacement of lakes in a river by a linear object during map generalisation Also: centers of roads, for network analysis
26
Computation skeleton Voronoi diagram of line segments; adaptation of sweep-line algorithm for Voronoi diagram of points Voronoi edges and vertices outside polygon can be removed later O(n log n) time for polygon with n vertices Note: the largest enclosed circle of the polygon has its center on a Voronoi vertex
27
Description of shape of polyline Also: boundary of polygon Sinuosity: total angular change Curviness: average change of angle (per unit of length) Number of inflection points
28
Applications of shape polyline Generalisation of a road with hairpin turns, or a meandering river Suitability of a river segment for label placement along it reduce simplify typify
29
Description of point sets Clustering Density Examples of point sets to be analyzed –epicenters of earthquakes –occurrences of road accidents in a city –burglary locations proportional symbol map
30
Description of a point set Clustering: even, random, clustered distribution E.g., compare actual nearest neighbor distance with nearest neighbor distance of random set
31
Description of a point set Density: scale-dependent, locally defined point count inside a square or circle; size determines the scale of interest
32
Example of density Population density
34
Distance between two objects For two arbitrary subsets of the plane: smallest Euclidean distance Average smallest Euclidean distance
35
Applications of distance Smallest distance: overlap when drawing lines with thickness Average distance: part of a measure for cultural influence received by one area from another area
36
Description of similarity Hausdorff distance: for any two subsets of the plane Max ( max min dist(a,b), max min dist(b,a) ) aAaA bBbB bBbB aAaA A B A BB A
37
Description of similarity Area of symmetric difference: for polygons = complement of area of intersection
38
Application of similarity Detection of change between two maps with same theme but different date For example: - land use in Zeeland in 1975 and 2005 - area of lost forest and newly grown forest Joint occurrence of two values in different themes (co-location) For example, forest type and geological soil type
39
Computation Hausdorff distance Where can largest distance from A to B occur? A B A B Vertex of A Point internal to edge of A In this case, the minimum distance must be attained from that point on A to two places on B
40
Computation Hausdorff distance Vertex of A that minimizes distance to B: - Compute Voronoi diagram of edges of B - Preprocess for planar point location - Query with ever vertex of A to find the closest point to B and the distance to it A B Vertex of A |A| = n |B| = m O(m log m + n log m) time
41
Compute Voronoi diagram of the edges of B Compute intersection points of the edges of A with the Voronoi edges of B Compute intersection point on A with maximum smallest distance to B Computation Hausdorff distance A B Point internal to edge of A Smallest distance to B attained at two places
42
Computation Hausdorff distance Worst case: (nm) intersection points between A and the Voronoi diagram of B, then O(nm log (nm)) time Typical: O(n+m) intersection points, then the algorithm takes O((n+m) log (n+m)) time Inclusive of distance B to A and taking maximum: O((n+m) log (n+m)) time
43
Computation area of symmetric difference Perform map overlay (boolean operation) on the two polygons Compute area of symmetric difference of the polygons and add up Worst case: O(nm log (nm)) time Typical case: O((n+m) log (n+m)) time
44
Summary There are many possible size and shape descriptors (measures) for geometric objects Different descriptors have different applications; the options should always be studied Computation of some measures/descriptors requires advanced algorithms
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.