nowrapSpatialLines {sp}R Documentation

Split SpatialLines components at offset

Description

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 Sline objects at the offset (usually Greenwich), inserting a very small gap, and reassembling the Sline objects created as Slines. A similar function for rings is found in the spgpc package.

Usage

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

Arguments

obj A Spatial Lines object
offset default 0, untried for other values
eps vector of two fuzz values, both default double.eps

Value

A Spatial Lines object

Author(s)

Roger Bivand

Examples

Sl <- SpatialLines(list(Slines(list(Sline(cbind(sin(seq(-4,4,0.4)), seq(1,21,1)), CRS("+proj=latlong"))))))
summary(Sl)
lapply(sapply(getSLlinesSlot(Sl), getSlinesSlinesSlot), bbox)
lapply(sapply(getSLlinesSlot(recenter(Sl)), getSlinesSlinesSlot), bbox)
nwSL <- nowrapSpatialLines(Sl)
summary(nwSL)
lapply(sapply(getSLlinesSlot(nwSL), getSlinesSlinesSlot), bbox)
lapply(sapply(getSLlinesSlot(recenter(nwSL)), getSlinesSlinesSlot), bbox)

[Package sp version 0.7-7 Index]