[R-sig-Geo] Extracting coordinates from SpatialLinesDataFrame object

Agustin Lobo alobolistas at gmail.com
Mon Jul 6 11:45:28 CEST 2009


I  want to extract the coordinates of each line
in a SpatialLinesDataFrame object as a 2D matrix (not as a list). I'm using
as.matrix(coordinates(fl1[1,])[[1]][[1]])
for the first line,
which works fine but it's really odd and difficult to remember.

Is there an easier way of doing it?
Also, perhaps we could have something like
coordinates(fl1[1,], matrix=T)
in the future ?

Thanks!

Agus



More information about the R-sig-Geo mailing list