[gdal-dev] IMD files being created by gdalwarp and driver.Create

Benjamin Deschamps bdeschamps.home at gmail.com
Fri Jul 15 06:31:09 PDT 2016

Hi Even,

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.

import numpy
from osgeo import gdal

band =
outpath =

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[1], dn.shape[0], 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.

outpath =
outpath =

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>

> Benjamin,
> >
> > I am seeing .IMD files being created first by driver.Create() with the
> > GTIFF driver, and then also by gdalwarp (doing a simple reprojection),
> with
> > 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
> use.
> 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
> suppress
> 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 ;-)
> Even
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160715/5faf2c03/attachment.html>

More information about the gdal-dev mailing list