diff options
authorGuilhem Moulin <>2013-08-13 20:46:38 +0200
committerGuilhem Moulin <>2013-08-13 20:46:38 +0200
commitaa2d91c84d85b6ee9cd450e90614cecb7642c624 (patch)
parent0dd54962b4cc6a296c9fd68ccbd1e1c69394c50a (diff)
Note on VRT creation prior to the call to
1 files changed, 12 insertions, 2 deletions
diff --git a/ b/
index 7d670d6..50212bc 100755
--- a/
+++ b/
@@ -39,7 +39,12 @@ Merge all given I<map>s into an index file, and annotate this index with
tile borders and names.
If required, each map is first expanded into RGBA, to get a decent
+resampling. This expansion can take a significant amount of space. An
+alternative, much slower but which require nearly no extra space, is to
+create expanded VRTs:
+ for x in *.tif; do gdal_translate -expand rgba -of VRT $x ${x%.tif}.vrt; done
+ *.vrt index.png
=head1 OPTIONS
@@ -369,7 +374,7 @@ sub tempfile {
return $name;
-# Expand a dataset to RGBA. This code is mostly a perl translation of pct2rgb(1).
+# Expand a dataset to RGBA. This code is nearly a perl clone of pct2rgb(1).
sub expand_rgba {
my $map = shift;
@@ -444,6 +449,10 @@ sub merge {
&debug("Wrapping into file '$dst_filename'...");
my @opts;
+ # We use the optimisations suggested below
+ #
+ #
+ # '-multi' seems to slow down gdalwarp, though :-(
push @opts, '--config', 'GDAL_CACHEMAX', $config{wm}, '-wm', $config{wm}
if $config{wm};
push @opts, '-s_srs', $config{s_srs}->ExportToProj4() if $config{s_srs};
@@ -452,6 +461,7 @@ sub merge {
push @opts, '-ts', $config{outsize}->[0], $config{outsize}->[1];
push @opts, '-q' unless $config{progress};
my $driver_opts = $driver_opts;
+ # gdalwarp cannot create properly compressed output
delete $driver_opts->{COMPRESS} if $driver_opts->{COMPRESS};
push @opts, '-of', $driver, map { ('-co', $_.'='.$driver_opts->{$_}) }