[Qgis-user] QGIS: Reduction of resolution via pyramids

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Thu Jun 12 08:09:46 PDT 2014


Hi,

See the comments on http://hub.qgis.org/issues/10563

I recommend you to estimate how the scale 1:25000 turns into pixel size.

I was remembering that screen resolution is about 91 pixels per inch but let's check it.
Screen dot size=0.28 mm
One inch is 25.4 mm = 2.54 cm = 0.0254 m
25.4/0.28 = 90.71

Let's assume that the native resolution of your images is 1 m. One inch on screen takes 90.71 meters of your data so the scale is
90.71/0.0254 = 3582.7

Overview level 2 (2 m pixel size) would correspond to  screen scale 1:7165
level 4 (4 m) to scale 1:14330
level 8 (8 m) to scale 1:28661.

Internal overviews can be used with tiff format.  Overviews will be stored inside the master tiff file which is handy because the one single file contains all, both the native data and all the overviews. It is also using  a bit less disk space than if overviews are written into external file. External overviews in .ovr format are tiff files with the same base name than the source layer and with extension .ovr. External overviews in Erdas format are fundamentally same but stored in Erdas Imagine format, not tiff. As far as I know the speed with GDAL programs is the same but I can Imagine that Erdas Imagine would like its own format better. Because you have a virtual raster as master layer you can't use internal overviews.

I would say that you can feed the numbers into a spreadsheet if you want to play and understand how it goes, but it is not at all necessary. If you think that using 25% extra disk space for level 2 overview is too much, start from level 4, it is certainly worth the 6.25% that it costs.

If you are happy with your virtual raster collecting 875 jpegs then good. However, jpegs and pngs are the worst alternatives of all for this kind of usage because the whole file must be decompressed even if only a small part of it will be needed. Convert them into tiled geotiffs which are internally compressed with jpeg compression and you will be much more happy. Of course if you enjoy speed, which I do not know.

GDAL takes automatically the resolution that is closest best to the asked output resolution. If you ask 10 m pixel size for the output, it does not start from 1, 2, nor 4 meter resolution which would be waste of resources. Instead it takes the 8 m version and resamples it into 10 m pixel size. GDAL does not take 16 m version because by doing that the quality would be unnecessary bad. Makes sense, doesn't?  How to control, I don't know. Probably in the code but of course by deleting the overviews you can force GDAL to start from the native resolution.

Here are the basic commands to use if you have 3-band aerial images. For raster maps LZW of DEFLATE compression may suit better.

gdal_translate -of gtiff -co tiled=yes -co compress=jpeg -co photometric=ycbcr input.tif output.tif
gdaladdo -ro --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW output.tif 2 4 8 16 32 64

-Jukka Rahkonen-


Julian Schall wrote:


Dear Jukka,



thank you for your answer.

I still don't know how to build pyramids just for defined scale ranges (in my case: smaller then 1:25.000).

I've forgotten to tell you an -maybe important- detail: I'm working with a virtual raster catalogue which i built out of 875 .jpgs (4000x4000).

When building pyramids, i've always used the option "external (Erdas Image.aux)".

Can you shortly explain the difference between the 3 options (external .ovr, internal, external .aux)?

I couldn't find an advice in the handbook or via google.

The QGIS instructions say that after building pyramids QGIS automaticly takes the best resolution when loading raster layers. So how can I influence what resolution QGIS chooses?

Thanks again for further help!

Kind regards,

Julian Schall





Date: Thu, 12 Jun 2014 09:34:18 +0000 (UTC)

From: Jukka Rahkonen <jukka.rahkonen at mmmtike.fi<mailto:jukka.rahkonen at mmmtike.fi>>

To: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>

Subject: Re: [Qgis-user] QGIS: Reduction of resolution via pyramids

      only for    defined scale range

Message-ID: <loom.20140612T112229-91 at post.gmane.org<mailto:loom.20140612T112229-91 at post.gmane.org>>

Content-Type: text/plain; charset=utf-8



Julian Schall <j.schall at ...<mailto:j.schall at ...>> writes:



>

>

> Hello members of the mailing list,

> ?

> I would appreciate help on the following problem:

> I would like to improve the performance of a raster layer. Of course I can

build pyramids for that purpose. But in the scale ranges from 1:1 to

1:25.000 I need maximum resolution and detail. In this scale range, the

performance is sufficient even without pyramids.

> Ideal would be that the pyramids respectively the reduction of the

resolution with improvement of performance is only applied to scales smaller

than 1:25,000. Is this possible in QGIS?

> ?

> Thanks for helpful answers!

> ?

> Kind regards

> ?

> Julian Schall



There are check boxes for overview levels in the Build overviews panel.

Level 2 means double the original pizel size etc. Leave for example levels 2

and 4 unchecked. However, level 2 means 25% extra disk space but level 4

only 6.25%. Thus it may not make sense to skip other levels than 2. Remember

to compress also the overviews and test with external overviews which you

can easily delete and continue with new tests. Internal overviews can be

removed so that they are no more used but operation does not make image

files smaller.











------------------------------



_______________________________________________

Qgis-user mailing list

Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>

http://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140612/a8c575b9/attachment.html>


More information about the Qgis-user mailing list