EnMAP-Box / enmap-box

EnMAP-Box source code repository. See https://enmap-box.readthedocs.io for documentation
GNU General Public License v3.0
38 stars 16 forks source link

add custom raster data provider for lazy evaluation #1008

Open janzandr opened 3 weeks ago

janzandr commented 3 weeks ago

Currently we use GDAL VRTs with Python pixel functions for implementing products with lazy evaluation (e,g, spectral indices). But VRTs do have some limitations:

A custom QgsRasterDataProvider is way more flexible:

It is proposed to implement a LazyEvaluatedRasterDataProvider, that offers several features. E.g.

All the above are just a collection of functionalities that the user should be able to use out-of-the-box. For more complex/custom operations, the user can implement their owns processing functions, which will be evaluated on-the-fly.

Finally, we should choose a unique file extension for the provider and register it in QGIS, so that the correct raster layer with our provider is created. Similar to the *.geojson extension for GeoJSON, it is proposed to introduce the *.lerjson or lazyjson extension representing a LazyEvaluatedRasterJSON.

janzandr commented 3 weeks ago

The specification of a lazily evaluated raster could look like this: image