<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div><font color="#1F497D">Try without internal mask.</font></div>
<div><font color="#1F497D"> </font></div>
<div><font color="#1F497D">Duarte</font></div>
<div><font color="#1F497D"> </font></div>
<div>_____________________________________________<br>

<b>De:</b> Ammar [<a href="mailto:ammar83_h@yahoo.com">mailto:ammar83_h@yahoo.com</a>]
<br>

<b>Enviada:</b> quinta-feira, 23 de Janeiro de 2014 14:28<br>

<b>Para:</b> Etienne Tourigny<br>

<b>Cc:</b> gdal dev<br>

<b>Assunto:</b> Re: [gdal-dev] Question about gdaladdo and raster mosaicking</div>
<div> </div>
<div> </div>
<a name="BM_BEGIN"></a>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">Etienne,<br>

<br>

I tried the following:<br>

<br>

<font face="Courier New" size="2"><span style="font-size:10pt;">gdalbuildvrt -srcnodata 255 -vrtnodata 255 -addalpha -input_file_list tiff_list.txt mosaic02.vrt<br>

<br>

gdal_translate -of GTiff -b 1 -b 2 -b 3 -mask 4 -a_srs EPSG:3011 -co TILED=yes -co compress=jpeg -co jpeg_quality=80 -co blockxsize=512 -co blockysize=512 -co photometric=ycbcr --config gdal_tiff_internal_mask yes mosaic02.vrt mosaic02.tif<br>

<br>

gdaladdo mosaic02.tif -r average --config COMPRESS_OVERVIEW JPEG --config JPEG_QUALITY_OVERVIEW 60 --config INTERLEAVE_OVERVIEW PIXEL --config PHOTOMETRIC_OVERVIEW YCBCR 2 4 8 16 32 64 128 256 512<br>

<br>

</span></font>Did I implement the mask the right way? The results I got were similar to the JPEG compression with no mask, in other words I got white lines too!<br>

<br>

<br>

<br>

</span></font></div>
<div><br>

</div>
<div><br>

</div>
<div><font face="Times New Roman" size="3" color="silver"><span style="font-size:12pt;"><u>  ________________________________  </u></span></font></div>
<div><font face="Arial" size="2"><span style="font-size:10pt;"><b>From:</b> Etienne Tourigny <<a href="mailto:etourigny.dev@gmail.com"><font color="#0563C1"><u>etourigny.dev@gmail.com</u></font></a>><br>

<b>To:</b> Ammar <<a href="mailto:ammar83_h@yahoo.com"><font color="#0563C1"><u>ammar83_h@yahoo.com</u></font></a>>
<br>

<b>Cc:</b> Chaitanya kumar CH <<a href="mailto:chaitanya.ch@gmail.com"><font color="#0563C1"><u>chaitanya.ch@gmail.com</u></font></a>>; gdal dev <<a href="mailto:gdal-dev@lists.osgeo.org"><font color="#0563C1"><u>gdal-dev@lists.osgeo.org</u></font></a>>
<br>

<b>Sent:</b> Thursday, January 23, 2014 12:25 PM<br>

<b>Subject:</b> Re: [gdal-dev] Question about gdaladdo and raster mosaicking<br>

</span></font></div>
<div><br>

</div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">As was suggested, you could try using a mask instead.</span></font></div>
<div><br>

<br>

</div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">On Thu, Jan 23, 2014 at 7:52 AM, Ammar <<a href="mailto:ammar83_h@yahoo.com"><font color="blue"><u>ammar83_h@yahoo.com</u></font></a>> wrote:<br>

</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">Chaitanya,<br>

<br>

Thank you very much for your reply and suggestion. I have used LZW with predictor 2 compression and added external overviews compressed in LZW too and the image came perfect. The only downside is the size of each of the images has expanded from approx. 2 GB
to 18-20 GB. So now I have to choose between quality and size!<br>

<br>

Attached are two screen shots showing the difference.<br>

<br>

Thanks again!<br>

<br>

Regards,<br>

Ammar</span></font></div>
<div> </div>
<div><br>

</div>
<div> </div>
<div> </div>
<div><font face="Times New Roman" size="3" color="silver"><span style="font-size:12pt;"><u>  ________________________________  </u></span></font></div>
<div><font face="Arial" size="3"><span style="font-size:12pt;"><b>From:</b> Chaitanya kumar CH <<a href="mailto:chaitanya.ch@gmail.com"><font color="blue"><u>chaitanya.ch@gmail.com</u></font></a>><br>

<b>To:</b> <a href="mailto:ammar83_h@yahoo.com"><font color="blue"><u>ammar83_h@yahoo.com</u></font></a>
<br>

<b>Cc:</b> gdal dev <<a href="mailto:gdal-dev@lists.osgeo.org"><font color="blue"><u>gdal-dev@lists.osgeo.org</u></font></a>>
<br>

<b>Sent:</b> Tuesday, January 21, 2014 6:27 PM<br>

<b>Subject:</b> Re: Question about gdaladdo and raster mosaicking<br>

</span></font></div>
<div><br>

</div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">Ammar,</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">You are using lossy JPEG compression. I'm guessing that the white lines are are actually pixels with values near but not equal to 255. So, they are not treated as nodata pixels.</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">My suggestion is to use another format with lossless compression for the 21 images or use a mask band if you prefer.</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">Let me know how it goes.</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">--<br>

Best regards,<br>

Chaitanya Kumar CH</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">On 21-Jan-2014 5:31 pm, <<a href="mailto:ammar83_h@yahoo.com"><font color="blue"><u>ammar83_h@yahoo.com</u></font></a>> wrote:<br>

</span></font></div>
<div><font face="HelveticaNeue" size="3"><span style="font-size:12pt;">Hello Chaitanya,<br>

<br>

I was looking online for solutions to my problem and I cam across some of your posts so I thought you might help me with my problem.<br>

<br>

I have 10,000+ TIFF files that I want to merge into one big Image and serve using GeoServer. I merged every 500 images at a time creating using gdalbuildvrt and gdal_translate along with JPEG compression creating 21 TIFF files. I added overviews then to each
of the new 21 files. When adding the images together, once directly as files using QGIS and another time as WMSs using GeoServer, I got white lines/gaps precisely at the border of ever 2 images. I thought the problem is with no data values but I decided to
take another approach and merged all the 10,000 files into one huge image and this time I got one perfect image with no lines or gaps. I failed to create overviews for the big image because the process took days or gdaladdo running with no progress. I tested
then on smaller images with and without overviews and the ones with no overview came perfect while the one with gdaladdo overviews came with the same problem of lines and gaps. The commands I m using are the following:<br>

<br>

 gdalbuildvrt -srcnodata 255 -vrtnodata 255 -a_srs EPSG:27700 -input_file_list tiff_list.txt mosaic.vrt<br>

<br>

gdal_translate -of GTiff -co TILED=YES -co BIGTIFF=YES -co COMPRESS=JPEG -co JPEG_QUALITY=80 -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co PHOTOMETRIC=YCBCR mosaic.vrt mosaic.tif<br>

<br>

gdaladdo mosaic.tif -r average --config COMPRESS_OVERVIEW JPEG --config JPEG_QUALITY_OVERVIEW 60 --config INTERLEAVE_OVERVIEW PIXEL --config PHOTOMETRIC_OVERVIEW YCBCR 2 4 8 16 32 64 128 256 512<br>

<br>

Any ideas, tips or recommendations would be appreciated!<br>

<br>

Best regards,<br>

Ammar<br>

<br>

_____________________________________<br>

Sent from <a href="http://osgeo-org.1560.x6.nabble.com/"><font color="blue"><u>http://osgeo-org.1560.x6.nabble.com</u></font></a><br>

<br>

</span></font></div>
<div><br>

<br>

</div>
<div><br>

<font face="HelveticaNeue" size="3"><span style="font-size:12pt;">_______________________________________________<br>

gdal-dev mailing list<br>

</span></font><a href="mailto:gdal-dev@lists.osgeo.org"><font face="HelveticaNeue" size="3" color="blue"><span style="font-size:12pt;"><u>gdal-dev@lists.osgeo.org</u></span></font></a><br>

<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"><font face="HelveticaNeue" size="3" color="blue"><span style="font-size:12pt;"><u>http://lists.osgeo.org/mailman/listinfo/gdal-dev</u></span></font></a><br>

</div>
<div><br>

</div>
<div><br>

<br>

</div>
<div> </div>
</span></font>
</body>
</html>