[Qgis-user] Metis and creating pyramids
Micha Silver
micha at arava.co.il
Tue Jul 29 03:01:45 PDT 2008
Maciej:
Thanks again for following up on this. I re-tested and found I was
mistaken. It was adding the correct georeference headers (gdalwarp) that
caused the greatest improvement in speed. see below.
Maciej Sieczka wrote:
>
>> Many thanks! Your suggestion certainly helped. It seems that giving
>> the explicit "TILED=NO" option creates a stripped tiff that loads
>> *much* faster. And zooming was very good also. (BTW I didn't use
>> BLOCKYSIZE=1 as that gave an error ).
>
> It shouldn't. It's a valid TIFF creation option [1]. What error exactly?
Here's my workflow:
micha at RMS:~/geodata/50k_geology$ gdalinfo Yotvata.jpg
Driver: JPEG/JPEG JFIF
Size is 8017, 5532
Coordinate System is `'
GeoTransform =
187967.7392250972, 4.252254583185349, -0.002294798733402035
441663.1691433123, 0.0006796580977589757, -4.241373602342718
Corner Coordinates:
Upper Left ( 187967.739, 441663.169)
Lower Left ( 187955.044, 418199.890)
Upper Right ( 222058.064, 441668.618)
Lower Right ( 222045.369, 418205.339)
Center ( 205006.554, 429934.254)
Band 1 Block=8017x1 Type=Byte, ColorInterp=Red
Band 2 Block=8017x1 Type=Byte, ColorInterp=Green
Band 3 Block=8017x1 Type=Byte, ColorInterp=Blue
micha at RMS:~/geodata/50k_geology$ gdal_translate -of GTiff -co
"TILED=YES" -co "BLOCKYSIZE=1" Yotvata.jpg Yotvata.tif
Input file size is 8017, 5532
0ERROR 1: _TIFFVSetField:Yotvata.tif: Bad value 1 for "TileLength"
ERROR 9: Bad tile width/length parameters; copying failed
micha at RMS:~/geodata/50k_geology$ gdalinfo --version
GDAL 1.4.4.0, released 2007/11/23
micha at RMS:~/geodata/50k_geology$ gdal_translate -of GTiff -co
"TILED=YES" Yotvata.jpg Yotvata1.tif
Input file size is 8017, 5532
0...10...20...30...40...50...60...70...80...90...100 - done.
micha at RMS:~/geodata/50k_geology$ ll Yotvata.*
-rwxrw-rwx 1 micha micha 131 2008-07-27 12:16 Yotvata.jgw
-rwxrw-rwx 1 micha micha 8781558 2002-03-11 17:04 Yotvata.jpg
-rw-r--r-- 1 micha micha 138429238 2008-07-28 22:31 Yotvata1.tif
Displaying the *tiled* tiff in QGIS takes about 40 seconds.
Now add CRS to the tiff (I know the CRS but headers are lacking):
micha at RMS:~/geodata/50k_geology$ gdalwarp -s_srs EPSG:2039 -t_srs
EPSG:2039 Yotvata1.tif Yotvata1_ITM.tif
And now the georeferenced tiff loads in 2 seconds! So the dramatic speed
improvement was because of CRS data in the file, and not tiling.
Next I tried with TILED=NO :
micha at RMS:~/geodata/50k_geology$ gdal_translate -of GTiff -co
"TILED=NO" Yotvata.jpg Yotvata2.tif
Input file size is 8017, 5532
0...10...20...30...40...50...60...70...80...90...100 - done.
and the Yotvata2.tif loads in about 20 seconds. So stripped tiffs do
seem to display faster.
I also did gdalwarp on the Yotvata2.tif and again the load time drops
down to below 2 seconds.
>
> Stripped TIFF is a default gdal_translate output for me. What GDAL
> version (I'm using GDAL 1.5.2 + SVN r15027)?
>
>> When I created tiffs with no TILED option they loaded quite slowly.
>> Then I added the TILED=YES, and still the images loaded and zoomed
>> slowly. TILED=NO gave a dramatic improvement.
>
>>> Anybody knows why QGIS renders tiled rasters without pyramids so
>>> slow?
>
> Hey, Developers! Any ideas?
>
>
>
Now I went back to the pyramid problem, and I see that I can create
pyramids as expected for both the tiled and stripped tiffs. But *only*
if there are correct CRS headers in the tiff. And there is indeed yet
another improvement in rendering speed.
> Tiles and overviews (pyramids) are two distinct things and not mutually
> exclusive. Applying overviews to a tiled TIFF works for me in QGIS (as
> well as for stripped TIFF) and improves it's render times greatly.
>
> Maciek
>
> [1]http://www.gdal.org/frmt_gtiff.html
>
So, the bottom line:
1- Stripped tiffs seem to load and display faster than tiled.
2- Tiffs with correct georeference headers display much faster (10X
improvement).
3- Pyramid overviews cannot be created for rasters that don't have
proper Coordinate Reference System headers
Cheers,
Micha
More information about the Qgis-user
mailing list