Open bdevoghel opened 2 weeks ago
Thanks for the comprehensive issue! This makes perfect sense to me. The only thing I'm debating is whether we should get rid of the raw chip sampling entirely and only have RasterStats
sample transformed chips since that seems more intuitive to me. The tricky thing there would be ensuring channel_order
is handled correctly in StatsTransformer
and ensuring that we don't break backward compatibility.
Let me think about it some more and get back to you about a PR.
🚀 Feature
When computing RasterStats from a RasterSource (eg. in my case, to create a StatsTransformer), the chips are retrieved as raw chips. It would be great to allow to get transformed chips too.
Motivation
I'd like to obtain a StatsTransformer from a RasterSource which has
raster_transforms
, in order to normalize (with this StatsTransformer) the RasterSource. Not allowing for this implies mathematical limitations, as normalization and transformation are not commutative.Pitch
raster_stats.get_chip()
should have an additional (optional) parameter to define if the chip to get is raw or not.This option should be propagated in methods using
get_chip()
to allow for its use, this should be straightforward.Alternatives
No alternatives are available at the moment, as far as I know.
Additional context
I would be available to implement a fix in a PR if this is validated.