多边形列表R.

时间:2015-10-05 16:45:17

标签: r sp

我有一个矩阵列表pl。在每个矩阵中,第一列是经度坐标和第二纬度坐标。

pl[[1]]
          [,1]      [,2]
[1,] -170.7564 -14.36915
[2,] -170.7375 -14.36692
[3,] -170.7564 -14.36915
[4,] -170.7564 -14.36915

pl[[2]]
          [,1]     [,2]
 [1,] 20.00975 39.69194
 [2,] 19.63475 40.13919
 [3,] 19.47862 40.35027
 [4,] 19.38780 40.81030
 [5,] 19.44527 41.12943
 [6,] 19.54308 41.57388
 [7,] 19.47002 41.85503
 [8,] 19.36832 41.84918
 [9,] 19.38110 41.99947
[10,] 19.37669 42.12443
[11,] 19.62082 42.58835
[12,] 19.76418 42.50808
[13,] 19.91584 42.51055
[14,] 20.50891 42.23026
[15,] 20.51831 41.23388
[16,] 20.98332 40.85693
[17,] 21.01053 40.72194
[18,] 20.71082 40.26501
[19,] 20.31834 39.98443
[20,] 20.29611 39.79501
[21,] 20.00975 39.69194

pl我创建一个SpatialPolygons对象

bound.pol <- SpatialPolygons(list(Polygons(
    list(Polygon(box.sel, FALSE),
    list(Polygon(pl[[1]], TRUE),
         Polygon(pl[[2]], TRUE),
         ....
        ), '0')))

其中

box.sel
     [,1] [,2]
[1,] -180  -90
[2,]  180  -90
[3,]  180   90
[4,] -180   90
[5,] -180  -90

是选定的区域。

我的问题是:有没有办法在列表中包含bound.pol所有pl而不必逐个包含它们?

由于

0 个答案:

没有答案