<div dir="ltr"><div>Hi Even,<br></div><div>sorry for the late answer.<br></div><div>The latest version did a good job.<br></div><div>I am now investigating a strange issue after the gdaladdo run but I think it is caused by my MBTiles reader library.<br><br></div><div>Thank you for your work so far.<br><br></div><div class="gmail_extra">Regards<br clear="all"><div><div>Lorenzo Pini<br>Software Engineer<br><br>==<br>GeoServer Professional Services from the experts! Visit<br><a href="http://goo.gl/it488V" target="_blank">http://goo.gl/it488V</a> for more information.<br>==<br><br>GeoSolutions S.A.S.<br>Via di Montramito 3/A<br>55054  Massarosa (LU)<br>Italy<br>phone: <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313</a><br>fax:     <a href="tel:%2B39%200584%201660272" value="+3905841660272" target="_blank">+39 0584 1660272</a><br><br><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a><br><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a><br><br>AVVERTENZE AI SENSI DEL D.Lgs. 196/2003<br><br>Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.<br><br>The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility  for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.</div></div>
<br><div class="gmail_quote">On Wed, Apr 20, 2016 at 11:03 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Le lundi 18 avril 2016 17:55:57, Even Rouault a écrit :<br>
> Lorenzo,<br>
><br>
> > The command I used is:<br>
> ><br>
> > \>gdal_translate mosaic.tif full_def9.mbtiles -of MBTILES -expand rgb -co<br>
> > TILE_FORMAT=PNG8 -co ZLEVEL=9<br>
> > Input file size is 645661, 308112<br>
> > 0...10...20...30...40...50...60...70...80ERROR 1: Failure when inserting<br>
> > partial tile (row=759306,col=1099566) at zoom_level=21 : database or disk<br>
> > is full<br>
> > ERROR 1: full_def9.mbtiles, band 4: An error occurred while writing a<br>
> > dirty block<br>
> > ERROR 1: Failure when inserting partial tile (row=759306,col=1099566) at<br>
> > zoom_level=21 : database disk image is malformed<br>
> > ERROR 1: Failure when inserting partial tile (row=759306,col=1099566) at<br>
> > zoom_level=21 : database disk image is malformed<br>
> > ERROR 1: Failure when inserting partial tile (row=759306,col=1099566) at<br>
> > zoom_level=21 : database disk image is malformed<br>
> > ERROR 1: Failure when inserting partial tile (row=759306,col=1099576) at<br>
> > zoom_level=21 : database disk image is malformed<br>
> ><br>
> > NOTE: without the "-expand rgb" option, all the output tiles will be<br>
> > black, gdal_translate will warn you.<br>
> ><br>
> > The process failed due to insufficient disk space (70Gb free was not<br>
> > enough) but the resulting incomplete file (7Gb) looks good.<br>
> > Most of the space was used by the "partial_tiles" database, is there any<br>
> > settings I can use to force a more frequent "flush" of the tiles in the<br>
> > main database?<br>
><br>
> I've pushed a fix for that per <a href="https://trac.osgeo.org/gdal/ticket/6462" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/ticket/6462</a><br>
<br>
</div></div>With the fix, I managed to convert a VRT whose dimensions and spatial<br>
registration is the same as yours to a MBTiles (which is 333476 x 160000<br>
large) at level 20. The temporary database didn't grow above 1 GB.<br>
<br>
I'm thinking it might probably be possible to improve the conversion process<br>
to not use the temp DB at all (which would be likely result in significant<br>
speedup as quick profiling showed that the write activity in the temp DB is<br>
quite intense) by aligning the origin of the destination raster to tiles<br>
boundaries during the conversion, so that GDAL blocks and MBTiles tiles aren't<br>
shifted. For a later improvement...<br>
<span><br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</span>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div><br></div></div>