[gdal-dev] Create a GDAL VRT for a 3D image that transposes the image dimensions

Daniel Scheffler daniel.scheffler at gfz-potsdam.de
Fri Jun 2 09:30:56 PDT 2023


Hi!

I have an image with 500 rows, 1000 columns, and 2 bands in a NetCDF 
file which stores the data in the following scheme:
- dimension 1: rows
- dimension 2: bands
- dimension 3: columns

If I now do gdal.Open('filepath').GetRasterBand(1).ReadAsArray(), I get 
a numpy array in the shape 500x2. Is it somehow possible to create a 
GDAL VRT that accesses the data as rows/columns/bands instead of 
rows/bands/columns? If yes, how would I create such a VRT using the 
Python API?

Best,
Daniel

-- 

Dr. Daniel Scheffler

Helmholtz Centre Potsdam
GFZ German Research Centre For Geosciences
Department 1 - Geodesy and Remote Sensing
Section 1.4  - Remote Sensing and Geoinformatics
Telegrafenberg, 14473 Potsdam, Germany

Phone:  +49 (0)331/288-1198
e-mail: daniel.scheffler at gfz-potsdam.de



More information about the gdal-dev mailing list