I am using gIntersection (package rgeos) to intersect a polygon shapefile containing 20 buffers zones, with another polygon shapefile containing "ground occupation mode (GOM)" (an area divided in polygons where one polygon can be "forest", another "urban area", etc)
what I want to get : a SpatialPolygonDataFrame or Shapefile in which there is an attribute "ID "(corresponding to every buffer ID, therefore going from 1 to 20) and an attribute for every type of GOM in which the value is equal to the area of the said GOM for the corresponding buffer ID.
for a buffer area set to 450, the dataframe would look like
OR
What I actually get when doing gIntersection :
227 SpatialPolygon objects corresponding to each part of GOM polygon caught in the intersection process. the R console gives me a lot of "slots" informations such as area, coordinates etc for each of these 227 polygons, so I guess the information is there, but I can't manage to make it a SpatialPolygonDataFrame or Shapefile with the informations displayed as previously shown.
I have no formation in spatial data analysis on R but what I learned by myself thanks to google, and I'm afraid this move is quite above my level, would any of you have a trick for me ?
Thanks a lot for reading, and thanks for providing amazing solutions (this website has been really helpful to me so far)
أكثر...
what I want to get : a SpatialPolygonDataFrame or Shapefile in which there is an attribute "ID "(corresponding to every buffer ID, therefore going from 1 to 20) and an attribute for every type of GOM in which the value is equal to the area of the said GOM for the corresponding buffer ID.
for a buffer area set to 450, the dataframe would look like

OR

What I actually get when doing gIntersection :
227 SpatialPolygon objects corresponding to each part of GOM polygon caught in the intersection process. the R console gives me a lot of "slots" informations such as area, coordinates etc for each of these 227 polygons, so I guess the information is there, but I can't manage to make it a SpatialPolygonDataFrame or Shapefile with the informations displayed as previously shown.
I have no formation in spatial data analysis on R but what I learned by myself thanks to google, and I'm afraid this move is quite above my level, would any of you have a trick for me ?
Thanks a lot for reading, and thanks for providing amazing solutions (this website has been really helpful to me so far)
أكثر...