Join 使用最大重叠区域连接sfc对象并分配分类属性

Join 使用最大重叠区域连接sfc对象并分配分类属性,join,attributes,sf,Join,Attributes,Sf,想象一下下面的sfc对象 zone_A <- st_as_sfc(st_bbox(c(xmin = 0, ymin = 0, xmax = 2, ymax = 2))) zone_B <- st_as_sfc(st_bbox(c(xmin = 0, ymin = 2, xmax = 2, ymax = 4))) Zones <- st_as_sf(data.frame(class = c("A", "B"),c(zone_A, zone_B))) st_crs(Zones) &

想象一下下面的sfc对象

zone_A <- st_as_sfc(st_bbox(c(xmin = 0, ymin = 0, xmax = 2, ymax = 2)))
zone_B <- st_as_sfc(st_bbox(c(xmin = 0, ymin = 2, xmax = 2, ymax = 4)))
Zones <- st_as_sf(data.frame(class = c("A", "B"),c(zone_A, zone_B)))
st_crs(Zones) <- "WGS84"

feat_X <- st_as_sfc(st_bbox(c(xmin = 0.5, ymin = 1.25, xmax = 1.5, ymax = 3.5)))
feat_Y <- st_as_sfc(st_bbox(c(xmin = 0.1, ymin = 0.5, xmax = 0.5, ymax = 2.2)))
feat_Z <- st_as_sfc(st_bbox(c(xmin = 1.5, ymin = 2.5, xmax = 1.9, ymax = 3.5)))
feat <- st_as_sf(data.frame(name = c("X", "Y", "Z"),c(feat_X, feat_Y, feat_Z)))
st_crs(feat) <- "WGS84"

zone\u A函数的
st\u join
参数
最大。如果设置
最大值=真值
,它将“返回x个特征,其中y的字段与x的每个特征重叠最大”。请看这里-


这就是您需要的吗?

函数的
st\u join
参数
最大。如果设置
最大值=真值
,它将“返回x个特征,其中y的字段与x的每个特征重叠最大”。请看这里-

这是你需要的吗