Skip to content
Prev 16957 / 29559 Next

R 3.0.0 and spatial classes

On Sun, Dec 16, 2012 at 6:53 PM, Chris English <sglish at hotmail.com> wrote:
"Line" is a non-spatial Line, made up from an ordered set of (x,y)
coordinate pairs. It cannot have a coordinate system assigned to it.

 "Lines" is a list of Lines, making a non-spatial set of Line
segments. It too cannot have a coordinate system assigned.

 "SpatialLines" is a spatial set of Lines, for when you have a number
of features each of which may be composed of several disconnected
segments. It can have a coordinate system assigned.

 You are making a SpatialLines object where a single feature has a
single line segment. The slightly annoying
list(Lines(list(Line(...)))) dance is unavoidable because the lists
are necessary since the lists can have more than one element, but you
could easy create a 'SimpleSpatialLine' function that did all that. It
might even make sp for R 3.0.0! (SimpleSpatialPolygon might be handy
too...)

Another possibility might be to write methods for SpatialLines that
takes a matrix and skips the complexity for simple cases...

Barry