Changes between Initial Version and Version 1 of Processing/GDALVRTMosaic


Ignore:
Timestamp:
Apr 8, 2015 4:18:33 PM (5 years ago)
Author:
dac
Comment:

Added mosaic creation page

Legend:

Unmodified
Added
Removed
Modified
  • Processing/GDALVRTMosaic

    v1 v1  
     1The steps below describe an easy way of creating mosaics from mapped hyperspectral files, making use of the command line GDAL utilities. They can be installed on Windows through [http://trac.osgeo.org/osgeo4w/ OSGeo4W], and are available on Linux through the package manager (e.g., yum, apt-get).
     2
     3The initial mosaic is a 'virtual raster', which comprises a text file with links to other files containing the data. It is created using the [http://www.gdal.org/gdalbuildvrt.html gdalbuildvrt] command, available with GDAL and also in QGIS through the Raster -> Miscellaneous menu.
     4
     5{{{
     6gdalbuildvrt -srcnodata 0 f216_mosaic.vrt /path/to/file/f216073b_mapped_osng.bil /path/to/file/f216083b_mapped_osng.bil
     7}}}
     8
     9The above command creates a virtual raster 'f216_mosaic.vrt' from two bil files, setting the no-data value to 0. The full path to each BIL file is passed in so they are stored in the VRT (useful if the VRT file is moved). You can also create a VRT from all '.bil' files using:
     10
     11{{{
     12gdalbuildvrt -srcnodata 0 f216_mosaic.vrt /path/to/file/*.bil
     13}}}
     14
     15The VRT file can be used as any other file in programs which use GDAL (e.g., QGIS, ArcGIS, TuiView). However, for displaying it is often more convenient to create band / spatial subsets using the [http://www.gdal.org/gdal_translate.html gdal_translate], also available through QGIS under Raster -> Conversion -> Translate.
     16 command. For example to create a three band subset using bands 38, 25 and 12 use:
     17
     18{{{
     19gdal_translate -of GTiff -b 38 -b 25 -b 12 f216_mosaic.vrt f216_mosaic_bandsubset.tif
     20}}}
     21
     22Standard GeoTiff's aren't compressed so areas outside the flightlines, which have no data, will take up as much space as pixels with data. You can reduce the file size by using compression. You can tell gdal_translate to create a compressed GeoTiff by passing in a creation option flag for example:
     23
     24{{{
     25gdal_translate -of GTiff -co "COMPRESS=LZW" -b 38 -b 25 -b 12 f216_mosaic.vrt f216_mosaic_bandsubset.tif
     26}}}
     27
     28Note, not all programs support compressed GeoTiffs.
     29
     30To make the mosaic faster to display you can create overviews using the [http://www.gdal.org/gdaladdo.html gdaladdo] command:
     31{{{
     32gdaladdo f216_mosaic_bandsubset.tif 2 4 8 16
     33}}}