Debian Codegraph @

demo/fib.R

raw
1 xy = expand.grid(x = seq(5,355,by=10),y=seq(-85,85,by=10))
2 xyp = SpatialPoints(xy, CRS("+proj=longlat"))
3 gridded(xyp)=T
4 gridparameters(xyp)
5 xyf = spsample(xyp, 1000, type="Fibonacci")
6 plot(xyf, axes=TRUE)
7 if (require(rgdal)) {
8 xy = expand.grid(x = seq(-85,85,by=10),y=seq(-85,85,by=10))
9 xyp = SpatialPoints(xy, CRS("+proj=longlat"))
10 gridded(xyp) = TRUE
11 tocrs = CRS("+proj=ortho +lat_0=0 +lon_0=0 +x0=0 +y0=0")
12 plot(spTransform(xyp, tocrs), pch=16,cex=.7)
13 xyf = spsample(xyp, 1000, type="Fibonacci")
14 plot(spTransform(xyf, tocrs), pch=16,cex=.7)
15 dim(coordinates(xyf))
16 }