[gdal-dev] problem with unwanted white space in input file list
for gdalbuildvrt
Fabrice LALLAURET - PSV
fabrice.lallauret at external.thalesgroup.com
Wed Sep 15 04:37:07 EDT 2010
Le 09/15/2010 10:05 AM, Fabrice LALLAURET - PSV a écrit :
> Hi all,
> I try to use some gdal tools in a batch file on windows and I've a
> strange side effect. Here is a little batch use with fwtools 2.4.7.
>
> @echo off
> echo "Test 1 with file list"
> del listin.txt test1.vrt test2.vrt
> for %%F in (krel*.tif) do @echo %%F>> listin.txt
> gdalbuildvrt -input_file_list listin.txt test1.vrt
> echo "Test 2 with direct argument"
> gdalbuildvrt test2.vrt krel*.tif
>
> And then the result of this script.
>
> H:\>testgdal.bat
> "Test 1 with file"
> 0...10...20...30...40...50Warning 6: gdalbuildvrt does not support
> positive NS
> resolution. Skipping krel31.tif
> ...60...70...80...90...100 - done.
> Warning 6: gdalbuildvrt does not support positive NS resolution.
> Skipping krel32.tif
> "Test 2 with direct argument"
> 0...10...20...30...40...50...60...70...80...90...100 - done.
>
> The two input files are all correct and when I use this command line :
>
>
> Everything works.
>
> After some investigations,(check my file, gdal debug compilation, try
> on linux too, ...), I've found that there is a space at the end of
> each line in my listin.txt. On linux, the same thing produce a clear
> error :
>
>
> #> gdalbuildvrt -input_file_list listin.txt toto.vrt
> 0...10...20...30...40...50ERROR 4: `krel31.tif ' does not exist in the
> file system,
> and is not recognised as a supported dataset name.
> Warning 1: Warning : can't open krel31.tif . Skipping it
> ...60...70...80...90...100 - done.
> ERROR 4: `krel32.tif ' does not exist in the file system,
> and is not recognised as a supported dataset name.
> Warning 1: Warning : can't open krel32.tif . Skipping it
>
>
> It will be a good thing that gdalbuildvrt trim white space before
> reading file or have the same error on windows and linux.
>
> Thanks
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
I've found the problem in my script
for %%F in (krel*.tif) do @echo %%F>> listin.txt
must be
for %%F in (krel*.tif) do @echo %%F>> listin.txt # no white space between F and> !!
But I don't understand the problem of reading the geolocation of the
tiff and a white space in a file ??
Regards
--
.--. Fabrice LALLAURET - PSV Team
|o_o | Tel: (33) (01 34) 22 83 47
|:_/ | Thales Training& Simulation
// \ \ 1, rue du General de Gaulle
(| | ) Z.I. les beaux soleils
/'\_ _/`\ Osny. B.P. 226
\___)=(___/ 95523 Cergy-Pontoise Cedex
E-mail: fabrice.lallauret at external.thalesgroup.com
"Power corrupts. PowerPoint corrupts absolutely."
My personnal (french) Websites: http://www.xbee.net
and http://www.french-comics-zone.fr.st
More information about the gdal-dev
mailing list