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

thinPolys

Thin a PolySet of Polygons


Description

Thin a PolySet, where each unique (PID, SID) describes a polygon.

Usage

thinPolys (polys, tol = 1, filter = 3)

Arguments

polys

PolySet to thin.

tol

tolerance (in kilometres when proj is "LL" and "UTM"; otherwise, same units as polys).

filter

minimum number of vertices per result polygon.

Details

This function executes the Douglas-Peuker line simplification algorithm on each polygon within polys.

Value

PolySet containing the thinned data. The function recalculates the POS values for each polygon.

Author(s)

Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10

See Also

Examples

local(envir=.PBSmapEnv,expr={
  oldpar = par(no.readonly=TRUE)
  #--- load the data (if using R)
  if (!is.null(version$language) && (version$language=="R"))
    data(nepacLL,envir=.PBSmapEnv)
  #--- plot a thinned version of Vancouver Island (3 km tolerance)
  plotMap(thinPolys(nepacLL[nepacLL$PID == 33, ], tol = 3))
  #--- add the original Vancouver Island in a different line type to
  #--- emphasize the difference
  addPolys(nepacLL[nepacLL$PID == 33, ], border=2, lty=8, density=0)
  par(oldpar)
})

PBSmapping

Mapping Fisheries Data and Spatial Analysis Tools

v2.73.0
GPL (>= 2)
Authors
Jon T. Schnute [aut], Nicholas Boers [aut], Rowan Haigh [aut, cre], Alex Couture-Beil [ctb], Denis Chabot [ctb], Chris Grandin [ctb], Angus Johnson [ctb], Paul Wessel [ctb], Franklin Antonio [ctb], Nicholas J. Lewin-Koh [ctb], Roger Bivand [ctb]
Initial release
2021-01-12

We don't support your browser anymore

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