[FWTools] gdaltindex batch file

Frank Warmerdam warmerdam at pobox.com
Fri Aug 4 09:55:24 EDT 2006

Gowens, Colin wrote:
> Greetings,
> I am using FWTools1.0.0a9 to create a tile index of about 10,000 files 
> across 50 directories. I am using gdaltindex in a for loop.  The 
> operation hangs in an infinite loop while trying to process files 
> without good tfw files (at the first dir unfortunately).  An abort 
> (Runtime close application)  has also occurred for a corrupt tiff.  Is 
> there a way to skip files that are corrupt or have unrecognizable 
> georeferencing? 


Files without georeferencing should be skipped after issuing the
"It appears no georeferencing is available for..." message you have

In theory corrupt files are supposed to be skipped with a message
about "Unable to open..." but in practice a sufficiently pathological
file can hang, crash or trigger a fatal error in GDAL.  If you submit
a bug report on files causing problems I might be able to improve things
somewhat but this isn't super high on my priority list.

> Question #2:  When using the –config GDAL_CACHEMAX option in the for 
> loop, gdaltindex prints the usage instead of processing the file.  I 
> have set the gdal environment variables in setfw.bat by pasting them 
> into my batch file.  Is there a way to utilize the –config options in a 
> batch for loop?

I can't think of any reason that a command like:

   gdaltindex --config GDAL_CACHEMAX 100 abc.shp def.tif

would not work.  If you can reproduce the problem with a simple
situation then please submit a bug report with all the details.

> for /R %%f in (.\*) do (
>   gdaltindex C:\temp\tindex_xpbatch.shp J:%%~pf*.tif
> )
> ****** this loop (shown here twice) keeps repeating for the same 9 files 
> and never finishes the job*****
> It appears no georeferencing is available for
> `J:\geo\d000000\p000233.tif', skipping.
> It appears no georeferencing is available for
> `J:\geo\d000000\p000235.tif', skipping.

I don't know why you are seeing looping behavior.  But are you really
sure it is gdaltindex and not your for loop?

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org

More information about the FWTools mailing list