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

Final risk map by epidemiological unit not shown #27

Closed famuvie closed 5 years ago

famuvie commented 5 years ago

When the layer of epidemiological units lacks CRS information (missing .prj in the original shapefile), the analysis work as expected except for the final risk map by epidemiological unit, which is not shown.

I could not reproduce locally exactly. I always see an error message. But I believe it to have the same root cause.

MRE:

library(mapMCDA)
library(raster)
#> Loading required package: sp
r <- raster(nrow = 10, ncol = 10)
r[] <- seq.int(ncell(r))
epiunits <- as(r, "SpatialPolygons")
proj4string(epiunits) <- CRS()
risk_unit(r, epiunits)
#> Error in over(eu, rgrid, fn = fun): identicalCRS(x, y) is not TRUE

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