point.in.polygon             package:sp             R Documentation

_d_o _p_o_i_n_t(_s) _f_a_l_l _i_n _a _g_i_v_e_n _p_o_l_y_g_o_n?

_D_e_s_c_r_i_p_t_i_o_n:

     verifies for one or more points whether they fall in a given
     polygon

_U_s_a_g_e:

     point.in.polygon(point.x, point.y, pol.x, pol.y)

_A_r_g_u_m_e_n_t_s:

 point.x: numerical array of x-coordinates of points

 point.y: numerical array of y-coordinates of points

   pol.x: numerical array of x-coordinates of polygon

   pol.y: numerical array of y-coordinates of polygon

_V_a_l_u_e:

     integer array; values are: 

       0: 

       1: 

       2: 

       3: 

     point is a vertex of pol.

_R_e_f_e_r_e_n_c_e_s:

     Uses the C function InPoly(), in gstat file polygon.c; InPoly is
     Copyright (c) 1998 by Joseph O'Rourke.  It may be freely
     redistributed in its entirety provided that this copyright notice
     is not removed.

_E_x_a_m_p_l_e_s:

     # open polygon:
     point.in.polygon(1:10,1:10,c(3,5,5,3),c(3,3,5,5))
     # closed polygon:
     point.in.polygon(1:10,rep(4,10),c(3,5,5,3,3),c(3,3,5,5,3))

