Geography Reference
In-Depth Information
some minimum level. Notice the small X over the pyramid icon for each
level. This indicates that pyramids do not exist for that level. This of
course changes once we build pyramids for the raster. You can choose a
sampling method for calculating the pyramids. If you are unsure what
to do, just take the default value because it will give you acceptable
results. Select the levels you want to build by clicking each one. The
more you select, the longer it will take to build, and more important,
the larger your image will grow. Click the Build Pyramids button, and
wait while QGIS generates the pyramids for each selected level in the
list. This can take a while, especially for large images. Once complete,
the small X will disappear from each level for which pyramids were
built.
You should now see improved performance when drawing the image at
smaller scales. You might also notice some degradation in the appear-
ance of the image; however, at large scales (when zoomed in), the full
quality of the image is preserved. You may have to experiment a bit
to determine how many and which levels you want to build. For this
reason, be sure to keep a copy of the original image in a safe place.
You can also create pyramids using the GDAL utility gdaladdo . As with
QGIS, the pyramids are by default added to the original raster. If you
want to create pyramids for a lot or rasters, using gdaladdo is the way to
go. You can write a small script (shell, Python, Ruby, or Perl) to process
each file in a directory and add the pyramids. Here is an example of
using gdaladdo to create pyramids for our Montana DRG:
$ ls -lh o47113g1.tif
-rw-r--r-- 1 gsherman gsherman 6.8M 2007-07-09 17:24 o47113g1.tif
$ gdaladdo -r average o47113g1.tif 2 4 8 16
0...10...20...30...40...50...60...70...80...90...100 - done.
$ ls -lh o47113g1.tif
-rw-r--r-- 1 gsherman gsherman 11M 2007-07-11 19:49 o47113g1.tif
Here we created four levels of pyramids using the “average” resampling
algorithm. We listed the size before and after the operation. Notice that
building pyramids increased the raster from 6.8 megabytes to 11. For
more information on gdaladdo and its options, see the documentation. 5
Creating pyramids for your raster data can give you a huge perfor-
mance gain when rendering at various scales. You may want to make a
backup copy and then experiment with the various levels and sampling
methods to see which provide the best results for your data.
5.
http://www.gdal.org/gdaladdo.html
 
 
Search WWH ::




Custom Search