Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gpc-new-generics

Generics/Methods for polygon objects


Description

Some generic functions and methods for polygon objects

Usage

append.poly(x, y)
area.poly(object, ...)
get.pts(object)
get.bbox(x)
scale.poly(x, ...)
tristrip(x)
triangulate(x)

Arguments

x,object

A polygon object

y

A polygon object

...

Other arguments passed to methods

Details

The result of tristrip(x) is a list of two-column matrices. Each matrix is a tristrip, i.e. the rows are vertices of triangles, with each overlapping triple of rows corresponding to a separate triangle.

The result of triangulate(x) is a single two-column matrix. The rows are vertices of triangles, taken in non-overlapping triples.

Methods

append.poly

signature(x = "gpc.poly", y = "gpc.poly"): Combine all contours of two "gpc.poly" objects and return the combined polygon as a "gpc.poly" object.

area.poly

signature(object = "gpc.poly"): Compute and return the sum of the areas of all contours in a "gpc.poly" object.

scale.poly

signature(x = "gpc.poly"): Scale (divide) the x and y coordinates of a "gpc.poly" object by the amount xscale and yscale, respectively. Return a scaled "gpc.poly" object.

get.pts

signature(object = "gpc.poly"): Return the list of x and y coordinates of the vertices of a "gpc.poly" object.

get.bbox

signature(x = "gpc.poly"): Return the bounding box for a "gpc.poly" object.

tristrip

signature(x = "gpc.poly"): Return a tristrip list for a "gpc.poly" object.

triangulate

signature(x = "gpc.poly"): Return a matrix of vertices of a triangulation of a "gpc.poly" object.

Author(s)

Roger D. Peng; GPC Library by Alan Murta; tristrip additions by Duncan Murdoch

See Also

"gpc.poly" class documentation.

Examples

holepoly <- read.polyfile(system.file("poly-ex-gpc/hole-poly.txt",
 package ="rgeos"), nohole = FALSE)
area.poly(holepoly)
stopifnot(area.poly(holepoly) == 8)

rgeos

Interface to Geometry Engine - Open Source ('GEOS')

v0.5-5
GPL (>= 2)
Authors
Roger Bivand [cre, aut] (<https://orcid.org/0000-0003-2392-6140>), Colin Rundel [aut], Edzer Pebesma [ctb], Rainer Stuetz [ctb], Karl Ove Hufthammer [ctb], Patrick Giraudoux [ctb], Martin Davis [cph, ctb], Sandro Santilli [cph, ctb]
Initial release
2020-09-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.