add merged_statistics
for multiBaseReader
#478
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ref: developmentseed/titiler#429
In
rio-tiler
v3 we removed theexpression
option in thestatistics
for better consistency (to return Per Assets statistics). We couldn't havebetween asset
expression here because themodel
would have been different:Dict[str, Dict[str, BandStatistics]]
->{"asset1": {"1": rio_tiler.models.BandStatistics, ...}}
Dict[str, BandStatistics]]
->{"asset1_1": rio_tiler.models.BandStatistics, ...}
Note: Using
expression
within the MultiBaseReader is really tricky because I guess most of the use case is to use it when STAC is hostingband per file
dataset (only one band per COG) for which we have specifically design theMultiBandReader
. The user should be aware that merged assets expression might fail if the assets don't have the same number of bands.Ideally we could require the expression to be in form of
asset1_b1+asset2_b1
but sadly it's not possible because we are using theexpression
to get names of theassets
we need to fetch (here https://github.com/cogeotiff/rio-tiler/blob/master/rio_tiler/io/base.py#L374-L378) so adding a suffix to the asset name will make the code instable IMO@geospatial-jeff @kylebarron I'm happy to discuss this a bit more
cc @giswqs