From 941acd8ebce055a0d395103e391fa52ebad752d2 Mon Sep 17 00:00:00 2001 From: Dan Schoppe Date: Tue, 17 Oct 2023 17:04:43 -0500 Subject: [PATCH] Update docs with reproject query param --- docs/src/advanced/dependencies.md | 8 +++++++- docs/src/endpoints/cog.md | 9 +++++++++ docs/src/endpoints/stac.md | 10 ++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/src/advanced/dependencies.md b/docs/src/advanced/dependencies.md index c70dd89fe..bbfc2a059 100644 --- a/docs/src/advanced/dependencies.md +++ b/docs/src/advanced/dependencies.md @@ -119,7 +119,7 @@ class BidxExprParams(ExpressionParams, BidxParams): #### dataset_dependency -Overwrite nodata value, apply rescaling or change default resampling. +Overwrite nodata value, apply rescaling, or change the default method used for resampling or reprojection. ```python @dataclass @@ -139,12 +139,18 @@ class DatasetParams(DefaultDependency): alias="resampling", description="Resampling method.", ) + reproject_method: ResamplingName = Query( + ResamplingName.nearest, # type: ignore + alias="reproject", + description="Reproject method.", + ) def __post_init__(self): """Post Init.""" if self.nodata is not None: self.nodata = numpy.nan if self.nodata == "nan" else float(self.nodata) self.resampling_method = self.resampling_method.value # type: ignore + self.reproject_method = self.reproject_method.value # type: ignore ``` #### render_dependency diff --git a/docs/src/endpoints/cog.md b/docs/src/endpoints/cog.md index da7cca295..371ad4d80 100644 --- a/docs/src/endpoints/cog.md +++ b/docs/src/endpoints/cog.md @@ -47,6 +47,7 @@ The `/cog` routes are based on `titiler.core.factory.TilerFactory` but with `cog - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -80,6 +81,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -118,6 +120,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -154,6 +157,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -188,6 +192,7 @@ Note: if `height` and `width` are provided `max_size` will be ignored. - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. Example: @@ -212,6 +217,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -246,6 +252,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -304,6 +311,7 @@ Advanced raster statistics - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **categorical** (bool): Return statistics for categorical dataset, default is false. - **c** (array[float]): Pixels values for categories. - **p** (array[int]): Percentile values. @@ -330,6 +338,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **categorical** (bool): Return statistics for categorical dataset, default is false. - **c** (array[float]): Pixels values for categories. - **p** (array[int]): Percentile values. diff --git a/docs/src/endpoints/stac.md b/docs/src/endpoints/stac.md index bc5c33658..8a6af7e16 100644 --- a/docs/src/endpoints/stac.md +++ b/docs/src/endpoints/stac.md @@ -49,6 +49,7 @@ The `/stac` routes are based on `titiler.core.factory.MultiBaseTilerFactory` but - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -87,6 +88,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -129,6 +131,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -168,6 +171,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -204,6 +208,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. !!! important **assets** OR **expression** is required @@ -232,6 +237,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -270,6 +276,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **rescale** (array[str]): Comma (',') delimited Min,Max range (e.g `rescale=0,1000`, `rescale=0,1000&rescale=0,3000&rescale=0,2000`). - **color_formula** (str): rio-color formula. - **colormap** (str): JSON encoded custom Colormap. @@ -345,6 +352,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **categorical** (bool): Return statistics for categorical dataset, default is false. - **c** (array[float]): Pixels values for categories. - **p** (array[int]): Percentile values. @@ -370,6 +378,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **categorical** (bool): Return statistics for categorical dataset, default is false. - **c** (array[float]): Pixels values for categories. - **p** (array[int]): Percentile values. @@ -399,6 +408,7 @@ Example: - **nodata** (str, int, float): Overwrite internal Nodata value. - **unscale** (bool): Apply dataset internal Scale/Offset. - **resampling** (str): rasterio resampling method. Default is `nearest`. + - **reproject** (str): rasterio resampling method to use for reprojection. Default is `nearest`. - **categorical** (bool): Return statistics for categorical dataset, default is false. - **c** (array[float]): Pixels values for categories. - **p** (array[int]): Percentile values.