odc.geo.xr.rasterize
- odc.geo.xr.rasterize(poly, how, *, value_inside=True, all_touched=False)[source]
Generate raster from geometry.
This method is a wrapper for
rasterio.features.make_mask()
.- Parameters:
poly (
Geometry
) – Geometry shape to rasterize.how (
Union
[float
,int
,Resolution
,GeoBox
]) – This could be either just resolution or a GeoBox that fully defines output raster extent/resolution/projection.all_touched (
bool
) – IfTrue
, all pixels touched by geometries will be burned in. IfFalse
, only pixels whose center is within the polygon or that are selected by Bresenham’s line algorithm will be burned in.value_inside (
bool
) – By default pixels inside a polygon will have value ofTrue
andFalse
outside, but this can be flipped.
- Return type:
- Returns:
geo-registered data array