Skip to content

root-directory-only pmtiles archives have incorrect header offsets #794

Closed
@bdon

Description

@bdon

Reproduce

Run tilemaker monaco.osm.pbf --output monaco.pmtiles and the view the result metadata on pmtiles.io

root directory: offset=127 len=157
metadata: offset=254954 len=518
leaf directories: offset=0 len=254954
tile data: offset=16384 len=18446744073709535000

The leaf directory offset/length is incorrect, as well as the tile data length. Other fields look OK.

  • this does not affect the ability to view the tiles, because the leaf_directory_offset and tile_data_length are not used by readers.
  • It does affect the ability to pmtiles edit to modify the JSON metadata using the pmtiles CLI and is also necessary for pmtiles cluster to work, since both these operations rely on that information being correct to efficiently make a copy of the file using few I/O operations.

In pmtiles cli v1.25 there are additional checks to detect this case.

(PR coming)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions