gpcholes

0th

Percentile

Hisaji Ono's lake/hole problem

How to plot polygons with holes - holes are encoded by coordinates going anticlockwise, and overplotting is avoided by re-ordering the order in which polygons are plotted.

Keywords
datasets
Usage
data(gpcholes)
Details

"Date: Tue, 11 May 2004 12:54:20 +0900 From: Hisaji ONO To: r-help

I've tried to create a polygon with one hole by gpclib using following example script.

holepoly <- read.polyfile(system.file("poly-ex/hole-poly.txt", package="gpclib"), nohole = FALSE) area.poly(holepoly) plot(holepoly,poly.args=list(col="red",border="blue"))

And I noticed plot function couldn't draw polygons with holes correctly.

Does anyone know how to solve this situation?"

*(hole1pl has reversed the y component of polygon 1, to make its ring direction clockwise, hole2pl reverses the order of the two polygons in holepoly1@pts)*

format

The format is class "polylist".

source

Data file included in "gpclib" package.

Aliases
  • gpcholes
  • hole1pl
  • hole2pl
Examples
data(gpcholes)
plot(hole2pl, col="red", pbg="white", border="blue", forcefill=FALSE)
plot(hole1pl, col="red", pbg="white", border="blue", forcefill=FALSE)
Documentation reproduced from package maptools, version 0.7-3, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.