<div dir="ltr">I agree with the standard limit of 

<span lang="EN-US">the </span><span lang="EN-US">InspireCRS84Quad grid.</span><div><span lang="EN-US">That's why I was wondering if we could deal with this weird image like :</span></div><div>gdal_translate -of GPKG -co TILING_SCHEME=InspireCRS84Quad -co ZOOM_LEVEL_STRATEGY=UPPER <b>-co MAX_ZOOM_LEVEL=17</b> 1mm.tif 1mm.gpkg</div><div><br></div><div>In this particular case, the GPKG will stop at ZoomLevel=17</div><div>Philippe</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 18, 2024 at 3:36 PM Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-2706918754061857603">





<div lang="FI" style="overflow-wrap: break-word;">
<div class="m_-2706918754061857603WordSection1">
<p class="MsoNormal"><span>Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I am not sure how standard the level 25 is for the
</span><span lang="EN-US">InspireCRS84Quad, the INSPIRE technical guidance stops at 17. But I believe that you know your own use case and have considered also that EPSG:3857 at 1 mm resolution is good for you</span><span lang="EN-US">.<br>
<br>
The number of tiles at level 25 is 2^50=</span><span lang="EN-US" style="color:black"> 1.1259E+15. TileCol and TileRow would get rather large numbers but I suppose that it is not an issue.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Philippe Ghesquiere <<a href="mailto:philippe.ghesquiere@airbus.com" target="_blank">philippe.ghesquiere@airbus.com</a>>
<br>
<b>Lähetetty:</b> torstai 18. tammikuuta 2024 16.06<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Kopio:</b> gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<b>Aihe:</b> Re: [gdal-dev] GPKG raster creation : error with too small resolution<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Jukka,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have no choice but to use the standard InspireCRS84Quad tiling grid.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for the "-a_ullr fix"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Philippe<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Jan 18, 2024 at 2:42 PM Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Can you imagine using a custom tiling schema instead of the world-wide
</span>InspireCRS84Quad<span lang="EN-US">? These commands work<br>
<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 1000002 1000002 1000000 1mm.tif<br>
<br>
gdal_translate -of GPKG  1mm.tif 1mm.gpkg<br>
<br>
Notice the fixed ullr for making the image north-up.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<br>
<br>
<br>
<br>
gdal_translate -of GPKG  1mm.tif 1mm.gpkg</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Input file size is 2000, 2000</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">0ERROR 6: Only north-up non rotated geotransform supported</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">..ERROR 1: Raster table 1mm not correctly initialized due to missing call to SetGeoTransform()</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Philippe Ghesquiere via gdal-dev<br>
<b>Lähetetty:</b> torstai 18. tammikuuta 2024 15.22<br>
<b>Vastaanottaja:</b> gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<b>Aihe:</b> [gdal-dev] GPKG raster creation : error with too small resolution<u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">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><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The error is due to 
<a href="https://github.com/OSGeo/gdal/blob/master/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp#L3169" title="Follow link" target="_blank">
ogrgeopackagedatasource.cpp</a> (line 3169), and it does make sense : the zoom level is too high (Z>25).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">However, wouldn't it be possible to modify gdal_translate behavior ?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">For example, we could :<u></u><u></u></p>
</div>
<div>
<ul type="disc">
<li class="MsoNormal">
let GDAL compute the appropriate zoom level : -co ZOOM_LEVEL_STRATEGY=AUTO/LOWER/UPPER,<u></u><u></u></li><li class="MsoNormal">
optionally specify a maximum zoom level : -co MAX_ZOOM_LEVEL=18<u></u><u></u></li></ul>
<div>
<p class="MsoNormal">What do you think ?<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Philippe<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:7pt">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.</span><u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><span style="font-size:7pt">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.</span><u></u><u></u></p>
</div>
</div>

</div></blockquote></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>