[gdal-dev] IMD files being created by gdalwarp and driver.Create
bdeschamps.home at gmail.com
Fri Jul 15 06:31:09 PDT 2016
The original file is a Landsat-8 image, I can confirm that it has tags set
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.
from osgeo import gdal
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,
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.
Is it looking up other files in the directory?
On Thu, Jul 14, 2016 at 4:28 PM, Even Rouault <even.rouault at spatialys.com>
> > I am seeing .IMD files being created first by driver.Create() with the
> > GTIFF driver, and then also by gdalwarp (doing a simple reprojection),
> > both input and output in GTIFF format.
> > I've never seen these files before... Can I prevent them from being
> > written?
> If they are created, it means that the IMD metadata domain is set on your
> GeoTIFF files. Presumably because it is also set in the source images you
> There's no option to suppress writing the IMD files when the IMD metadata
> domain is set on a GeoTIFF file. So either make sure it is not set, or
> the .imd as a postprocessing.
> But just doing a plain driver.Create() without setting metadata should not
> result in a .imd file being written.
> > I'm using GDAL 2.0.2 with the Python bindings, and GDAL 2.1.0 for the
> > utilities.
> Odd setup. I presume you know what you are doing ;-)
> Spatialys - Geospatial professional services
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev