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
|
|
|
[package]
|
|
|
|
name = "martin-mbtiles"
|
|
|
|
version = "0.1.0"
|
|
|
|
edition = "2021"
|
2023-03-25 21:37:42 +03:00
|
|
|
license = "MIT/Apache-2.0"
|
|
|
|
repository = "https://github.com/maplibre/martin"
|
|
|
|
authors = ["Yuri Astrakhan <YuriAstrakhan@gmail.com>", "MapLibre contributors"]
|
|
|
|
description = "A simple low-level MbTiles access and processing library, with some tile format detection and other relevant heuristics."
|
|
|
|
keywords = ["mbtiles", "maps", "tiles", "mvt", "tileserver", "tilejson"]
|
|
|
|
exclude = [
|
|
|
|
# Exclude the fixtures directory from the package - it's only used for tests.
|
|
|
|
"/fixtures",
|
|
|
|
]
|
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
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
futures = "0.3"
|
|
|
|
log = "0.4"
|
|
|
|
martin-tile-utils = { path = "../martin-tile-utils" }
|
|
|
|
serde_json = "1"
|
|
|
|
sqlx = { version = "0.6", features = ["offline", "sqlite", "runtime-actix-native-tls"] }
|
|
|
|
thiserror = "1"
|
|
|
|
tilejson = "0.3"
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
# For testing, might as well use the same async framework as the Martin itself
|
|
|
|
actix-rt = "2"
|