<html><head><base href="x-msg://21/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 21, 2011, at 3:26 PM, Jay Jennings wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Hello list,<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">(using GDAL 1.8.0) I am trying to create a 32:1 down-sampled overview of a GeoTiff satellite image. My first thought was gdal_translate, with args such as “-outsize 3.125% 3.125%”… which produces surprisingly high quality given the absence of a resampling option. However I’m looking for a downsampling scheme that creates a result pixel by averaging all relevant source pixels (I know, for 32:1 downsample, that means 1024 source pixels for each result pixel !) with the hope of an output that is not “speckled” or “grainy” insofar as possible.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">I also looked at gdaladdo, which does have the “-r average” resampling option… the guidance at<span class="Apple-converted-space"> </span><a href="http://gdal.org" style="color: blue; text-decoration: underline; ">gdal.org</a><span class="Apple-converted-space"> </span>seems to suggest that it can produce a 32:1 GeoTIFF external overview with a command like this:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">gdaladdo -r average -ro XXXXX.tif 32<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">But that produces a surprising error message, namely:<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">ERROR 4: `XXXXX.tif.ovr' does not exist in the file system, and is not recognised as a supported dataset name.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Am I barking up the wrong tree with gdaladdo for this purpose ? Anybody have any suggestions for highest-quality down-sampling ? Thanks in advance.<o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div></div></span></blockquote><br></div><div>Jay</div><div><br></div><div>I think you need to build your overlays incrementally in order to get the average</div><div>of the 'block' at each overview level as gdaladdo has a very small sampling window</div><div><br></div><div>gdaladdo -r average my.tif 2 4 8 16 32</div><div><br></div><div>better to use gauss sampling</div><div>see <a href="http://en.wikipedia.org/wiki/Pyramid_%28image_processing%29">http://en.wikipedia.org/wiki/Pyramid_%28image_processing%29</a></div><div><br></div><div>gdaladdo -r gauss my.tiff 2 4 8 16 32</div><div><br></div><div>note you may want to convert your image to a floating point form first </div><div>so as not to possibly lose precision due to the multiple passes</div><div><br></div><div>there is a gdal method to extract a single overview level from a tif but I can never </div><div>remember it maybe someone will chime in if not you can use your gdal_translate</div><div>trick.</div><div><br></div><div>HTH</div><div><br></div><div>Norman</div><div><br></div><div><br></div></body></html>