Skip to content

Commit

Permalink
docs: fix links and format
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKreil committed Mar 10, 2024
1 parent 20d63eb commit 5f692a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Versions

- [**v2.0**](v02/readme.md) <- current version
- [v1.0](v01)
- [v1.0](v01/container/readme.md)

## Implementations

Expand Down
6 changes: 3 additions & 3 deletions v01/container/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The file is composed of several parts:
- **index** of these tiles
4. **index** of all blocks

<p align="center"><img src="file_format.svg?raw=true"></p>
<p align="center"><img src="file_format.svg"></p>

## file

Expand Down Expand Up @@ -79,7 +79,7 @@ The file is composed of several parts:
- Each `block` contains data of up to 256x256 (= 65536) `tile`s.
- Levels 0-8 can be stored with one `block` each. level 9 might contain 512x512 `tile`s so 4 `block`s are necessary.

<p align="center"><img src="level_blocks.svg?raw=true"></p>
<p align="center"><img src="level_blocks.svg"></p>

- Each `block` contains the concatenated `tile` blobs and ends with a `tile_index`.
- Neither the order of `block`s in the `file` nor the order of `tile`s in a `block` matters as long as their indexes are correct.
Expand All @@ -96,7 +96,7 @@ The file is composed of several parts:
- `tile`s are read horizontally then vertically
- `j = (row - row_min)*(col_max - col_min + 1) + (col - col_min)`

<p align="center"><img src="block_tiles.svg?raw=true"></p>
<p align="center"><img src="block_tiles.svg"></p>

- identical `tile`s can be stored once and referenced multiple times to save storage space
- if a `tile` does not exist, the length of `tile` is zero
Expand Down
6 changes: 3 additions & 3 deletions v02/container/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ The Versatiles Container format consists of four main components:
| 30 | 4 | i32 | bbox max y (10⁷ × lat) |
| 34 | 8 | u64 | offset of [Metadata](#32-metadata-chunk) |
| 42 | 8 | u64 | length of [Metadata](#32-metadata-chunk) |
| 50 | 8 | u64 | offset of [Block Index](#34-block-index) |
| 58 | 8 | u64 | length of [Block Index](#34-block-index) |
| 50 | 8 | u64 | offset of [Block Index](#34-block-index) |
| 58 | 8 | u64 | length of [Block Index](#34-block-index) |



Expand Down Expand Up @@ -166,7 +166,7 @@ The Versatiles Container format consists of four main components:
| 12 + 33*i | 1 | u8 | `row_max` (0..255) |
| 13 + 33*i | 8 | u64 | offset of Block in file |
| 21 + 33*i | 8 | u64 | length of [Tile Blobs](#331-tile-blobs) |
| 29 + 33*i | 4 | u32 | length of [Tile Index](#332-tile-index) |
| 29 + 33*i | 4 | u32 | length of [Tile Index](#332-tile-index) |

- Since a Block consists only of [Tile Blobs](#331-tile-blobs) appended by the [Tile Index](#332-tile-index), the length of Block must be the sum of the lengths of the [Tile Blobs](#331-tile-blobs) and the [Tile Index](#332-tile-index).
- Note: To efficiently find the Block containing the tile you are looking for, use a data structure such as a "map", "dictionary" or "associative array" and fill it with the data from the Block Index.
Expand Down

0 comments on commit 5f692a4

Please sign in to comment.