I have a polygon of the distribution of a whale and a polygon of the North Atlantic. Both as Spatial. But now I would like to know the percentage of the area where both polygons overlap (see picture). Do you have an idea how I can achieve this? My attempts with raster::intersect and gIntersection have unfortunately failed, because as a beginner I still have no understanding of what I should do. Thank you in advance!
Nordatlantik = st_read('Daten/Nordatlantik.kml')
Nordatlantik_n <- st_zm(Nordatlantik[1], drop=T, what='ZM')
as.data.frame(Nordatlantik_n) -> Nordatlantik.df
as(Nordatlantik_n, "Spatial") -> polygon.Nordatlantik
plot(polygon.Nordatlantik)
Shp_Minke_whale = st_read('Daten/Minky_Whale/data_0.shp')
Minke_whale_spatial = as(Shp_Minke_whale, 'Spatial')
plot(Minke_whale_spatial)
plot(polygon.Nordatlantik,
add=TRUE)
gIntersection(Minke_whale_spatial,polygon.Nordatlantik)
raster::area(Minke_whale_spatial)
raster::area(polygon.Nordatlantik)
raster::intersect(Minke_whale_spatial,polygon.Nordatlantik)