Expand description
§mbtiles
A library to help tile servers like Martin work with MBTiles files. When using as a lib, you may want to disable default features (i.e. the unused “cli” feature).
This crate also has a small utility that allows users to interact with the *.mbtiles files from the command line. See tools documentation for more information.
§Development
Any changes to SQL commands require running of just prepare-sqlite. This will install cargo sqlx command if it is not already installed, and update the ./sqlx-data.json file.
§License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Re-exports§
pub use sqlx;
Structs§
- Mbtiles
- A reference to an
MBTilesfile providing low-level database operations. - Mbtiles
Copier - Mbtiles
Pool - Connection pool for concurrent read access to an
MBTilesfile. - Metadata
- Tileset metadata combining MBTiles and TileJSON specifications.
- Tile
Coord
Enums§
- AggHash
Type - Copy
Duplicate Mode - Copy
Type - Integrity
Check Type - MbtError
- MbtType
- MbtType
Cli - Patch
Type - Patch
Type Cli - Update
Zoom Type
Constants§
- AGG_
TILES_ HASH - Metadata key for the aggregate tiles hash value
- AGG_
TILES_ HASH_ AFTER_ APPLY - Metadata key for a diff file, describing the eventual
AGG_TILES_HASHvalue of the resulting tileset once the diff is applied - AGG_
TILES_ HASH_ BEFORE_ APPLY - Metadata key for a diff file, describing the expected
AGG_TILES_HASHvalue of the tileset to which the diff will be applied.
Functions§
- action_
with_ rusqlite - anonymous_
mbtiles - Create an in memory, temporary mbtile connection with the given
script - apply_
patch - calc_
agg_ tiles_ hash - Compute the hash of the combined tiles in the mbtiles file tiles table/view.
This should work on all mbtiles files perf
MBTilesspecification. - compute_
min_ max_ zoom - Compute min and max zoom levels from the
tilestable - create_
bsdiffraw_ tables - create_
flat_ tables - create_
flat_ with_ hash_ tables - create_
metadata_ table - create_
normalized_ tables - create_
tiles_ with_ hash_ view - detach_
db - Execute
DETACH DATABASEcommand - get_
bsdiff_ tbl_ name - get_
patch_ type - Check if
MBTileshas a table or a view namedbsdiffraworbsdiffrawgzwith needed fields, and return the corresponding patch type. If missing, returnPatchType::Whole - has_
tiles_ with_ hash - Check if
MBTileshas a table or a view namedtiles_with_hashwith needed fields - init_
mbtiles_ schema - invert_
y_ value MBTilesuses a TMS (Tile Map Service) scheme for its tile coordinates (inverted along the Y axis). This function converts Y value between TMS tile coordinate to an XYZ tile coordinate.- is_
empty_ database - Returns true if the database is empty (no tables/indexes/…)
- is_
flat_ tables_ type - is_
flat_ with_ hash_ tables_ type - is_
normalized_ tables_ type - reset_
db_ settings - temp_
named_ mbtiles - Create a named, in memory, temporary mbtile connection with the given
script