這是兩個多邊形圖層的空間連接。除非螺母中的每個特徵與渡槽的一個特徵完全相交,否則沒有簡單/單一的方式來進行空間連接。
相反,你可以獲取從渡槽的屬性表對應的堅果每個功能行的列表 -
nuts_over1 = over(nuts, aqueduct, returnList = TRUE)
或彙總具有特定功能的屬性,在這種情況下,結果可以連接回屬性表螺母。舉例來說,如果導水管相交的六個第一特徵的國家如下 -
nuts_over2 = over(
nuts,
aqueduct[, "COUNTRY"],
fn = function(x) paste(x, collapse = ", ")
)
head(nuts_over2)
COUNTRY
1 Austria, Hungary, Austria, Hungary
2 Austria, Hungary, Austria, Hungary, Slovakia, Austria, Slovakia
3 Austria, Austria, Hungary, Austria, Hungary
4 Austria
5 Austria, Austria, Austria, Austria, Austria
6 Austria, Austria
此信息可以如下接合回堅果的屬性表 -
[email protected] = cbind([email protected], nuts_over2)
head([email protected])
NUTS_ID STAT_LEVL_ SHAPE_Leng SHAPE_Area
0 AT111 3 1.089017 0.08091455
1 AT112 3 2.257319 0.20926007
2 AT113 3 2.002492 0.17728455
3 AT121 3 3.158370 0.40147321
4 AT122 3 2.956927 0.42675504
5 AT123 3 2.010415 0.14145865
COUNTRY
0 Austria, Hungary, Austria, Hungary
1 Austria, Hungary, Austria, Hungary, Slovakia, Austria, Slovakia
2 Austria, Austria, Hungary, Austria, Hungary
3 Austria
4 Austria, Austria, Austria, Austria, Austria
5 Austria, Austria