-
Notifications
You must be signed in to change notification settings - Fork 179
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
https://github.com/cogeotiff/rio-tiler/blob/master/rio_tiler/io/base.py#L458-L460
For this we'll need to update
titiler/src/titiler/core/titiler/core/dependencies.py
Lines 128 to 180 in d1f4f41
# Dependencies for MultiBaseReader (e.g STACReader) | |
@dataclass | |
class AssetsBidxParams(DefaultDependency): | |
"""Asset and Band indexes parameters.""" | |
assets: Optional[str] = Query( | |
..., title="Asset indexes", description="comma (',') delimited asset names.", | |
) | |
bidx: Optional[str] = Query( | |
None, title="Band indexes", description="comma (',') delimited band indexes", | |
) | |
def __post_init__(self): | |
"""Post Init.""" | |
if self.assets is not None: | |
self.kwargs["assets"] = self.assets.split(",") | |
if self.bidx is not None: | |
self.kwargs["indexes"] = tuple( | |
int(s) for s in re.findall(r"\d+", self.bidx) | |
) | |
@dataclass | |
class AssetsBidxExprParams(DefaultDependency): | |
"""Assets, Band Indexes and Expression parameters.""" | |
assets: Optional[str] = Query( | |
None, title="Asset indexes", description="comma (',') delimited asset names.", | |
) | |
expression: Optional[str] = Query( | |
None, | |
title="Band Math expression", | |
description="rio-tiler's band math expression (e.g B1/B2)", | |
) | |
bidx: Optional[str] = Query( | |
None, title="Band indexes", description="comma (',') delimited band indexes", | |
) | |
def __post_init__(self): | |
"""Post Init.""" | |
if not self.assets and not self.expression: | |
raise MissingAssets( | |
"assets must be defined either via expression or assets options." | |
) | |
if self.assets is not None: | |
self.kwargs["assets"] = self.assets.split(",") | |
if self.expression is not None: | |
self.kwargs["expression"] = self.expression | |
if self.bidx is not None: | |
self.kwargs["indexes"] = tuple( | |
int(s) for s in re.findall(r"\d+", self.bidx) | |
) |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity