Skip to contents

PolygonBoolean: intersection (overlay, clip), union and difference (erase) of two simple polygons by the Greiner-Hormann algorithm. PolygonArea: signed shoelace area. FilledContourBands: exact isoband polygons and areas of the piecewise-linear surface. ElevationProfile: bilinear DEM profile along a polyline. ProximityBands: multiple-ring buffer bands on a grid. Identical to the Python arm morie.fn.geomops.

Usage

PolygonBoolean(subject, clip, op = "intersection")

PolygonArea(ring)

ElevationProfile(x, y, z, path, step)

ProximityBands(x, y, breaks, points = NULL, lines = NULL)

Arguments

subject, clip

Two-column matrices of polygon vertices.

op

One of "intersection", "union", "difference".

ring

Two-column matrix of a ring.

x, y

Grid coordinates (ascending).

z

Matrix of values, rows following y.

path

Two-column matrix of polyline vertices.

step

Sampling step.

breaks

Band distance breaks.

points

Two-column matrix of feature points (or NULL).

lines

List of two-column polyline matrices (or NULL).

Value

List (number for PolygonArea).

References

Greiner, G. and Hormann, K. (1998). Efficient clipping of arbitrary polygons. ACM Transactions on Graphics 17, 71-83.

Watson, D. F. (1992). Contouring: A Guide to the Analysis and Display of Spatial Data. Pergamon.

Examples

A <- rbind(c(0, 0), c(4, 0), c(4, 3), c(0, 3))
B <- rbind(c(2, 1), c(6, 2), c(5, 5))
PolygonBoolean(A, B, "union")$area
#> [1] 16.5