[GIS] How to generate a fishnet grid and a matrix of percentage of overlapping in R

polygonizerrastervector-grid

I'm trying use R for create a fishnet grid like in arcGIS with many cells of same size.

In the arcGIS 9.3 we have the option of create a polygon with many small square polygons (eg. 1 x 1 degree of lat and long) in the extent of our study area using the tool 'create fishnet' (http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Create_Fishnet_(Data_Management)) and after aply the tool 'Feature to Polygon' to transform the polygon lines in square polygons. Other option is use the “Hawth’s Tools” extension and acess the “Sampling Tools” -> “Create Vector Grid (line/polygon) but the extension only work properly until arcGIS 9.2.

Then I want create the fishnet grid (polygon with many regular squares) and after calculate many percentage of overlap of some polygons to each cell of the fishnet and create a matrix with each cell in lines and each polygon in the columns, like this matrix.

Best Answer

If you mean by fishnet grid a regular spatial grid, there are several options available in R:

  • Simply use a matrix.
  • Use the SpatialGrid/Pixels classes from the sp package
  • Use the raster format from the raster package.

A good overview of spatial packages in R is given on the CRAN Spatial Task View.