The following primary requirements must be taken into consideration in the design of the index:
• Minimize the transferred amount of data and the number
of requests to reduce costs and latency
• Every tile in the archive can be requested with at most one
additional request
• Fast decoding of the index
As a case study evaluate the following approaches which have been already described on the spec page
Store only one absolute offset in addition to the size of the tiles in an index fragment.
Use a bit aligned encoding for the size of a tile, with a default bit width of 20 bits which allow a max tile size of 1 mb.
This leads to an index fragment size of 10k for 4096 index entries and an index size < 1 GB which can be also
handled well when a COMTiles archive is used in combination with a serverless tileserver e.g. hosted on AWS
lambda. A tile size of <= 1 MB is sufficient for a planet scale OSM MVT tileset e.g. generated with Planetiler.
In addition a different bit width can be specified in the COMTiles metadata section.
Reduce of the index size while continuing to meet the above specified requirements. One approach could be to use a Bitvector encoding to reduce the index size of sparse tilesets. Since over 50% of the COMTiles index fragments of an OSM vector tileset are not present, this approach could significantly reduce the size of the index. This could be inspired by the implicit tiling extension of the 3DTiles spec that contains an availability section to efficiently encode sparse datasets. This Bitvector is approximately smaller then 10kb for a planet-scale z14 tileset, which would not introduce to much additional latency. This could reduce the size of the index to about 400 Mb.
Use an additional fragment table to allow the usage of a custom compression algorithm for the index fragments.
This could enable the usage of a tile duplication technique inspired by PMTiles, which significantly can reduce the
overall index size. The disadvantage is that this also leads to an additional initial fetch more.
Related to the index fragment size this will probably be a kind of micro optimization in urban regions with a minor win (3x ->
4k?). In the tests the ingeger compression algorithms that showed the best results in terms of the compression ratio and decoding speed was a adapted version of the ORC RLE V1 encoding. In additon, also other ineger compression algorithm should be evaluated, which are designed to support SIMD instructions/vectorization for decoding the index fragments.
SIMD instructions are supported in the browser via WebAssembly
The decoding library should be cross-platform written in Rust which can be compiled to WebAssembly for the usage
in a browser. In general PMTiles does handle this compression (tile deduplication) use-case really well, so this should be only
a evaluation of how the compression ratio will improve when using another compression algorithms on the index
fragment structure on COMTiles. The structure of a COMTiles index fragment differs from an PMTiles directory as
only the size is stored compared to the additional tile id and offset.
The following primary requirements must be taken into consideration in the design of the index: • Minimize the transferred amount of data and the number of requests to reduce costs and latency • Every tile in the archive can be requested with at most one additional request • Fast decoding of the index
As a case study evaluate the following approaches which have been already described on the spec page
Store only one absolute offset in addition to the size of the tiles in an index fragment. Use a bit aligned encoding for the size of a tile, with a default bit width of 20 bits which allow a max tile size of 1 mb.
This leads to an index fragment size of 10k for 4096 index entries and an index size < 1 GB which can be also handled well when a COMTiles archive is used in combination with a serverless tileserver e.g. hosted on AWS lambda. A tile size of <= 1 MB is sufficient for a planet scale OSM MVT tileset e.g. generated with Planetiler. In addition a different bit width can be specified in the COMTiles metadata section.
Reduce of the index size while continuing to meet the above specified requirements. One approach could be to use a Bitvector encoding to reduce the index size of sparse tilesets. Since over 50% of the COMTiles index fragments of an OSM vector tileset are not present, this approach could significantly reduce the size of the index. This could be inspired by the implicit tiling extension of the 3DTiles spec that contains an availability section to efficiently encode sparse datasets. This Bitvector is approximately smaller then 10kb for a planet-scale z14 tileset, which would not introduce to much additional latency. This could reduce the size of the index to about 400 Mb.
Use an additional
fragment table
to allow the usage of a custom compression algorithm for the index fragments. This could enable the usage of a tile duplication technique inspired by PMTiles, which significantly can reduce the overall index size. The disadvantage is that this also leads to an additional initial fetch more. Related to the index fragment size this will probably be a kind of micro optimization in urban regions with a minor win (3x -> 4k?). In the tests the ingeger compression algorithms that showed the best results in terms of the compression ratio and decoding speed was a adapted version of the ORC RLE V1 encoding. In additon, also other ineger compression algorithm should be evaluated, which are designed to support SIMD instructions/vectorization for decoding the index fragments. SIMD instructions are supported in the browser via WebAssembly The decoding library should be cross-platform written in Rust which can be compiled to WebAssembly for the usage in a browser. In general PMTiles does handle this compression (tile deduplication) use-case really well, so this should be only a evaluation of how the compression ratio will improve when using another compression algorithms on the index fragment structure on COMTiles. The structure of a COMTiles index fragment differs from an PMTiles directory as only the size is stored compared to the additional tile id and offset.