nowrapSpatialLines            package:sp            R Documentation

_S_p_l_i_t _S_p_a_t_i_a_l_L_i_n_e_s _c_o_m_p_o_n_e_n_t_s _a_t _o_f_f_s_e_t

_D_e_s_c_r_i_p_t_i_o_n:

     When recentering a world map, most often from the "Atlantic" view
     with longitudes with range -180 to 180, to the "pacific" view with
     longitudes with range 0 to 360, lines crossing the offset (0 for
     this conversion) get stretched horizonally. This function breaks
     Line objects at the offset (usually Greenwich), inserting a very
     small gap, and reassembling the Line objects created as Lines. A
     similar function for rings is found in the 'spgpc' package.

_U_s_a_g_e:

     nowrapSpatialLines(obj, offset = 0, eps = rep(.Machine$double.eps, 2))

_A_r_g_u_m_e_n_t_s:

     obj: A Spatial Lines object

  offset: default 0, untried for other values

     eps: vector of two fuzz values, both default double.eps

_V_a_l_u_e:

     A Spatial Lines object

_A_u_t_h_o_r(_s):

     Roger Bivand

_E_x_a_m_p_l_e_s:

     Sl <- SpatialLines(list(Lines(list(Line(cbind(sin(seq(-4,4,0.4)), seq(1,21,1)))))), proj4string=CRS("+proj=latlong"))
     summary(Sl)
     #lapply(sapply(getSLlinesSlot(Sl), getLinesLinesSlot), bbox)
     #lapply(sapply(getSLlinesSlot(recenter(Sl)), getLinesLinesSlot), bbox)
     nwSL <- nowrapSpatialLines(Sl)
     summary(nwSL)
     #lapply(sapply(getSLlinesSlot(nwSL), getLinesLinesSlot), bbox)
     #lapply(sapply(getSLlinesSlot(recenter(nwSL)), getLinesLinesSlot), bbox)

