Discussion:
[gdal-dev] gdaltindex with wildcard (*.tif) in a /vsizip/myzip.zip
Helmut Kudrnovsky
2014-06-13 16:15:51 UTC
Permalink
Hi,

in the gdaltindex-manual there is an example using wildcard:

gdaltindex doq_index.shp doq/*.tif

my issue:

given a ~1 GB zip-file on a DVD with a lot of geotiffs, windows 7 box.


gdaltindex C:\data\m31_1.shp /vsizip/myzip.zip/m31_1/3523-5301_201308.tif

works fine, but

gdaltindex C:\data\m31_1.shp /vsizip/myzip.zip/m31_1/*.tif

fails with following message:

ERROR 4: `/vsizip/myzip.zip/m31_1/*.tif' does not exist in the file s
ystem,
and is not recognised as a supported dataset name.

Unable to open /vsizip/myzip.zip/m31_1/*.tif, skipping.

any idea if/how this could work?

thanks
Helmut



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdaltindex-with-wildcard-tif-in-a-vsizip-myzip-zip-tp5145801.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
Even Rouault
2014-06-13 17:28:01 UTC
Permalink
Post by Helmut Kudrnovsky
Hi,
gdaltindex doq_index.shp doq/*.tif
Wildcard is evaluated by the operating system
Post by Helmut Kudrnovsky
given a ~1 GB zip-file on a DVD with a lot of geotiffs, windows 7 box.
gdaltindex C:\data\m31_1.shp /vsizip/myzip.zip/m31_1/3523-5301_201308.tif
works fine, but
gdaltindex C:\data\m31_1.shp /vsizip/myzip.zip/m31_1/*.tif
But the operating system doesn't (logically) recognize the GDAL special
/vsizip/ file system, so the wildcard is not evaluated.

A modest complementary development would have to be done to evaluate the
wildcart inside gdaltindex.

An alternative might be to use the gdal_ls.py sample utility
(http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/gdal_ls.py),
redirect its output to a file and specify this file with --optfile to the
gdaltindex command line.

python gdal_ls.py /vsizip/the_zip/the_subdir > filelist.txt
(you may need to filter non tif files. with the Windows equivalent of grep, or
potentially the port of the unix grep :
http://gnuwin32.sourceforge.net/packages/grep.htm)
gdaltindex the_index.shp --optfile filelist.txt

Even
--
Geospatial professional services
http://even.rouault.free.fr/services.html
Helmut Kudrnovsky
2014-06-13 18:18:55 UTC
Permalink
Post by Even Rouault
Post by Helmut Kudrnovsky
gdaltindex doq_index.shp doq/*.tif
Wildcard is evaluated by the operating system
ah yes, your are right.
Post by Even Rouault
An alternative might be to use the gdal_ls.py sample utility
(http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/gdal_ls.py),
redirect its output to a file and specify this file with --optfile to the
gdaltindex command line.
thanks, gdal_ls.py works nicely.




-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdaltindex-with-wildcard-tif-in-a-vsizip-myzip-zip-tp5145801p5145822.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

Loading...