Replies: 1 comment
-
I might be mistaken, but isn't there already something similar in the gdal_array api? I often use (outside of rasterio) this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ref: #2871
Starting the discussion on how MemoryDataset should be handled and whether it is a good idea to make it part of the rasterio public API or if there is a better alternative.
For background, MemoryDataset was introduced in rasterio 1.3.x as a way to wrap numpy arrays as a GDAL dataset. It uses the GDAL MEM driver to describe the memory layout of a numpy array. The primary advantage of this allows GDAL to directly process raster data stored in-memory as a numpy array. There are many places in rasterio that only accept a dataset as input because the underlying GDAL function requires a dataset. Currently, MemoryDataset is only used internally in rasterio and as @sgillies points out in the referenced ticket above, MemoryDataset only exists because of GDAL API requirements.
This discussion seeks to address the following:
One solution might be to have a rasterio Dataset (say RioDataset) that is accepted everywhere in the API and GDAL datasets are created internally as needed to satisify the GDAL API. RioDatasets would not directly wrap GDAL datasets, but could be easily be converted to/from GDAL datasets.
Beta Was this translation helpful? Give feedback.
All reactions