From 993af6cc8971fbc5dab4c292a5b4776f43b7915a Mon Sep 17 00:00:00 2001 From: Vincent Sarago Date: Wed, 17 Jan 2024 10:15:52 +0100 Subject: [PATCH] update rio-tiler version and use new options for better statistics (#754) --- CHANGES.md | 7 +++++++ src/titiler/core/pyproject.toml | 2 +- src/titiler/core/titiler/core/factory.py | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1bf050491..8e0ef610b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Release Notes +## 0.17.0 (2024-01-17) + +### titiler.core + +* update `rio-tiler` version to `>6.3.0` +* use new `align_bounds_with_dataset=True` rio-tiler option in GeoJSON statistics methods for more precise calculation + ## 0.16.2 (2024-01-17) ### titiler.core diff --git a/src/titiler/core/pyproject.toml b/src/titiler/core/pyproject.toml index 745728746..4101793dc 100644 --- a/src/titiler/core/pyproject.toml +++ b/src/titiler/core/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "numpy", "pydantic~=2.0", "rasterio", - "rio-tiler>=6.2.5,<7.0", + "rio-tiler>=6.3.0,<7.0", "morecantile>=5.0,<6.0", "simplejson", "typing_extensions>=4.6.1", diff --git a/src/titiler/core/titiler/core/factory.py b/src/titiler/core/titiler/core/factory.py index ccab84b8c..6fcf0b282 100644 --- a/src/titiler/core/titiler/core/factory.py +++ b/src/titiler/core/titiler/core/factory.py @@ -437,7 +437,7 @@ def statistics( response_class=GeoJSONResponse, responses={ 200: { - "content": {"application/json": {}}, + "content": {"application/geo+json": {}}, "description": "Return dataset's statistics from feature or featureCollection.", } }, @@ -472,6 +472,7 @@ def geojson_statistics( shape, shape_crs=coord_crs or WGS84_CRS, dst_crs=dst_crs, + align_bounds_with_dataset=True, **layer_params, **image_params, **dataset_params, @@ -1270,7 +1271,7 @@ def statistics( response_class=GeoJSONResponse, responses={ 200: { - "content": {"application/json": {}}, + "content": {"application/geo+json": {}}, "description": "Return dataset's statistics from feature or featureCollection.", } }, @@ -1308,6 +1309,7 @@ def geojson_statistics( feature.model_dump(exclude_none=True), shape_crs=coord_crs or WGS84_CRS, dst_crs=dst_crs, + align_bounds_with_dataset=True, **layer_params, **image_params, **dataset_params, @@ -1471,7 +1473,7 @@ def statistics( response_class=GeoJSONResponse, responses={ 200: { - "content": {"application/json": {}}, + "content": {"application/geo+json": {}}, "description": "Return dataset's statistics from feature or featureCollection.", } }, @@ -1509,6 +1511,7 @@ def geojson_statistics( feature.model_dump(exclude_none=True), shape_crs=coord_crs or WGS84_CRS, dst_crs=dst_crs, + align_bounds_with_dataset=True, **bands_params, **image_params, **dataset_params,