build

```bash cargo build && target/debug/opencloudtiles convert --tile-format webp tiles/original/hitzekarte.tar tiles/hitzekarte.tar cargo build && target/debug/opencloudtiles convert tiles/original/stuttgart.mbtiles tiles/stuttgart.cloudtiles cargo build && target/debug/opencloudtiles convert tiles/stuttgart.cloudtiles tiles/stuttgart.tar cargo build && target/debug/opencloudtiles probe tiles/stuttgart.cloudtiles cargo build && target/debug/opencloudtiles serve tiles/stuttgart.cloudtiles

cargo instruments --all-features -t "CPU Profiler" -- --max-zoom 3 convert tiles/philippines.mbtiles tiles/philippines.cloudtiles

cargo instruments --all-features -t "CPU Profiler" -- convert tiles/philippines.mbtiles tiles/philippines.cloudtiles

```

format

The file is composed of several parts: 1. A header with 256 bytes 2. brotli compressed metadata (tiles.json) 3. several blocks, where each block consists of: - several tiles - index of these tiles 4. index of all blocks

file

file_header (62 bytes)

| offset | length | type | description | |--------|--------|--------|----------------------------------| | 0 | 28 | string | "OpenCloudTiles-Container-v1:" | | 28 | 1 | u8 | tile_format | | 29 | 1 | u8 | tile_precompression | | 30 | 8 | u64 | offset of meta | | 38 | 8 | u64 | length of meta | | 46 | 8 | u64 | offset of block_index | | 54 | 8 | u64 | length of block_index |

tile_format values:

tile_precompression values:

meta

block

block_index (29 bytes per block)

| offset | length | type | description | |-----------|--------|------|--------------------------| | 0 + 29i | 1 | u8 | level | | 1 + 29i | 4 | u32 | column/256 | | 5 + 29i | 4 | u32 | row/256 | | 9 + 29i | 1 | u8 | col_min | | 10 + 29i | 1 | u8 | row_min | | 11 + 29i | 1 | u8 | col_max | | 12 + 29i | 1 | u8 | row_max | | 13 + 29i | 8 | u64 | offset of tile_index | | 21 + 29*i | 8 | u64 | length of tile_index |

block

tile

tile_index

| offset | length | type | description | |--------|--------|------|---------------------------| | 12j | 8 | u64 | offset of tile_blob j | | 12j | 4 | u32 | length of tile_blob j |