Skip to content

Commit

Permalink
Update docs with reproject query param
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSchoppe committed Oct 17, 2023
1 parent 4fe6f8a commit 941acd8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/advanced/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions docs/src/endpoints/cog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:

Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions docs/src/endpoints/stac.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 941acd8

Please sign in to comment.