# NOT RUN {
library(sf)
pts1 <- rbind(c(1, 2), c(3, 2))
pts2 <- rbind(c(1, 1), c(2, 3), c(2, 1))
pts3 <- rbind(c(2, 2), c(3, 3))
cp1 <- component_from_sfg(st_multipoint(pts1), 0.3)
cp2 <- component_from_sfg(st_multipoint(pts2), 0.6)
cp3 <- component_from_sfg(st_multipoint(pts3), 1)
pp1 <- create_pgeometry(list(cp1, cp2, cp3), "PLATEAUPOINT")
pts4 <- rbind(c(0, 0), c(1, 1))
pts5 <- rbind(c(2, 3), c(1.2, 1.9), c(2, 1))
pts6 <- rbind(c(3, 1), c(1.5, 0.5))
cp4 <- component_from_sfg(st_multipoint(pts4), 0.4)
cp5 <- component_from_sfg(st_multipoint(pts5), 1)
cp6 <- component_from_sfg(st_multipoint(pts6), 0.7)
pp2 <- create_pgeometry(list(cp4, cp5, cp6), "PLATEAUPOINT")
pp1
pp2
spa_intersection(pp1, pp2)
spa_intersection(pp1, pp2, itype = "prod") #changing the t-norm
spa_union(pp1, pp2)
spa_difference(pp1, pp2)
# }
Run the code above in your browser using DataLab