gridlines                 package:sp                 R Documentation

_C_r_e_a_t_e _N-_S _a_n_d _E-_W _g_r_i_d _l_i_n_e_s _o_v_e_r _a _g_e_o_g_r_a_p_h_i_c _r_e_g_i_o_n

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

     Create N-S and E-W grid lines over a geographic region; 'gridat'
     permits the construction of points and labels for non-projected
     grid annotation

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

     gridlines(x, easts = pretty(bbox(x)[1,]), norths = pretty(bbox(x)[2,]), ndiscr = 20) 
     gridat(x, easts = pretty(bbox(x)[1,]), norths = pretty(bbox(x)[2,]), offset=0.5)

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

       x: object deriving from class Spatial-class

   easts: numeric; east-west values for vertical lines

  norths: numeric; north-south values for horizontal lines

  ndiscr: integer; number of points used to discretize the line, could
          be set to 2, unless the grid is (re)projected

  offset: offset value to be returned, see text

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

     'gridlines' returns an object of class SpatialLines-class, with
     lines as specified; the return object inherits the projection
     information of 'x'; 'gridat' returns a SpatialPointsDataFrame with
     points at the west and south ends of the grid lines created by
     'gridlines', with degree labels

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

     Edzer J. Pebesma, edzer.pebesma@uni-muenster.de, using example
     code of Roger Bivand.

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

     Function spTransform in package 'rgdal'

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

     data(meuse)
     coordinates(meuse) = ~x+y
     plot(meuse)
     plot(gridlines(meuse), add=TRUE)
     title("default gridlines within Meuse bounding box")

