<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Kanishk,</p>
<br>
<blockquote type="cite"
cite="mid:CAM18NOGva9tjireygOR1=NT6mjWtz6EGVu2O7AzSRRH=9UE10w@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div><br>
</div>
<div>And my GDAL commands are:</div>
<div><br>
</div>
<div>
<pre><span>gdalwarp -srcnodata 0 -dstalpha </span><span>infile.tif outfile.tif</span></pre>
<pre><span>
</span></pre>
<pre><pre><span>gdal_translate -tr 0.035 0.035 -co 'QUALITY=100' -of MBTILES outfile.tif</span><span> outmbtile.mbtiles</span></pre><pre><span>
</span></pre><pre><pre><span>gdaladdo -r nearest outmbtile.mbtiles</span><span> 2 4 8 16</span></pre></pre></pre>
</div>
</div>
</div>
</div>
</blockquote>
<p>The above gives a OK result for me with topveiw_sample.tif as
input. Note that you don't need the first gdalwarp step as your
file has already an alpha band.</p>
<p>To improve quality you should add for example -r average to
gdal_translate otherwise nearest neighbour reampling will be used,
which is generally a bad idea.</p>
<p>Same for gdaladdo: you should'nt use nearest neighbour reampling
for good quality<br>
</p>
<blockquote type="cite"
cite="mid:CAM18NOGva9tjireygOR1=NT6mjWtz6EGVu2O7AzSRRH=9UE10w@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div>
<pre><pre><pre><span>
</span></pre><pre>If I am trying to improve the target resolution even further(reducing -tr value) , it corrupts the output mbtile and a blank or blurred tile gets generated</pre><pre>Also, the opening option ZOOM_LEVEL seems to error out(Using with -oo "ZOOM_LEVEL=9)</pre></pre></pre>
</div>
</div>
</div>
</div>
</blockquote>
<p>If you look at the output of gdalinfo on the generated mbtiles
file, you'll see that the full resolution is at zoom level 22, and
given the dimensions of the file only 2 overview levels were
generated. So the minimum zoom level at which you can open that
file is 20.</p>
<p>Even</p>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>