pinpoly            package:spatialkernel            R Documentation

_C_h_e_c_k _i_f _P_o_i_n_t_s _a_r_e _w_i_t_h_i_n _P_o_l_y_g_o_n

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

     Check the location of point(s) with respect to a polygon.

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

       pinpoly(poly, pts)

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

    poly: matrix containing the 'x,y'-coordinates of the vertices of
          the polygon boundary.

     pts: matrix of containing the 'x,y'-coordinates of the point
          locations.

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

     An integer vector of indicators for each point in 'pts', 

      -1: error when number of polygon vertices exceeds 3000;

       0: outside the polygon;

       1: at the polygon boundary;

       2: inside the polygon.

_N_o_t_e:

     This function is provided here so that users do not need to load
     other packages, as it is not available in the 'base' R packages.

     The return values have been changed from the original ones so that
     the point is inside (including at the boundary) if positive.

_R_e_f_e_r_e_n_c_e_s:

     This Fortran code comes from Wm Randolph Franklin, Electrical,
     Computer, and Systems Engineering Department, Rensselaer
     Polytechnic Institute, Troy, New York, at website  <URL:
     http://www.ecse.rpi.edu/Homepages/wrf>.

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

     'phat' and 'mcseg.test'

