Skip to content

Instantly share code, notes, and snippets.

This is a proof-of-concept for a numpy/rasterio/shapely based implementation of partial coverage rasterization. It works, barely.

The current GDAL algorithms allow for two methods, both binary: the default centroid method and the all-touched method.

This is a third alternative which provides the percentage of coverage of each cell from 0 to 100 which can be thought of as pixel weights for many spatial analyses.

See discussion at rasterio/rasterio#232