<div dir="ltr"><br><div>Dear all,<br><br>I just had an error while converting an image to GPKG. This image has a very small resolution and gdal_translate pops up an error message.<br><br><u>Test image :</u><br>gdal_create -of GTiff -co COMPRESS=DEFLATE -outsize 2000 2000 -burn 255 -burn 0 -burn 0 -bands 3 -ot Byte -a_srs epsg:32631 -a_ullr 1000000 1000000 1000002 1000002 1mm.tif<br><br><u>Conversion to GPKG :</u><br>gdal_translate -of GPKG -co TILING_SCHEME=InspireCRS84Quad -co ZOOM_LEVEL_STRATEGY=UPPER 1mm.tif 1mm.gpkg<br>Input file size is 2000, 2000<br>ERROR 1: Could not find an appropriate zoom level<br><br><u>Analysis</u></div><div>The error is due to 
<a href="https://github.com/OSGeo/gdal/blob/master/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp#L3169" class="external-link" target="_blank" rel="nofollow noopener" title="Follow link">ogrgeopackagedatasource.cpp</a> (line 3169), and it does make sense : the zoom level is too high (Z>25).</div><div><br></div><div>However, wouldn't it be possible to modify gdal_translate behavior ?</div><div>For example, we could :</div><div><ul><li>let GDAL compute the appropriate zoom level : -co ZOOM_LEVEL_STRATEGY=AUTO/LOWER/UPPER,</li><li>optionally specify a maximum zoom level : -co MAX_ZOOM_LEVEL=18</li></ul><div>What do you think ?</div></div><div><br></div><div>Philippe</div><div><br></div></div>
<font style="font-size: 9px;">The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.<br>If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.<br>Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.<br>All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.</font>