Geoscience Reference
In-Depth Information
-150
-100
-50
0
50
100
150
50
50
0
0
-50
-50
-150
-100
-50
0
50
100
150
Fig. 8.5
Blue marble image warped with gdalwarp ( source NASA)
8.3.3 Mosaic Images
The following command mosaics two input images to a single output image. In the
next example there is no transformation of the coordinate systems involved. In case
of overlapping pixels, the value from the last input image is selected.
gdalwarp inputWest.tif inputEast.tif output.tif
When many input images are involved, gdalwarp can be slow, but there are
some things that can be done to improve performance. Firstly, for a simple mosaic,
as in the previous example, the equivalent Python script gdal_merge.py com-
mand can be faster if you do not need the reprojecting or resampling functionality of
gdalwarp . However, the Python script tries to load the entire image into memory
and is only suitable for modest sized images. Secondly, you can increase the random
access memory (RAM) that the gdalwarp warping algorithmuses for caching. This
can be done by setting the option -wm . Most modern computers have plenty of RAM
and can easily handle 500MB ( -wm 500 ). You can also increase the input/output
block cache size, which limits the disk access. For this you need to set the general
option --config GDAL_CACHEMAX . For example, use gdalwarp --config
CACHEMAX 1000 to use a cache size of 1GB. The default value can change for each
release, e.g., in GDAL 1.7 it was only 40MB. Check the system resources (use the
systemmonitor in a Linux environment) when playing with the cache values. Ideally
the CPU usage should be close to 100%. Memory can be increased if below 100%
and a swap disk (a virtual memory on disk) is not used. In particular when reading
and writing over a network, disk access should be limited (check your network
history). You could also temporarily copy images over to your local hard disk for
processing. Finally, although not recommended, it is possible to speed up the warping
 
 
Search WWH ::




Custom Search