[gdal-dev] GDAL Landsat Dirver

2015-06-01 Thread liminlu0314
Hi All , 
   I am a user of GDAL. During the appliance of GDAL, I found that GDAL
doesn’t support the formats of Landsat 5, Landsat 7 and Landsat 8 data
products. Therefore I wrote a format-extension for GDAL to support the
formats of Landsat 5, Landsat 7 and Landsat 8 data products. I wondered
whether this format-extension could be adopted by GDAL. 
   The input data path is the metadata of Landsat, which are generally
named as *_MTL.txt. Three sub-datasets are included, namely Panchromatic
data, Reflective data and Thermal Infrared Sensor (TIRS) data.
   The format of sub-datasets are as following:
LANDSAT:1:F:\Data\LandSat\LS8_O_20131022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt
   Note:
   LANDSAT : identifier
   1:index of data type (0 means Panchromatic, 1means Reflective, 2
means TIRS).
   
The attachment is the source code that I wrote for Landsat data formats.
The screenshot below is the zip file structure of Landsat 5 and 8. The zip
file structure of Landsat 7 is similar to that of Landsat 5.

   
Fig 1. The zip file structure of Landsat 5 and Landsat 7
   
Fig 2. The zip file structure of Landsat 8

The short name of data driver that I newly added is LANDSAT. Three
sub-datasets are included, namely Panchromatic data, Reflective data and
TIRS data.

Below is an example. The input file is a Landsat 8 data named ‘*_MTL.txt’.
Fig 3 is the output information by gdalinfo. It can be seen that four
sub-datasets are included. 
   
Fig 3. Output information of gdalinfo.
F:\Work\GDAL\gdal-1.11.2_new\gdal-1.11.2>gdalinfo.exe
F:\Data\LandSat\LS8_O_2013
1022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt -nomd
Driver: LANDSAT/LANDSAT 7/8 GeoTiff with Metadata
Files:
F:\Data\LandSat\LS8_O_20131022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt
Size is 512, 512
Coordinate System is `'
Subdatasets:
 
SUBDATASET_1_NAME=LANDSAT:0:F:\Data\LandSat\LS8_O_20131022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt
  SUBDATASET_1_DESC=LANDSAT:Panchromatic
 
SUBDATASET_2_NAME=LANDSAT:1:F:\Data\LandSat\LS8_O_20131022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt
  SUBDATASET_2_DESC=LANDSAT:Reflective
 
SUBDATASET_3_NAME=LANDSAT:2:F:\Data\LandSat\LS8_O_20131022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt
  SUBDATASET_3_DESC=LANDSAT:Thermal
 
SUBDATASET_4_NAME=LANDSAT:3:F:\Data\LandSat\LS8_O_20131022_032724_00_128035_GEOTIFF_L4\LO81280352013295BJC00_MTL.txt
  SUBDATASET_4_DESC=LANDSAT:Quality
Corner Coordinates:
Upper Left  (0.0,0.0)
Lower Left  (0.0,  512.0)
Upper Right (  512.0,0.0)
Lower Right (  512.0,  512.0)
Center  (  256.0,  256.0)

Fig 4 is the information of the second sub-dataset (i.e., the Reflective
data )output by gdalinfo. It can be seen that eight sub-datasets are
included.

   
Fig 4. Output information of gdalinfo.


Best regards 




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-Landsat-Dirver-tp5208438.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL Landsat Dirver

2015-06-01 Thread liminlu0314
landsatdataset.cpp
  

landsatdataset.cpp is LANDSAT Driver source code



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-Landsat-Dirver-tp5208438p5208440.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL Landsat Dirver

2015-06-01 Thread Dmitry Baryshnikov

Hi,

I would like to note that the Landsat metadata files support added to 
GDAL 2.0 
(https://svn.osgeo.org/gdal/trunk/gdal/gcore/mdreader/reader_landsat.cpp)
I think you can use this metadata reader to parse Landsat metadata file, 
or set to the Landsat dataset the imagery metadata in same manner.
Also, I think the tests for new format in autotest 
(https://svn.osgeo.org/gdal/trunk/autotest/gdrivers/) folder needed.


And, it seems to me that the use:
char** papszBandMeta = NULL;
papszBandMeta = CSLAddString(papszBandMeta, pszFilename);
pLandsatBand->SetMetadata(papszBandMeta);
poDS->SetBand( iBand+1, pLandsatBand);

should ended with free papszBandMeta array:
CSLDestroy(papszBandMeta);

But the new driver look promising!

Best regards,
Dmitry

01.06.2015 15:55, liminlu0314 пишет:

landsatdataset.cpp


landsatdataset.cpp is LANDSAT Driver source code



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-Landsat-Dirver-tp5208438p5208440.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev




___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL Landsat Dirver

2015-06-01 Thread Even Rouault
Hi,

Actually there's another Landsat-8 driver sitting in an attachment to a ticket 
in Trac : https://trac.osgeo.org/gdal/ticket/5501

Even

> Hi,
> 
> I would like to note that the Landsat metadata files support added to
> GDAL 2.0
> (https://svn.osgeo.org/gdal/trunk/gdal/gcore/mdreader/reader_landsat.cpp)
> I think you can use this metadata reader to parse Landsat metadata file,
> or set to the Landsat dataset the imagery metadata in same manner.
> Also, I think the tests for new format in autotest
> (https://svn.osgeo.org/gdal/trunk/autotest/gdrivers/) folder needed.
> 
> And, it seems to me that the use:
>  char** papszBandMeta = NULL;
>  papszBandMeta = CSLAddString(papszBandMeta, pszFilename);
>  pLandsatBand->SetMetadata(papszBandMeta);
>  poDS->SetBand( iBand+1, pLandsatBand);
> 
> should ended with free papszBandMeta array:
>  CSLDestroy(papszBandMeta);
> 
> But the new driver look promising!
> 
> Best regards,
>  Dmitry
> 
> 01.06.2015 15:55, liminlu0314 пишет:
> > landsatdataset.cpp
> > 
> > 
> > landsatdataset.cpp is LANDSAT Driver source code
> > 
> > 
> > 
> > --
> > View this message in context:
> > http://osgeo-org.1560.x6.nabble.com/GDAL-Landsat-Dirver-tp5208438p520844
> > 0.html Sent from the GDAL - Dev mailing list archive at Nabble.com.
> > ___
> > gdal-dev mailing list
> > gdal-dev@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev