gpcholes              package:maptools              R Documentation

_H_i_s_a_j_i _O_n_o'_s _l_a_k_e/_h_o_l_e _p_r_o_b_l_e_m

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     data(gpcholes)

_F_o_r_m_a_t:

     The format is class '"polylist"'.

_D_e_t_a_i_l_s:

     "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)*

_S_o_u_r_c_e:

     Data file included in "gpclib" package.

_E_x_a_m_p_l_e_s:

     data(gpcholes)
     plot(hole2pl, col="red", pbg="white", border="blue", forcefill=FALSE)
     plot(hole1pl, col="red", pbg="white", border="blue", forcefill=FALSE)

