# your job: get geometry expressed in pixel coordinates first
xmin, ymin, xmax, ymax = shapely.total_bounds(geometry)
outshape = (int(round(xmax-xmin)),int(round(ymax-ymin)))
array = rasterio.features.rasterize(
[geometry], out_shape=out_shape, dtype=int)