geocube combines the interfaces of:
and is powered by GDAL using:
When getting started, the API documentation to start reading would be
The simplest example would be to rasterize a single column:
from geocube.api.core import make_geocube out_grid = make_geocube( vector_data="path_to_file.gpkg", measurements=["column_name"], resolution=(-0.0001, 0.0001), ) out_grid["column_name"].rio.to_raster("my_rasterized_column.tif")
However, life is only this simple when your data is perfectly clean, geospatially unique, and numeric. The good news is that geocube supports a variety of use cases and custom rasterization functions if your dataset does not meet these criteria (see: Usage Examples).