Skip to content

multidim GDALDatasetFromArray RasterIO: read directly from MDArray when dataset is pixel interleaved#14224

Open
rouault wants to merge 3 commits intoOSGeo:masterfrom
rouault:emit_dataset_optim
Open

multidim GDALDatasetFromArray RasterIO: read directly from MDArray when dataset is pixel interleaved#14224
rouault wants to merge 3 commits intoOSGeo:masterfrom
rouault:emit_dataset_optim

Conversation

@rouault
Copy link
Member

@rouault rouault commented Mar 24, 2026

Fixes performance issue when reading EMIT datasets like:

from osgeo import gdal

ds = gdal.OpenEx("EMIT_L2A_RFL_001_20260322T161959_2608110_026.nc", gdal.OF_MULTIDIM_RASTER)
rg = ds.GetRootGroup()
ar = rg.OpenMDArray("reflectance")
resampled_ar = ar.GetResampled(
    [None, None, ar.GetDimensions()[2]],
    gdal.GRIORA_NearestNeighbour, None
)
resampled_ds = resampled_ar.AsClassicDataset(1, 0)
print(resampled_ds.ReadAsArray(1500, 1500, 1, 1))

Note: the first commit is a no-op split of the monolithic gcore/gdalmultidim.cpp into several files under a new gcore/multidim/ subdirectry

@rouault rouault added this to the 3.13.0 milestone Mar 24, 2026
@rouault rouault force-pushed the emit_dataset_optim branch from dfa00c2 to bce2fd3 Compare March 25, 2026 00:23
rouault added 3 commits March 25, 2026 01:58
…en dataset is pixel interleaved

Fixes performance issue when reading EMIT datasets like:
```python
from osgeo import gdal

ds = gdal.OpenEx("EMIT_L2A_RFL_001_20260322T161959_2608110_026.nc", gdal.OF_MULTIDIM_RASTER)
rg = ds.GetRootGroup()
ar = rg.OpenMDArray("reflectance")
resampled_ar = ar.GetResampled(
    [None, None, ar.GetDimensions()[2]],
    gdal.GRIORA_NearestNeighbour, None
)
resampled_ds = resampled_ar.AsClassicDataset(1, 0)
print(resampled_ds.ReadAsArray(1500, 1500, 1, 1))
```
@rouault rouault force-pushed the emit_dataset_optim branch from bce2fd3 to 43e8c31 Compare March 25, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant