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)

