When I encountered an error using the st_join function——Error in checkForRemoteErrors(val) : 4 nodes produced errors; first error: Loop 0 is not valid: Edge 9 is degenerate (duplicate vertex) #2364
result_list <- parLapply(cl, chunks, function(indices) {
st_join(shape[indices, ], glo_shape1[, c("NAME_ZH", "geometry")], largest =TRUE)
})
Error in checkForRemoteErrors(val) :
4 nodes produced errors; first error: Loop 0 is not valid: Edge 9 is degenerate (duplicate vertex)
Is it related to parallelism
shape <- st_make_valid(shape) glo_shape1 <- st_make_valid(glo_shape)
library(parallel) sf::sf_use_s2(FALSE) num_cores <- 8
cl <- makeCluster(num_cores) clusterEvalQ(cl, { library(sf) })
clusterExport(cl, c("shape", "glo_shape1")) chunks <- split(1:nrow(shape), 1:num_cores)
result_list <- parLapply(cl, chunks, function(indices) { st_join(shape[indices, ], glo_shape1[, c("NAME_ZH", "geometry")], largest =TRUE) }) Error in checkForRemoteErrors(val) : 4 nodes produced errors; first error: Loop 0 is not valid: Edge 9 is degenerate (duplicate vertex) Is it related to parallelism