Cirad-ASTRE / mapMCDA

Produce an epidemiological risk map by weighting multiple risk factors
https://umr-astre.pages.mia.inra.fr/mapMCDA/
1 stars 2 forks source link

risk_layer() fails to compute distances to points or lines #14

Closed famuvie closed 5 years ago

famuvie commented 5 years ago
library(mapMCDA)
cmr <- mapMCDA_datasets()

set.seed(20190405)
pts <- sp::spsample(cmr$cmr_admin3, 10, type = "random")
risk_layer(
  pts, boundaries = cmr$cmr_admin3, scale_target = rev(st)
)
#> Error in .pointsToRaster(x, y, field = field, fun = fun, background = background, : invalid value for fun

Created on 2019-04-05 by the reprex package (v0.2.1)

famuvie commented 5 years ago

Actually an issue of distance_to_vector(), where I'm rasterizing vector objects with fun = "mean", which produces this issue. Better use the default value of "last".