From 8cc6363092d3bfe9876ff1365eb0ccb3bf706335 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Fri, 3 Nov 2023 08:39:35 +0100 Subject: [PATCH] remove reverse option --- CHANGES.md | 4 ++++ titiler/pgstac/mosaic.py | 16 ---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 00efd04..2d2520e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Release Notes +## 1.0.0a3 (2023-11-03) + +* remove `reverse` option in `PGSTACBackend` mosaic backend. Reverse item order should be achieved with STAC search sortby. + ## 1.0.0a2 (2023-11-02) * update titiler's dependency to `>=0.15.2,<0.16` diff --git a/titiler/pgstac/mosaic.py b/titiler/pgstac/mosaic.py index a6cd118..d1112a9 100644 --- a/titiler/pgstac/mosaic.py +++ b/titiler/pgstac/mosaic.py @@ -293,7 +293,6 @@ def tile( tile_x: int, tile_y: int, tile_z: int, - reverse: bool = False, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, @@ -318,9 +317,6 @@ def tile( f"No assets found for tile {tile_z}-{tile_x}-{tile_y}" ) - if reverse: - mosaic_assets = list(reversed(mosaic_assets)) - def _reader( item: Dict[str, Any], x: int, y: int, z: int, **kwargs: Any ) -> ImageData: @@ -334,7 +330,6 @@ def point( lon: float, lat: float, coord_crs: CRS = WGS84_CRS, - reverse: bool = False, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, @@ -356,9 +351,6 @@ def point( if not mosaic_assets: raise NoAssetFoundError(f"No assets found for point ({lon},{lat})") - if reverse: - mosaic_assets = list(reversed(mosaic_assets)) - def _reader( item: Dict[str, Any], lon: float, @@ -379,7 +371,6 @@ def part( bbox: BBox, dst_crs: Optional[CRS] = None, bounds_crs: CRS = WGS84_CRS, - reverse: bool = False, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, @@ -406,9 +397,6 @@ def part( if not mosaic_assets: raise NoAssetFoundError("No assets found for bbox input") - if reverse: - mosaic_assets = list(reversed(mosaic_assets)) - def _reader(item: Dict[str, Any], bbox: BBox, **kwargs: Any) -> ImageData: with self.reader(item, **self.reader_options) as src_dst: return src_dst.part(bbox, **kwargs) @@ -428,7 +416,6 @@ def feature( dst_crs: Optional[CRS] = None, shape_crs: CRS = WGS84_CRS, max_size: int = 1024, - reverse: bool = False, scan_limit: Optional[int] = None, items_limit: Optional[int] = None, time_limit: Optional[int] = None, @@ -457,9 +444,6 @@ def feature( if not mosaic_assets: raise NoAssetFoundError("No assets found for Geometry") - if reverse: - mosaic_assets = list(reversed(mosaic_assets)) - def _reader(item: Dict[str, Any], shape: Dict, **kwargs: Any) -> ImageData: with self.reader(item, **self.reader_options) as src_dst: return src_dst.feature(shape, **kwargs)