[gdal-dev] Re: gdal_translate waits at the end of operation

Etienne Tourigny etourigny.dev at gmail.com
Thu May 10 07:45:15 EDT 2012


On Thu, May 10, 2012 at 3:16 AM, kaarigar <kaarigar at gmail.com> wrote:
> Thanks for the suggestion. I tried to convert GeoTIFF to jpg - and there
> wasn't the problem. Then I tried to convert a small GeoTIFF (20 mb) to XYZ -
> it still waited for some time (~10 secs) after displaying the "Done."
> message. I think what is happening is that I was converting a set of very
> large files (each ~300 mb) - and that makes gdal_translate wait for quite
> some time after the "Done." message. This time I waited long enough and the
> gdal_translate process was able to continue to the next file in the batch
> file. Still I am not sure why gdal_translate has to wait at the end of the
> conversion.

Something that is not apparent is that gdal_translate (via driver's
GDALCreateCopy()) usually opens the new dataset after creation, and
the XYZ file loading is slow:

>From the XYZ driver doc at http://www.gdal.org/frmt_xyz.html
"The opening of a big dataset can be slow as the driver must scan the
whole file to determine the dataset size and spatial resolution. The
driver will autodetect the data type among Byte, Int16, Int32 or
Float32."

You can verify this by running the command with debug output like:

$ gdal_translate --debug on -of xyz
LANDSAT_5_TM_20100614_001_067_L2_3B4G5B.tif tmp2.xyz
GDAL: GDALOpen(LANDSAT_5_TM_20100614_001_067_L2_3B4G5B.tif,
this=0xa66950) succeeds as GTiff.
Input file size is 8046, 6767
Warning 6: XYZ driver only uses the first band of the dataset.

0...10...20...30...40...50...60...70...80...90...100 - done.
GDAL: GDALOpen(tmp2.xyz, this=0xa70a00) succeeds as XYZ.

GDAL: GDALClose(tmp2.xyz, this=0xa70a00)
GDAL: GDALClose(LANDSAT_5_TM_20100614_001_067_L2_3B4G5B.tif, this=0xa66950)


>
> Thanks to everyone for help!
>
>
> Etienne Tourigny-3 wrote
>>
>> do you get the same problem when converting to another format (say
>> gtiff) or using other files as input?
>>
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/gdal-translate-waits-at-the-end-of-operation-tp4964258p4964870.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list