Geoscience Reference
In-Depth Information
The option
-f
explicitly specifies the format of the input raster file. However, this
option is ignored if GDAL is able to figure out the input format itself. This utility
should not be used to convert one raster format to another (use
gdal_translate
for this). The advantage of
gdalmanage
with respect to standard operating system
commands is that you can easily track unidentified file types or find raster files
recursively in case filename and type are not known
apriori
. In the next example we
recursively search for raster files in the directory
image_directory
. We do not
have to know about the image filename or extension to find the following images:
gdalmanage identify -r image_directory
./image1.tif : GTiff
./image2.tif : GTiff
./quicklooks/image1.jpg : JPEG
./quicklooks/image.jpg : JPEG
./tile1/image1_1.tif : GTiff
./tile1/image2_1.tif : GTiff
./tile2/image1_2.tif : GTiff
./tile2/image2_2.tif : GTiff
To implement this using the Bash command line is less flexible, as it requires
prior knowledge on the filenames (e.g., image*) or extensions (e.g., tif or jpg). In
this particular case, the following two commands would work as well. However,
unlike
gdalmanage
, both would fail to find
figure.png
.
find image_directory -name 'image*'
find image_directory -name '*.tif' -o -name '*.jpg'
5.3 gdalcompare.py
The Python script
gdalcompare.py
compares two GDAL raster datasets and
reports if they are identical (files match) or different (comparison failed). The com-
parison is based on checksums and, therefore, provides little added value with respect
to
gdalinfo -checksum
. Although this utility is currently documented in the
online GDAL documentation, it is not included in the latest distribution of GDAL
utilities
2
Usage: gdalcompare.py [-sds] golden_file new_file
2
You can download the script at
http://code.google.com
.
Search WWH ::
Custom Search