2023-06-01 16:05:06 +03:00
|
|
|
[workspace]
|
2023-08-28 04:07:29 +03:00
|
|
|
resolver = "2"
|
2023-06-04 05:50:55 +03:00
|
|
|
members = ["martin", "martin-tile-utils", "martin-mbtiles"]
|
2023-06-01 16:05:06 +03:00
|
|
|
|
|
|
|
[workspace.package]
|
|
|
|
edition = "2021"
|
|
|
|
license = "MIT OR Apache-2.0"
|
2023-07-06 03:56:23 +03:00
|
|
|
repository = "https://github.com/maplibre/martin"
|
|
|
|
rust-version = "1.65"
|
2023-07-10 21:38:48 +03:00
|
|
|
readme = "README.md"
|
|
|
|
homepage = "https://martin.maplibre.org/"
|
2023-06-01 16:05:06 +03:00
|
|
|
|
|
|
|
[workspace.dependencies]
|
2022-08-15 16:54:48 +03:00
|
|
|
actix = "0.13"
|
|
|
|
actix-cors = "0.6"
|
|
|
|
actix-http = "3"
|
|
|
|
actix-rt = "2"
|
|
|
|
actix-web = "4"
|
2023-06-03 03:40:22 +03:00
|
|
|
anyhow = "1.0"
|
2022-08-15 16:54:48 +03:00
|
|
|
async-trait = "0.1"
|
2023-02-20 18:44:22 +03:00
|
|
|
brotli = "3"
|
2023-06-01 16:05:06 +03:00
|
|
|
cargo-husky = { version = "1", features = ["user-hooks"], default-features = false }
|
2022-10-01 10:48:11 +03:00
|
|
|
clap = { version = "4", features = ["derive"] }
|
2023-06-01 16:05:06 +03:00
|
|
|
criterion = { version = "0.5", features = ["async_futures", "async_tokio", "html_reports"] }
|
|
|
|
ctor = "0.2"
|
2023-09-26 21:24:56 +03:00
|
|
|
deadpool-postgres = "0.11"
|
2022-11-27 05:34:49 +03:00
|
|
|
env_logger = "0.10"
|
2023-02-08 19:55:37 +03:00
|
|
|
flate2 = "1"
|
2022-11-26 12:46:40 +03:00
|
|
|
futures = "0.3"
|
2023-06-01 16:05:06 +03:00
|
|
|
indoc = "2"
|
2023-06-23 06:24:31 +03:00
|
|
|
itertools = "0.11"
|
2023-09-12 18:03:26 +03:00
|
|
|
json-patch = "1.1"
|
2018-03-26 14:12:43 +03:00
|
|
|
log = "0.4"
|
2023-10-02 06:28:43 +03:00
|
|
|
martin-mbtiles = { path = "./martin-mbtiles", version = "0.6.0", default-features = false }
|
2023-06-04 01:54:50 +03:00
|
|
|
martin-tile-utils = { path = "./martin-tile-utils", version = "0.1.0" }
|
2022-08-15 16:54:48 +03:00
|
|
|
num_cpus = "1"
|
2023-09-19 04:28:04 +03:00
|
|
|
pmtiles = { version = "0.3", features = ["mmap-async-tokio", "tilejson"] }
|
2022-08-15 16:54:48 +03:00
|
|
|
postgis = "0.9"
|
2022-09-13 09:18:01 +03:00
|
|
|
postgres = { version = "0.19", features = ["with-time-0_3", "with-uuid-1", "with-serde_json-1"] }
|
2022-08-15 16:54:48 +03:00
|
|
|
postgres-protocol = "0.6"
|
2023-02-06 22:32:28 +03:00
|
|
|
regex = "1"
|
2023-09-30 12:58:49 +03:00
|
|
|
rustls = { version = "0.21", features = ["dangerous_configuration"] }
|
|
|
|
rustls-native-certs = "0.6"
|
|
|
|
rustls-pemfile = "1"
|
2022-08-15 16:54:48 +03:00
|
|
|
semver = "1"
|
2022-10-31 23:28:21 +03:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
2023-06-01 16:05:06 +03:00
|
|
|
serde_json = "1"
|
2022-07-29 12:20:49 +03:00
|
|
|
serde_yaml = "0.9"
|
Add dynamic sprites support (#715)
Dynamically create image sprites for MapLibre rendering, given a
directory with images.
### TODO
* [x] Work with @flother to merge these PRs
* [x] https://github.com/flother/spreet/pull/59 (must have)
* [x] https://github.com/flother/spreet/pull/57
* [x] https://github.com/flother/spreet/pull/56
* [ ] https://github.com/flother/spreet/pull/62 (not required but nice
to have, can upgrade later without any code changes)
* [x] Add docs to the book
* [x] Add CLI param, e.g. `--sprite <dir_path>`
* [x] Don't output `.sprites` in auto-genned config when not in use
### API
Per [MapLibre sprites
API](https://maplibre.org/maplibre-style-spec/sprite/), we need to
support the following:
* `/sprite/<sprite_id>.json` metadata about the sprite file - all coming
from a single directory
* `/sprite/<sprite_id>.png` all images combined into a single PNG
* `/sprite/<sprite_id>@2x.json` same but for high DPI devices
* `/sprite/<sprite_id>@2x.png`
Multiple sprite_id values can be combined into one sprite with the same
pattern as for tile joining:
`/sprite/<sprite_id1>,<sprite_id2>,...,<sprite_idN>[.json|.png|@2x.json|@2x.png]`.
No ID renaming is done, so identical names will override one another.
### Configuration
[Config file](https://maplibre.org/martin/config-file.html) and possibly
CLI should have a simple option to serve sprites. The configuration may
look similar to how mbtiles and pmtiles are configured:
```yaml
# Publish sprite images
sprites:
paths:
# scan this whole dir, matching all image files, and publishing it as "my_images" sprite source
- /path/to/my_images
sources:
# named source matching source name to a directory
my_sprites: /path/to/some_dir
```
Implement #705
2023-06-16 15:19:47 +03:00
|
|
|
spreet = { version = "0.8", default-features = false }
|
2023-08-31 06:40:40 +03:00
|
|
|
sqlite-hashes = "0.3"
|
2023-09-30 03:40:32 +03:00
|
|
|
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] }
|
2023-09-06 07:30:40 +03:00
|
|
|
subst = { version = "0.3", features = ["yaml"] }
|
2022-12-13 13:02:38 +03:00
|
|
|
thiserror = "1"
|
2022-08-15 16:54:48 +03:00
|
|
|
tilejson = "0.3"
|
2023-08-17 07:14:40 +03:00
|
|
|
tokio = { version = "1.32.0", features = ["macros"] }
|
2023-09-30 12:58:49 +03:00
|
|
|
tokio-postgres-rustls = "0.10"
|
2023-06-04 05:50:55 +03:00
|
|
|
|
2023-10-04 04:20:41 +03:00
|
|
|
[profile.dev.package]
|
2023-06-04 05:50:55 +03:00
|
|
|
# See https://github.com/launchbadge/sqlx#compile-time-verification
|
2023-10-04 04:20:41 +03:00
|
|
|
sqlx-macros.opt-level = 3
|