[gdal-dev] GPKG footprint of ratser data shrinks as zoom level decreases
Philippe Ghesquiere
philippe.ghesquiere at airbus.com
Mon Apr 20 02:37:22 PDT 2026
Hi all,
I have problems with the footprint of GPKG raster data, as it varies with
zoom level.
1) Data creation
I need a color-relied'ed DTED in GPKG format. I create it with the
following commands:
gdaldem color-relief E017N30.DT2 colormap.lut E017N30_lut.tif
gdal_translate -of GPKG -co TILING_SCHEME=InspireCRS84Quad -co
ZOOM_LEVEL_STRATEGY=UPPER -co RASTER_TABLE=tiles -r bilinear
E017N30_lut.tif E017N30_lut.gpkg
gdaladdo E017N30_lut.gpkg
2) Observed
UL and LR corners are given with (where zoom max is ZOOM_LEVEL=12):
gdalinfo.exe E017N30_lut.gpkg | grep -E "Upper Left|Lower Right"
Upper Left ( 16.9998611, 31.0001389) ( 16d59'59.50"E, 31d 0' 0.50"N)
Lower Right ( 18.0001320, 29.9998680) ( 18d 0' 0.48"E, 29d59'59.52"N)
I noticed that the GPKG footprint depends on zoom level:
gdalinfo.exe E017N30.gpkg -oo ZOOM_LEVEL=7| grep -E "Upper Left|Lower Right"
Upper Left ( 16.9998611, 31.0001389) ( 16d59'59.50"E, 31d 0' 0.50"N)
Lower Right ( 17.9996170, 30.0003830) ( 17d59'58.62"E, 30d 0' 1.38"N)
We observe:
UL corner are identical
LR corner "moves" northward and westward from Z=12 to Z=8
Is it as expected?
3) Impact:
When computing the pyramid (gdaladdo), one column (on the east side) and
one line (on the south side) are not generated.
In our system, we can see this artefact when when requesting tiles with
WMTS requests.
4) Workaround
Our generation script is currently based on gdal_translate/gdaldem/gdaladdo
(and not mapcache_seed). In order to get all the expected pixels, I
implemented a workaround:
* generate the highest zoom level layer with standard gdadem/gdal_translate
commands (see above)
* sqlite command: increase max_x and decrease min_y in table gpkg_contents
* gdaladdo: pyramid computation
* sqlite command: reset max_x and min_y to original values
Thank you for any help / explanation
Philippe
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.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20260420/1a5c85e2/attachment-0001.htm>
More information about the gdal-dev
mailing list