One map, one file

An XYZ folder is useful as an intermediate result but awkward for a user: it is difficult to copy, validate or delete as one unit, while a huge number of small files adds filesystem overhead. PMTiles stores tiles, its index and metadata in one portable archive. THS2 can place that file in a private library, verify its checksum, download it and open it locally.

On Android, MapLibre reads only the areas and zoom levels it needs. The web service delivers the same result: a ready map needs no separate tile server and is not unpacked on the device.

Designed for both offline use and network delivery

PMTiles is built for random access. A phone or browser does not need the complete archive just to read its header, metadata or a particular tile. On the server this works naturally with HTTP Range requests, so an interrupted large download can continue instead of restarting from zero.

The same container can hold raster historical sheets and vector OSM regions. Their contents remain different, but one delivery format makes the catalogue, storage, access checks and THS2 client code simpler.

Why not keep every source format

MBTiles also keeps a map in one file and remains an excellent conversion intermediate. It is a SQLite database, while PMTiles is purpose-built as an archive for publishing and byte-range access. GeoTIFF and KMZ are useful georeferenced sources, and an XYZ/TMS ZIP is a practical way to move an existing tile pyramid. THS2 accepts them through separate adapters and produces the same manageable PMTiles result.

There is a trade-off: PMTiles is not an editor and is normally rebuilt when its contents change. THS2 therefore keeps the pipeline explicit: accept and safely validate a source, build MBTiles when needed, convert to PMTiles, verify the result, and only then add the map to the library.

  • one file instead of a tile tree
  • raster and vector maps in one container
  • local reading without an embedded web server
  • Range requests and resumable downloads
  • metadata and bounds stored with the tiles