[gdal-dev] Reading PMTiles With Missing Tiles

Patrick Young patrick.mckendree.young at gmail.com
Thu Feb 22 21:54:00 PST 2024


Hello,

I've been exploring the pmtiles driver a bit, what a great way to read
giant blobs of tiles off of cloud storage, really impressed by how fast
this is.

I've been encountering a "Non increasing tile_id" when attempting to read
from coarser zoom levels for a large (~300GB) pmtile file:

https://github.com/OSGeo/gdal/blob/48ddaf28db2826c635243abd469e7c7d2e749bdc/ogr/ogrsf_frmts/pmtiles/ogrpmtilestileiterator.cpp#L329

For example, this fails for me:

ds = gdal.OpenEx("</vsis3/...", gdal.OF_VECTOR | gdal.OF_READONLY,
open_options=["ZOOM_LEVEL=0"])
lyr = ds.GetLayer()
for feat in lyr:
    *** raises RuntimeError: Non increasing tile_id ***

Things seem good when I specify higher zooms (e.g. Z12 or not specified at
all), but I can't get features out of the coarser ones.  Using the
"pmtiles tiles" command, I can access the 0/0/0 tile just fine though.

Any thoughts on what could be wrong?  The file was translated from a
mbtiles file via the "pmtiles convert" tool.  ogrinfo is happy with it as
well:

INFO: Open of `/vsis3/.../tileset.pmtiles'
      using driver `PMTiles' successful.
Metadata:
  description=mvts for landcover layer
  format=pbf
  maxzoom=16
  minzoom=0
  name=mvts
  scheme=tms
  type=overlay
  version=2
  ZOOM_LEVEL=16
1: landcover

Thanks,
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240222/4386d4ff/attachment.htm>


More information about the gdal-dev mailing list