area, buffer, description area of a polygon, center of mass, buffer of a polygon / polygonal line,...

44
Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Post on 22-Dec-2015

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Area, buffer, description

Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Page 2: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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.

Page 3: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Idea: area under edge

(6,8)(12,7)

(6,8)(12,7)

Area =width times average height = (12 - 6) * (8 + 7)/2 = 45

Page 4: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Area, continued

Edges at “upper side” give positive contribution

Edges at “lower side” give negative contribution

Page 5: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Area formula

Assume points given clockwise

Area(P) =

(X1 - Xn)(Y1 + Yn)/2 +

(Xi+1 - Xi)(Yi + Yi+1)/2 i=1

n-1

Page 6: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 7: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Center of mass of a polygon

• Center of mass of weighted points: weighted average of the x-coordinates and of the y-coordinates

20

2111

-12-8

5

Page 8: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Buffer of a polyline

• Buffer = Minkowski sum with a disk• A polyline gives a polygon with holes

Page 9: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Buffer computation:divide & conquer

1. Split polyline in two

2. Compute the buffer of the halves recursively

3. Merge the buffersto one buffer

Page 10: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Buffer complexity

• Two non-intersecting line segments S1 and S2

• Consider the buffers of S1 and S2

• They intersect at most twice • So a set of buffers of non-intersecting line

segments is a set of pseudo-discs

Page 11: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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)

Page 12: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Assume we merge the buffers of polylines having m1 and m2 edges

Do an “ordinary” linesweep over the O(m1)+ O(m2) segmentsand circular arcs ofthe buffers

Cost:O((m1+m2+k) log (m1+m2+k))time for the merge

Merge buffers to one

Page 13: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

How many intersection points?

• In general: m1 and m2 line segments can intersect m1m2 times, so k m1m2

• Here: Every intersection point is a vertex of the buffer after the merge, so of a polyline with m1+m2 edges

• This new buffer has complexity O(m1+m2) according to the corollary, so k = O(m1+m2)

• Hence, the merge takesO((m1+m2) log (m1+m2)) time

Page 14: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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 log2 n) time (e.g. by induction)

Page 15: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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)

2

1

2 )(1

mean

n

ii xx

n

Page 16: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 17: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 18: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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)

Page 19: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 20: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Applications of size

• Length polyline for network analysis (shortest routes)

• Area preservation during map generalisation• Cartograms

Page 21: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 22: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Description of shape by a number

• Elongatedness: 1.27 * area / diameter2

• Compactness: 0.32 * area / (radius smallest enclosing circle)2

• Circularity: 12.6 * area / perimeter2

All between 0 and 1

Page 23: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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)

Page 24: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Description of shape by skeleton

• Internal skeleton, also: medial axis, or centerline• Voronoi diagram of the edges of the polygon

Page 25: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 26: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 27: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 28: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 29: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 30: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Description of a point set

• Clustering: even, random, clustered distribution

E.g., compare actual nearest neighbor distance with nearest neighbor distance of random set

Page 31: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Description of a point set

• Density: scale-dependent, locally defined

point count inside a square or circle;size determines the scale of interest

Page 32: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Example of density

• Population density

Page 33: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics
Page 34: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Distance between two objects

• For two arbitrary subsets of the plane: smallest Euclidean distance

• Average smallest Euclidean distance

Page 35: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 36: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Description of similarity

• Hausdorff distance: for any two subsets of the plane

Max ( max min dist(a,b) , max min dist(b,a) )aA bBbB aA

A

B

A B B A

Page 37: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

Description of similarity

• Area of symmetric difference: for polygons= complement of area of intersection

Page 38: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 39: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 40: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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| = mO(m log m + n log m) time

Page 41: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

• 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 toedge of A

Smallest distance to B attained at two places

Page 42: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 43: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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

Page 44: Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics

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