[gdal-dev] new landsat-8 metadata format

Even Rouault even.rouault at mines-paris.org
Fri May 16 14:11:39 PDT 2014


> 
> I've read the "SUBDATASETS domain" section and took a look at the HDF5
> format, in particular, but I don't think that that would work for me. 

I think that should work.

> Maybe
> I'm not looking at the right place though.
> 
> The scenario:
> LC82300942013289LGN00_B1.tif
> LC82300942013289LGN00_B2.tif
> LC82300942013289LGN00_B3.tif
> LC82300942013289LGN00_B4.tif
> LC82300942013289LGN00_B5.tif
> LC82300942013289LGN00_B6.tif
> LC82300942013289LGN00_B7.tif
> LC82300942013289LGN00_B8.tif
> LC82300942013289LGN00_B9.tif
> LC82300942013289LGN00_B10.tif
> LC82300942013289LGN00_B11.tif
> LC82300942013289LGN00_BQA.tif
> LC82300942013289LGN00_MTL.txt
> 
> I'd like to open LC82300942013289LGN00_MTL.txt and get 4 datasets:
> Dataset 1:
> LC82300942013289LGN00_B1.tif
> LC82300942013289LGN00_B2.tif
> LC82300942013289LGN00_B3.tif
> LC82300942013289LGN00_B4.tif
> LC82300942013289LGN00_B5.tif
> LC82300942013289LGN00_B6.tif
> LC82300942013289LGN00_B7.tif
> LC82300942013289LGN00_B9.tif
> 
> Dataset 2:
> LC82300942013289LGN00_B8.tif
> 
> Dataset 3:
> LC82300942013289LGN00_B10.tif
> LC82300942013289LGN00_B11.tif
> 
> Dataset 4:
> LC82300942013289LGN00_BQA.tif
> 
> Maybe GetSubDatasets is not the most appropiate name for this purpose (I
> thought about that, but at that moment I couldn't think of a better name).
> Maybe GetAssociatedDatasets would be better.
> 
> Using it:
> 
> GDALDataset* poDataset = (GDALDataset *)GDALOpen(...);
> poDataset->GetRasterBand(...); // would return a band from those in Dataset
> 1 above.

You could have the dataset report subdataset names, like 
"LANDSAT8:LC82300942013289LGN00_MTL.txt:panchromatic", 
"LANDSAT8:LC82300942013289LGN00_MTL.txt:multispectral", etc... And when those 
names are passed to the Open() methods would return a dataset that would point 
to the relevant tif.

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list