isciences / exactextractr

R package for fast and accurate raster zonal statistics
https://isciences.gitlab.io/exactextractr/
272 stars 26 forks source link

results dropped when SpatRaster has duplicate names #66

Closed dbaston closed 2 years ago

dbaston commented 2 years ago
stk <- raster::stack(list(a = make_square_raster(1:100),
                          a = make_square_raster(101:200)))
stk <- terra::rast(stk)
names(stk) <- c('a', 'a')

circ <- make_circle(3, 2, 4, sf::st_crs(ras))

exact_extract(rast, circ)

# [[1]]
#   value coverage_fraction
# 1 15085      3.266380e-09
# 2 15086      7.934445e-10

These inputs should be detected and handled correctly or an error thrown.