2023-10-28 11:50:49 +03:00
# mbtiles
2023-06-04 07:56:20 +03:00
2023-11-21 11:06:27 +03:00
[![Book ](https://img.shields.io/badge/docs-Book-informational )](https://maplibre.org/martin/tools.html)
2023-10-28 11:50:49 +03:00
[![docs.rs docs ](https://docs.rs/mbtiles/badge.svg )](https://docs.rs/mbtiles)
2023-12-25 09:49:39 +03:00
[![ ](https://img.shields.io/badge/Slack-%23maplibre--martin-blueviolet?logo=slack )](https://slack.openstreetmap.us/)
2023-06-04 07:56:20 +03:00
[![GitHub ](https://img.shields.io/badge/github-maplibre/martin-8da0cb?logo=github )](https://github.com/maplibre/martin)
2023-10-28 11:50:49 +03:00
[![crates.io version ](https://img.shields.io/crates/v/mbtiles.svg )](https://crates.io/crates/mbtiles)
2023-10-28 23:29:30 +03:00
[![CI build ](https://github.com/maplibre/martin/actions/workflows/ci.yml/badge.svg )](https://github.com/maplibre/martin/actions)
2023-06-04 07:56:20 +03:00
2023-09-30 03:40:32 +03:00
A library to help tile servers like [Martin ](https://maplibre.org/martin ) work with [MBTiles ](https://github.com/mapbox/mbtiles-spec ) files. When using as a lib, you may want to disable default features (i.e. the unused "cli" feature).
2023-06-04 07:56:20 +03:00
2023-11-21 11:06:27 +03:00
This crate also has a small utility that allows users to interact with the `*.mbtiles` files from the command line. See [tools ](https://maplibre.org/martin/tools.html ) documentation for more information.
2023-06-04 07:56:20 +03:00
### Development
Add .mbtiles support (#549)
Adds a new [.mbtiles](https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md)
backend, without the grid support. Uses extensive tile content
detection, i.e. if the content is gzipped, png, jpeg, gif, webp.
From CLI, can be as easy as adding a path to a directory that contains a
.mbtiles file (works just like pmtiles support)
```bash
# All *.mbtiles files in this dir will be published.
# The filename will be used as the source ID
martin ./tests/fixtures
```
From configuration file, the path can be specified in a number of ways
(same as pmtiles)
```yaml
mbtiles:
paths:
# scan this whole dir, matching all *.mbtiles files
- /dir-path
# specific mbtiles file will be published as mbtiles2 source
- /path/to/mbtiles2.mbtiles
sources:
# named source matching source name to a single file
pm-src1: /tmp/mbtiles.mbtiles
# named source, where the filename is explicitly set. This way we will be able to add more options later
pm-src2:
path: /tmp/mbtiles.mbtiles
```
Fixes #494
2023-01-09 08:10:23 +03:00
2023-06-01 20:07:13 +03:00
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.
2023-09-30 03:40:32 +03:00
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or < http: // www . apache . org / licenses / LICENSE-2 . 0 > )
* MIT license ([LICENSE-MIT](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.