Skip to content

Commit

Permalink
Correct documentation; apply-diff works for different MbtTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
rstanciu committed Aug 22, 2023
1 parent 46984f3 commit 961e5c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/src/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Apply the diff file generated from `copy` command above to an mbtiles file. The
mbtiles apply_diff src_file.mbtiles diff_file.mbtiles
```

Another way to apply the diff is to use the `sqlite3` command line tool directly. This SQL will delete all tiles from `src_file.mbtiles` that are set to `NULL` in `diff_file.mbtiles`, and then insert or update all new tiles from `diff_file.mbtiles` into `src_file.mbtiles`. The name of the diff file is passed as a query parameter to the sqlite3 command line tool, and then used in the SQL statements.
Another way to apply the diff is to use the `sqlite3` command line tool directly. This SQL will delete all tiles from `src_file.mbtiles` that are set to `NULL` in `diff_file.mbtiles`, and then insert or update all new tiles from `diff_file.mbtiles` into `src_file.mbtiles`, where both files are of `flat` type. The name of the diff file is passed as a query parameter to the sqlite3 command line tool, and then used in the SQL statements.
```shell
sqlite3 src_file.mbtiles \
-bail \
Expand All @@ -56,8 +56,6 @@ sqlite3 src_file.mbtiles \
"INSERT OR REPLACE INTO tiles (zoom_level, tile_column, tile_row, tile_data) SELECT * FROM diffDb.tiles WHERE tile_data NOTNULL;"
```

**_NOTE:_** Both of these methods for applying a diff _only_ work for mbtiles files in the simple tables format; they do _not_ work for mbtiles files in normalized_tables format.

### 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.
```shell
Expand Down

0 comments on commit 961e5c3

Please sign in to comment.