Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate AsyncBaseReader #507

Closed
vincentsarago opened this issue Aug 9, 2022 · 0 comments
Closed

deprecate AsyncBaseReader #507

vincentsarago opened this issue Aug 9, 2022 · 0 comments
Assignees

Comments

@vincentsarago
Copy link
Member

@attr.s
class AsyncBaseReader(SpatialMixin, metaclass=abc.ABCMeta):
"""Rio-tiler.io AsyncBaseReader."""
input: Any = attr.ib()
tms: TileMatrixSet = attr.ib(default=WEB_MERCATOR_TMS)
async def __aenter__(self):
"""Support using with Context Managers."""
return self
async def __aexit__(self, exc_type, exc_value, traceback):
"""Support using with Context Managers."""
pass
@abc.abstractmethod
async def info(self) -> Coroutine[Any, Any, Info]:
"""Return Dataset's info.
Returns:
rio_tile.models.Info: Dataset info.
"""
...
@abc.abstractmethod
async def statistics(
self,
**kwargs: Any,
) -> Coroutine[Any, Any, Dict[str, BandStatistics]]:
"""Return bands statistics from a dataset.
Returns:
Dict[str, rio_tiler.models.BandStatistics]: bands statistics.
"""
...
@abc.abstractmethod
async def tile(
self, tile_x: int, tile_y: int, tile_z: int, **kwargs: Any
) -> Coroutine[Any, Any, ImageData]:
"""Read a Map tile from the Dataset.
Args:
tile_x (int): Tile's horizontal index.
tile_y (int): Tile's vertical index.
tile_z (int): Tile's zoom level index.
Returns:
rio_tiler.models.ImageData: ImageData instance with data, mask and tile spatial info.
"""
...
@abc.abstractmethod
async def part(self, bbox: BBox, **kwargs: Any) -> Coroutine[Any, Any, ImageData]:
"""Read a Part of a Dataset.
Args:
bbox (tuple): Output bounds (left, bottom, right, top) in target crs.
Returns:
rio_tiler.models.ImageData: ImageData instance with data, mask and input spatial info.
"""
...
@abc.abstractmethod
async def preview(self, **kwargs: Any) -> Coroutine[Any, Any, ImageData]:
"""Read a preview of a Dataset.
Returns:
rio_tiler.models.ImageData: ImageData instance with data, mask and input spatial info.
"""
...
@abc.abstractmethod
async def point(
self, lon: float, lat: float, **kwargs: Any
) -> Coroutine[Any, Any, List]:
"""Read a value from a Dataset.
Args:
lon (float): Longitude.
lat (float): Latitude.
Returns:
list: Pixel value per bands/assets.
"""
...
@abc.abstractmethod
async def feature(
self, shape: Dict, **kwargs: Any
) -> Coroutine[Any, Any, ImageData]:
"""Read a Dataset for a GeoJSON feature.
Args:
shape (dict): Valid GeoJSON feature.
Returns:
rio_tiler.models.ImageData: ImageData instance with data, mask and input spatial info.
"""
...

It's not used and I don't see Async PROJ/GDAL being something near of something that rio-tiler should care about for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant