polyConstruct            package:RSurvey            R Documentation

_P_o_l_y_g_o_n _C_o_n_s_t_r_u_c_t_i_o_n

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

     Read polygon information from a text file.

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

     polyConstruct(file = NULL, dl = NULL)

_A_r_g_u_m_e_n_t_s:

    file: either a character string naming a file or a connection.

      dl: the maximum distance between polygon vertices.  If 'NULL', no
          vertices are added.

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

     The tab delineated text file, '*.txt', adheres to the following 4
     column format:

       '[,1]'  integer  an index for vertices within a polygon.
       '[,2]'  numeric  vertex location in the x-direction.
       '[,3]'  numeric  vertex location in the y-direction.
       '[,4]'  integer  a code, see Details.

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

     The 'code' argument is used to identify polygons and vertex types.
      Letting 'code = 0' for two sequential vertices will override 'dl'
     and  prevent additional vertices from being added between them.  A
     'code < 2' indicates a vertex point is within the outer polygon. 
     Inner polygons or holes are specified with a 'code > 1'.

_V_a_l_u_e:

     A polygon of class 'gpc.poly-class'.

_A_u_t_h_o_r(_s):

     Fisher, J. C.

_S_e_e _A_l_s_o:

     'polyfile'

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

     f <- system.file("RSurvey-ex/confluence-poly.txt", package = "RSurvey")
     con <- file(f, open = "r", encoding = "latin1")
     ply <- polyConstruct(file = con)
     pts <- get.pts(ply)
     plot(ply)
     for(i in 1:length(pts)) points(get.pts(ply)[[i]], col = "red")

     con <- file(f, open = "r", encoding = "latin1")
     ply <- polyConstruct(file = con, dl = 1)
     pts <- get.pts(ply)
     for(i in 1:length(pts)) points(get.pts(ply)[[i]], col = "green")

