getcontour            package:adehabitat            R Documentation

_C_o_m_p_u_t_e_s _t_h_e _C_o_n_t_o_u_r _P_o_l_y_g_o_n _o_f _a _R_a_s_t_e_r _O_b_j_e_c_t

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

     'getcontour' computes the contour polygon of a raster object of
     class 'asc'.  When the object is made of several parts, the
     function returns one polygon per part.

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

     getcontour(x)

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

       x: an object of class 'asc'

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

     Returns an object of class 'area'.

_W_a_r_n_i_n_g:

     Holes in the polygons are not taken into account by the function.

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

     Clment Calenge calenge@biomserv.univ-lyon1.fr

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

     'import.asc' for additionnal information on objects of class
     'asc', 'as.area' for information on objects of class 'area', and
     'area2dxf' to export the results toward a GIS.

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

     data(puechabon)
     kasc <- puechabon$kasc

     #########################################
     ## Example with one object:
     ## Gets the first map of the "kasc" object
     ## Map of the elevation
     elev <- getkasc(kasc, "Elevation")
     image(elev)
      
     ## Get the contour polygon
     cpol <- getcontour(elev)

     ## Draw the polygon
     i <- cpol[,2:3]
     polygon(i, col = "green", lwd = 2)

     #########################################
     ## Example with two objects:
     ## home ranges of wild boar

     hr <- getsahrlocs(puechabon$sahr, "hr")
     u <- getkasc(hr, "Jean")
     image(u)

     ## Get the contour polygons
     p <- getcontour(u)
     plot(p, lwd = 2)

