[gdal-dev] new landsat-8 metadata format

Daniel Testa danieltesta at suremptec.com.ar
Fri May 16 07:01:45 PDT 2014


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140516/0e65953a/attachment.html>


More information about the gdal-dev mailing list