Skip to content

Commit

Permalink
Merge pull request #82 from JackDunnNZ/main
Browse files Browse the repository at this point in the history
rio-tiler v7 compatibility
  • Loading branch information
vincentsarago authored Dec 20, 2024
2 parents 2751734 + 9d80355 commit 5aaa59e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 0.11.0 (TBD)

* update rio-tiler requirement to `>=7.0,<8.0`
* replace `geographic bounds` with dataset bounds in `Reader.info()` method's response **breaking change**
* remove `minzoom` and `maxzoom` properties in `Info` model **breaking change**

## 0.10.1 (2023-08-21)

* calculate scene bounds from multipolygons for Sentinel-1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = ["rio-tiler>=5.0,<7.0", "boto3"]
dependencies = ["rio-tiler>=7.0,<8.0", "boto3"]

[project.optional-dependencies]
test = ["pytest", "pytest-cov"]
Expand Down
6 changes: 3 additions & 3 deletions rio_tiler_pds/copernicus/aws/dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from rio_tiler.models import BandStatistics, ImageData, Info, PointData
from rio_tiler.mosaic import mosaic_point_reader, mosaic_reader
from rio_tiler.types import BBox
from rio_tiler.utils import CRS_to_uri


@attr.s
Expand Down Expand Up @@ -107,9 +108,8 @@ def _reader(asset: str, lon: float, lat: float, **kwargs) -> PointData:
def info(self) -> Info:
"""info."""
meta = {
"bounds": self.geographic_bounds,
"minzoom": self.minzoom,
"maxzoom": self.maxzoom,
"bounds": self.bounds,
"crs": CRS_to_uri(self.crs) or self.crs.to_wkt(),
"band_metadata": [("b1", {})],
"band_descriptions": [("b1", "")],
"dtype": "float32",
Expand Down
15 changes: 9 additions & 6 deletions tests/test_copernicus_dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import morecantile
import pytest
import rasterio
from rasterio.crs import CRS

from rio_tiler_pds.copernicus.aws import Dem30Reader, Dem90Reader

Expand Down Expand Up @@ -53,11 +54,12 @@ def test_Dem30Reader(rio):
assert dem.minzoom == 7
assert dem.maxzoom == 8
assert dem.bounds == (-180, -90, 180, 90)
assert dem.geographic_bounds == (-180, -90, 180, 90)
assert dem.get_geographic_bounds(CRS.from_epsg(4326)) == (-180, -90, 180, 90)

info = dem.info()
assert info.minzoom == 7
assert info.maxzoom == 8
assert info.bounds == dem.bounds
crs = info.crs
assert CRS.from_user_input(crs) == dem.crs

assert dem.statistics()["b1"]

Expand Down Expand Up @@ -147,11 +149,12 @@ def test_Dem90Reader(rio):
assert dem.minzoom == 6
assert dem.maxzoom == 7
assert dem.bounds == (-180, -90, 180, 90)
assert dem.geographic_bounds == (-180, -90, 180, 90)
assert dem.get_geographic_bounds(CRS.from_epsg(4326)) == (-180, -90, 180, 90)

info = dem.info()
assert info.minzoom == 6
assert info.maxzoom == 7
assert info.bounds == dem.bounds
crs = info.crs
assert CRS.from_user_input(crs) == dem.crs

assert dem.statistics()["b1"]

Expand Down

0 comments on commit 5aaa59e

Please sign in to comment.