gIntersection for several polygons
Hi Rebecka, I can't help you with your homerange problem right now, but maybe give you a hint about the intersection. I also unsuccesfully tried to use gIntersection until I was told that the raster (!) package has a function "intersection" which worked perfectly for me. My last R-project was also on wind farms, where I had to calculate presence values for different species and two buffers for each single turbine. Maybe sth of this is useful for you (though horribly coded I fear). In case ... drop me a line. Cheers Bernd Am 11.11.2014, 10:09 Uhr, schrieb Rebecka <rehe0001 at stud.slu.se>:
Hi! I?m a beginner with R and I?m trying to calculate area of polygons (homerange areas of 31 individuals) intersecting with bufferzones around 4348 number of windfarms. I have read this webpage as a help: http://rstudio-pubs-static.s3.amazonaws.com/7993_6b081819ba184047802a508a7f3187cb.html I?ve succeeded to create bufferzones with gBuffer. Now I would like to do gIntersection for every individuals homerange overlap with bufferzones. I?ve tried to create homeranges as a first step using gConvexHull but I don?t understand how to this by each id for every individual. I have a spatialpointsdataframe with one column called "Object_ID" and also columns "x" and "y" for coordinates and every row corresponds to one position. Every individual have a lot of coordinates (all individuals have over 94000 positions together). Is it possible to create one homerange for every individual using gConvexHull? byid=TRUE just do it for every row when I tried. I also tried to go around the problem creating mcp (packageadehabitatHR) for every individual. mcpAll<-mcp(animalSpdf[,2]) *gives Spatialpolygons* Then I tried to use that in gIntersection inter1<-gIntersection(mcpAll,Prop1,byid=TRUE) *Prop1 is my windfarms with bufferzones* but it only gave a NULL result for inter1. CRS are same for both and I know that they should overlap. Any ideas how to solve this? Thanks!! Rebecka Hedfors -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/gIntersection-for-several-polygons-tp7587418.html Sent from the R-sig-geo mailing list archive at Nabble.com.
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Bernd Vogelgesang Siedlerstra?e 2 91083 Baiersdorf/Igelsdorf Tel: 09133-825374