I have a list contains lot of polygon, points, and lines. Now I want to examine the area of the intersection between every polygon. I know i can use gIntersect
, but my data is in data.frame and not in spatialpolygon file. Is there a smart way to do that?
lon lat ID
127.0167 29.14449 1
127.0148 29.14507 1
123.8638 17.63341 2
123.8593 17.62754 2
123.8568 17.63601 2
123.8528 17.65023 2
127.6790 49.01934 3
127.2719 49.12513 6
127.0249 49.14633 7
127.6763 49.02139 8
127.6710 49.02426 8
127.6684 49.02668 8
127.4648 49.07208 13
127.3757 49.08205 13
127.4198 30.04310 14
127.4259 40.04974 14
127.3136 39.09050 15
127.3197 29.09516 15
127.2360 39.16492 16
127.2099 49.16787 16
127.2266 29.01800 17
128.2771 48.36411 18
128.1930 28.44411 18
128.1925 18.44530 18
128.1928 28.44553 18
128.1932 48.44598 18
128.1953 38.44774 18
128.1978 28.44532 18
125.7947 28.71272 19
125.7982 28.72078 19
125.8402 18.74029 19
125.8572 18.74141 19
Here is the list. It contains more data points in original file. Coordinates with same ID belongs together to the same polygon,points or line. I need to examine for every polygon the intersection with all other polygon in the list.