# Path: mapchete/io/vector.py
# def read_vector_window(inp, tile, validity_check=True, clip_to_crs_bounds=False):
# def _read_vector_window(inp, tile, validity_check=True, clip_to_crs_bounds=False):
# def write_vector_window(
#     in_data=None,
#     out_driver="GeoJSON",
#     out_schema=None,
#     out_tile=None,
#     out_path=None,
#     bucket_resource=None,
#     allow_multipart_geometries=True,
# ):
#     def __init__(self, tile=None, features=None, schema=None, driver=None):
#     def __enter__(self):
#     def __exit__(self, *args):
# def _get_reprojected_features(
#     inp=None,
#     dst_bounds=None,
#     dst_crs=None,
#     validity_check=False,
#     clip_to_crs_bounds=False,
# ):
# def bounds_intersect(bounds1, bounds2):
#     def __init__(self):
#     def insert(self, id, bounds):
#     def intersection(self, bounds):
#     def __init__(self, features, index="rtree", allow_non_geo_objects=False, crs=None):
#     def __repr__(self):  # pragma: no cover
#     def __len__(self):
#     def __str__(self):  # pragma: no cover
#     def __getitem__(self, key):
#     def __iter__(self):
#     def items(self):
#     def keys(self):
#     def values(self):
#     def filter(self, bounds=None, bbox=None):
#     def _update_bounds(self, bounds):
#     def _get_feature_id(self, feature):
#     def _get_feature_bounds(self, feature, allow_non_geo_objects=False):
# def convert_vector(inp, out, overwrite=False, exists_ok=True, **kwargs):
# def read_vector(inp, index="rtree"):
# class VectorWindowMemoryFile:
# class FakeIndex:
# class IndexedFeatures:


from collections import OrderedDict
from shapely.geometry import box, mapping
from mapchete.io.vector import reproject_geometry
        from pystac.version import get_stac_version
import datetime
import os
        import pystac
        raise ValueError("item_id must be set")
    if max_zoom is None:
        raise ValueError("max_zoom must be set")
    if tile_pyramid is None:
        raise ValueError("tile_pyramid must be set")

    item_metadata = _cleanup_datetime(item_metadata or {})
    timestamp = (
        item_metadata.get("properties", {}).get("start_datetime")
        or item_metadata.get("properties", {}).get("end_datetime")
        or str(datetime.datetime.utcnow())
    )
    tp_grid = tile_pyramid.grid.type
    bands_schema = "{TileMatrix}/{TileRow}/{TileCol}.tif"
    # thumbnail_href = thumbnail_href or "0/0/0.tif"
    # thumbnail_type = thumbnail_type or "image/tiff; application=geotiff"
    if asset_basepath:
        bands_schema = os.path.join(asset_basepath, bands_schema)
        # thumbnail_href = os.path.join(asset_basepath, thumbnail_href)
    elif not relative_paths:
        if item_path is None:
            raise ValueError("either alternative_basepath or item_path must be set")
        bands_schema = os.path.join(os.path.dirname(item_path), bands_schema)
        # thumbnail_href = os.path.join(os.path.dirname(item_path), thumbnail_href)

    # use bounds provided or fall back to tile pyramid bounds
    bounds = bounds or tile_pyramid.bounds
    bounds_crs = bounds_crs or tile_pyramid.crs

    # bounds in tilepyramid CRS

# Path: mapchete/io/vector.py
# def read_vector_window(inp, tile, validity_check=True, clip_to_crs_bounds=False):
# def _read_vector_window(inp, tile, validity_check=True, clip_to_crs_bounds=False):
# def write_vector_window(
#     in_data=None,
#     out_driver="GeoJSON",
#     out_schema=None,
#     out_tile=None,
#     out_path=None,
#     bucket_resource=None,
#     allow_multipart_geometries=True,
# ):
#     def __init__(self, tile=None, features=None, schema=None, driver=None):
#     def __enter__(self):
#     def __exit__(self, *args):
# def _get_reprojected_features(
#     inp=None,
#     dst_bounds=None,
#     dst_crs=None,
#     validity_check=False,
#     clip_to_crs_bounds=False,
# ):
# def bounds_intersect(bounds1, bounds2):
#     def __init__(self):
#     def insert(self, id, bounds):
#     def intersection(self, bounds):
#     def __init__(self, features, index="rtree", allow_non_geo_objects=False, crs=None):
#     def __repr__(self):  # pragma: no cover
#     def __len__(self):
#     def __str__(self):  # pragma: no cover
#     def __getitem__(self, key):
#     def __iter__(self):
#     def items(self):
#     def keys(self):
#     def values(self):
#     def filter(self, bounds=None, bbox=None):
#     def _update_bounds(self, bounds):
#     def _get_feature_id(self, feature):
#     def _get_feature_bounds(self, feature, allow_non_geo_objects=False):
# def convert_vector(inp, out, overwrite=False, exists_ok=True, **kwargs):
# def read_vector(inp, index="rtree"):
# class VectorWindowMemoryFile:
# class FakeIndex:
# class IndexedFeatures:


# Path: mapchete/stac.py
from collections import OrderedDict
from shapely.geometry import box, mapping
from mapchete.io.vector import reproject_geometry
        from pystac.version import get_stac_version
import datetime
import os
        import pystac

        raise ValueError("item_id must be set")
    if max_zoom is None:
        raise ValueError("max_zoom must be set")
    if tile_pyramid is None:
        raise ValueError("tile_pyramid must be set")

    item_metadata = _cleanup_datetime(item_metadata or {})
    timestamp = (
        item_metadata.get("properties", {}).get("start_datetime")
        or item_metadata.get("properties", {}).get("end_datetime")
        or str(datetime.datetime.utcnow())
    )
    tp_grid = tile_pyramid.grid.type
    bands_schema = "{TileMatrix}/{TileRow}/{TileCol}.tif"
    # thumbnail_href = thumbnail_href or "0/0/0.tif"
    # thumbnail_type = thumbnail_type or "image/tiff; application=geotiff"
    if asset_basepath:
        bands_schema = os.path.join(asset_basepath, bands_schema)
        # thumbnail_href = os.path.join(asset_basepath, thumbnail_href)
    elif not relative_paths:
        if item_path is None:
            raise ValueError("either alternative_basepath or item_path must be set")
        bands_schema = os.path.join(os.path.dirname(item_path), bands_schema)
        # thumbnail_href = os.path.join(os.path.dirname(item_path), thumbnail_href)

    # use bounds provided or fall back to tile pyramid bounds
    bounds = bounds or tile_pyramid.bounds
    bounds_crs = bounds_crs or tile_pyramid.crs

    # bounds in tilepyramid CRS

    left, bottom, right, top = reproject_geometry(