5 Dec 2014

QspatiaLite Use Case: Get Subselection of Grid which Covers Polygon

Here's another short SQL-query which I used to get a subselect from a rectengular grid. Aim is to keep only the grid-cells that fully cover the area of a second polygon-layer - cells which do not overlap the polygon's area completely will be skipped from the new grid-layer.

select 
  g.*
from(select Gunion(geometry) as geom
           from MYPLGN) as u, grid as g
where area(intersection(g.geometry, u.geom)) = area(g.geometry)

1 Jun 2011

Drawing Grids in R

Here's an example of how to draw a grid in R and how to fill it.
I did use the grid-package and its functions for displaying species cover values at squares of a recording frame...