[gdal-dev] IMD files being created by gdalwarp and driver.Create
bdeschamps.home at gmail.com
Fri Jul 15 09:41:59 PDT 2016
Created a ticket here:
First ticket, so hopefully I followed protocol.
Thanks for your help.
On Fri, Jul 15, 2016 at 12:07 PM, Even Rouault <even.rouault at spatialys.com>
> Le vendredi 15 juillet 2016 15:31:09, Benjamin Deschamps a écrit :
> > Hi Even,
> > The original file is a Landsat-8 image, I can confirm that it has tags
> > in the imd metadata domain with gdalinfo -mdd imd
> > LC80040242014245LGN00_B3.TIF but I'm creating a brand new raster, not
> > making a copy, so I'm not sure why the metadata is being transferred. The
> > following basic example still has the .IMD file created.
> > import numpy
> > from osgeo import gdal
> > band =
> > 00_B3.TIF" outpath =
> > 00_B3_test.TIF"
> > ds = gdal.Open(band)
> > proj = ds.GetProjection()
> > geot = ds.GetGeoTransform()
> > dn = ds.ReadAsArray().astype(numpy.float32)
> > ds = None
> > driver = gdal.GetDriverByName("GTiff")
> > ds_out = driver.Create(outpath, dn.shape, dn.shape, 1,
> > gdal.GDT_Float32)
> > ds_out.GetRasterBand(1).WriteArray(dn)
> > ds_out.SetProjection(proj)
> > ds_out.SetGeoTransform(geot)
> > ds_out.GetRasterBand(1).SetNoDataValue(0)
> > ds_out = None
> > However, if I write to a different directory, or more curiously to a name
> > with a different prefix, it does not create the file.
> > outpath =
> > "C:/Users/deschampsb/Desktop/test/LC80040242014245LGN00/newname.TIF"
> > outpath =
> > "C:/Users/deschampsb/Desktop/test/new/LC80040242014245LGN00_B3_test.TIF"
> > Is it looking up other files in the directory?
> OK that makes sense now. There is indeed a general metadata reader that
> recognizes Landsat _MTL.txt files (among other potential metadata
> sources). It
> is triggered here whereas it is not desirable in Create() case. Could you
> a ticket on https://trac.osgeo.org/gdal/newticket regarding this ? Thanks
> Spatialys - Geospatial professional services
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev