Patch from Matthias for gdal tools