def geocode2pixel(geom, transform):
    """Converts geocodes to pixel coordinates

    Args:
        geom (shapely.geometry.polygon.Polygon): geometry to be transformed.
        transform (rasterio.Affine): the transform to be applied.

    Returns:
        dict: a geometry that has been transformed.
            Exterior is a list of coordinates.
            [(x0, y0), (x1, y1), (x2, y2), ...]
            Interior is a list of lists of coordinates.
            Multipart polygon is not supported.
    """
    ext_coords = [(~transform) * coord for coord in geom.exterior.coords]
    int_coords = [[(~transform) * coord for coord in interior.coords]
                  for interior in geom.interiors]
    return {'exterior': ext_coords, 'interiors': int_coords}