[gdal-dev] new landsat-8 metadata format

Even Rouault even.rouault at mines-paris.org
Fri May 16 10:56:04 PDT 2014


Daniel,

There's no real need of a new API for that (although it might be cleaner to 
have a dedicated one at some point). I'd note that your proposed API would 
only work for a single subdataset, not a vector of them.

Anyway, the subdatasets mechanism already exist in many drivers and should do 
what you need. You can read the "SUBDATASETS domain" section of 
http://www.gdal.org/gdal_datamodel.html and have a look at the code of the 
mentionned drivers to see how they do that.

Another question I have is : how close or far would be Landsat8 support  from 
the existing code of the FAST driver. I see that FAST relies on "raw" bands, 
whereas you mention .tif for Landsat 8 + the change of metadata format. So it 
might be more appropriate to have a new driver if technically there is little 
common points between the drivers.

Best regards,

Even

> Hi, I'm writing to you because I need support for the new Landsat-8
> metadata format (_MTL.txt file)
> 
> I took a look at the latest version, 1.11.0, and I couldn't find anything
> on the matter. So, I was thinking I could add support for the new format by
> myself.
> 
> There are 3 groups of bands: panchromatic, multispectral and thermal. One
> .tif file for each band and then the MTL file with all the info. I'd like
> to open the MTL file, using GDAL, and have access to all of them. So, what
> I was thinking was that I could add a public method (virtual) to the
> GDALDataset class, lets say GetSubDatasets, that would allow a dataset to
> return associated subdatasets. Then, in the FASTDataset class, if I detect
> that I'm trying to open a MTL file, I could make the FASTDataset::Open
> method return a Dataset (as it does now) containing only the multispectral
> bands and then with the overridden GetSubDatasets method I could get a
> vector with the other 2 datasets: one with the panchromatic band and
> another one with the thermal bands.
> 
> What do you think?
> 
> Any idea, suggestion or comment is very welcome :)
> 
> Sample:
> 
> class CPL_DLL GDALDataset : public GDALMajorObject
> {
> [...]
> public:
>     virtual GDALDataset* GetSubDatasets() { return NULL; }
> [...]
> }
> 
> class FASTDataset : public GDALPamDataset
> {
> [...]
> private:
>     GDALDataset* porSubDatasets;
> [...]
> public:
>     virtual GDALDataset* GetSubDatasets();
> [...]
> }
> 
> GDALDataset *FASTDataset::Open( GDALOpenInfo * poOpenInfo )
> {
>     /**
> 
>     IF mtl
>         LOAD main dataset
>         LOAD subdatasets
>         RETURN main dataset
> 
>     **/
> 
>     int i;
> 
>     if(poOpenInfo->nHeaderBytes < 1024)
>         return NULL;
> 
> [...]
> }
> 
> Thanks in advance.
> 
> Regards,
> Daniel.

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


More information about the gdal-dev mailing list