search for: srs2

Displaying 1 result from an estimated 1 matches for "srs2".

Did you mean: src2
2018 Jun 01
1
rasterize SpatialPolygon object using a RasterBrick object
...ple from the function documentation Sr1 = Polygon(10*cbind(c(2,4,4,1,2),10*c(2,3,5,4,2))) Sr2 = Polygon(10*cbind(c(5,4,2,5),10*c(2,3,2,2))) Sr3 = Polygon(10*cbind(c(4,4,5,10,4),c(5,3,2,5,5))) Sr4 = Polygon(10*cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE) Srs1 = Polygons(list(Sr1), "s1") Srs2 = Polygons(list(Sr2), "s2") Srs3 = Polygons(list(Sr3, Sr4), "s3/4") SpP = SpatialPolygons(list(Srs1,Srs2,Srs3), 1:3) plot(b[[1]]) plot(SpP, add = T) # crop clip1 = crop(b, extent(SpP)) # rasterize returns an error, but documentation says it should return a RasterBrick object cl...