[R-sig-Geo] Error using spsample on SpatialLines in Linux OS

Glenn Stauffer gestauffer at gmail.com
Thu Apr 26 18:31:55 CEST 2018


I ran across a problem when trying to use spsample to sample points along a
line, while in a Linux OS (Mint 18.3). The following code (which works fine
in Win 10): 

 

pts <- matrix(c(c(6000,6015,6021,6035,6050),
c(6000,5995,6000,6040,6095)),5,2,byrow=FALSE)
L = SpatialLines(list(Lines(list(Line(coordinates(pts))),"X")),proj4string =
CRS("+init=epsg:3071"))
plot(L)
Lsamp <- spsample(L,10,type="regular",offset=0.5) # this is the line that
generates the error

 

produces the following error:

 

Error in .C("sp_lengths", x, y, n, lengths, lonlat, PACKAGE = "sp") : 
  "sp_lengths" not available for .C() for package "sp"

Could this be related to some wrong versions of certain dependencies (e.g.,
GDAL)? I don't know much about that, but I did run into that issue with
trying to install other packages (rgeos, sf). In any case, how can I prevent
this error?

 

Thanks, 

Glenn

 

 


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list