2023-06-01 16:05:06 +03:00
|
|
|
[workspace]
|
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-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-02-08 19:55:37 +03:00
|
|
|
deadpool-postgres = "0.10"
|
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"
|
2018-03-26 14:12:43 +03:00
|
|
|
log = "0.4"
|
2023-07-04 15:05:23 +03:00
|
|
|
martin-mbtiles = { path = "./martin-mbtiles", version = "0.4.0", default-features = false, features = ["native-tls"] } # disable CLI tools
|
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-06-01 16:05:06 +03:00
|
|
|
openssl = "0.10"
|
2023-05-25 19:01:35 +03:00
|
|
|
pmtiles = { version = "0.2.2", 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"] }
|
2023-06-01 16:05:06 +03:00
|
|
|
postgres-openssl = "0.5"
|
2022-08-15 16:54:48 +03:00
|
|
|
postgres-protocol = "0.6"
|
2023-02-06 22:32:28 +03:00
|
|
|
regex = "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-07-04 15:05:23 +03:00
|
|
|
sqlx = { version = "0.7", features = ["sqlite"] }
|
2022-12-22 09:35:29 +03:00
|
|
|
subst = { version = "0.2", features = ["yaml"] }
|
2022-12-13 13:02:38 +03:00
|
|
|
thiserror = "1"
|
2022-08-15 16:54:48 +03:00
|
|
|
tilejson = "0.3"
|
2023-06-30 06:36:18 +03:00
|
|
|
tokio = { version = "1.29.1", features = ["macros"] }
|
2023-06-04 05:50:55 +03:00
|
|
|
|
|
|
|
[profile.dev.package.sqlx-macros]
|
|
|
|
# See https://github.com/launchbadge/sqlx#compile-time-verification
|
|
|
|
opt-level = 3
|