[R-sig-Geo] fasterize error

Herr, Alexander (L&W, Black Mountain) A|ex@nder@Herr @end|ng |rom c@|ro@@u
Thu Sep 5 06:29:47 CEST 2019


Hi,

I get an error when attempting to run fasterize:

library(sf)
library(fasterize)
p1 <- rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60), c(-180,-20))
hole <- rbind(c(-150,-20), c(-100,-10), c(-110,20), c(-150,-20))
p1 <- list(p1, hole)
p2 <- list(rbind(c(-10,0), c(140,60), c(160,0), c(140,-55), c(-10,0)))
p3 <- list(rbind(c(-125,0), c(0,60), c(40,5), c(15,-45), c(-125,0)))
pols <- st_sf(value = rep(1,3),
              geometry = st_sfc(lapply(list(p1, p2, p3), st_polygon)))
r <- raster(pols, res = 1)
r <- fasterize(pols, r, field = "value", fun="sum")

Error in fasterize(pols, r, field = "value", fun = "sum") :
  No current support for rotated rasters.


>sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: SUSE Linux Enterprise Server 12 SP3

Matrix products: default
BLAS/LAPACK: /apps/intel/mkl/2017.2.174/compilers_and_libraries_2017.2.174/linux/mkl/lib/intel64_lin/libmkl_intel_lp64.so

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] fasterize_1.0.0 sf_0.7-7

loaded via a namespace (and not attached):
[1] compiler_3.6.1     magrittr_1.5       class_7.3-15       DBI_1.0.0
 [5] tools_3.6.1        units_0.6-3        sp_1.3-1           Rcpp_1.0.2
 [9] raster_2.9-23      KernSmooth_2.23-15 codetools_0.2-16   grid_3.6.1
[13] e1071_1.7-2        classInt_0.3-3     lattice_0.20-38

Any suggestions?

Thanks
Herry

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list