diff --git a/docs/src/51-tools.md b/docs/src/51-tools.md index e917a2323..8d2cb74d1 100644 --- a/docs/src/51-tools.md +++ b/docs/src/51-tools.md @@ -66,7 +66,7 @@ sqlite3 src_file.mbtiles \ ``` ### validate -If the `.mbtiles` file is of `flat_with_hash` or `normalized` type, then verify that the data stored in columns `tile_hash` and `tile_id` respectively are MD5 hashes of the `tile_data` column. +If the `.mbtiles` file is of [flat_with_hash](52-schemas.md#flat-with-hash) or [normalized](52-schemas.md#normalized) type, then verify that the data stored in columns `tile_hash` and `tile_id` respectively are MD5 hashes of the `tile_data` column. ```shell mbtiles validate src_file.mbtiles ``` @@ -74,7 +74,7 @@ mbtiles validate src_file.mbtiles ## Content Validation The original [MBTiles specification](https://github.com/mapbox/mbtiles-spec#readme) does not provide any guarantees for the content of the tile data in MBTiles. This tool adds a few additional conventions to ensure that the content of the tile data is valid. -A typical Normalized schema generated by tools like [tilelive-copy](https://github.com/mapbox/TileLive#bintilelive-copy) use MD5 hash in the `tile_id` column. The Martin's `mbtiles` tool can use this hash to verify the content of each tile. We also define a new `flat-with-hash` schema that stores the hash and tile data in the same table. This schema is more efficient than the `normalized` schema when data has no duplicate tiles (see below). Per tile validation is not available for `flat` schema. +A typical Normalized schema generated by tools like [tilelive-copy](https://github.com/mapbox/TileLive#bintilelive-copy) use MD5 hash in the `tile_id` column. The Martin's `mbtiles` tool can use this hash to verify the content of each tile. We also define a new [flat-with-hash](52-schemas.md#flat-with-hash) schema that stores the hash and tile data in the same table. This schema is more efficient than the [normalized](52-schemas.md#normalized) schema when data has no duplicate tiles (see below). Per tile validation is not available for `flat` schema. Per-tile validation will catch individual invalid tiles, but it will not detect overall datastore corruption (e.g. missing tiles or tiles that shouldn't exist, or tiles with incorrect z/x/y values). For that, Martin `mbtiles` tool defines a new metadata value called `agg_tiles_hash`. The value is computed by hashing `cast(zoom_level AS text), cast(tile_column AS text), cast(tile_row AS text), tile_data` combined for all rows in the `tiles` table/view, ordered by z,x,y.