diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2013-08-13 20:46:38 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2013-08-13 20:46:38 +0200 |
commit | aa2d91c84d85b6ee9cd450e90614cecb7642c624 (patch) | |
tree | 2477961544883d58a3f26fe6e8ca4eb7ea5a02b4 | |
parent | 0dd54962b4cc6a296c9fd68ccbd1e1c69394c50a (diff) |
Note on VRT creation prior to the call to mkindex.pl.
-rwxr-xr-x | mkindex.pl | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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. +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 + mkindex.pl *.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 + # http://lists.osgeo.org/pipermail/gdal-dev/2009-August/021715.html + # http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp + # '-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 # http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp#GeoTIFFoutput-coCOMPRESSisbroken delete $driver_opts->{COMPRESS} if $driver_opts->{COMPRESS}; push @opts, '-of', $driver, map { ('-co', $_.'='.$driver_opts->{$_}) } |