diff --git a/Cargo.lock b/Cargo.lock index d73132cd..5e029566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1894,7 +1894,7 @@ dependencies = [ [[package]] name = "martin-tile-utils" -version = "0.1.6" +version = "0.2.0" dependencies = [ "approx", ] @@ -3620,9 +3620,9 @@ dependencies = [ [[package]] name = "tilejson" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0366d033d74f8a24237057ba082c8fd9b06111028baff00056689af5e4d28995" +checksum = "4456a8bde0c9c9de96db90d0a74ef225035669c6176ee00ff692f8f6c0d94475" dependencies = [ "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 36b56923..dcfff749 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ insta = "1" itertools = "0.12" json-patch = "1.2" log = "0.4" -martin-tile-utils = { path = "./martin-tile-utils", version = "0.1.0" } +martin-tile-utils = { path = "./martin-tile-utils", version = "0.2.0" } mbtiles = { path = "./mbtiles", version = "0.8.0" } num_cpus = "1" pbf_font_tools = { version = "2.5.0", features = ["freetype"] } diff --git a/martin-tile-utils/Cargo.toml b/martin-tile-utils/Cargo.toml index f8289357..a61a8509 100644 --- a/martin-tile-utils/Cargo.toml +++ b/martin-tile-utils/Cargo.toml @@ -2,7 +2,7 @@ lints.workspace = true [package] name = "martin-tile-utils" -version = "0.1.6" +version = "0.2.0" authors = ["Yuri Astrakhan ", "MapLibre contributors"] description = "Utilites to help with map tile processing, such as type and compression detection. Used by the MapLibre's Martin tile server." keywords = ["maps", "tiles", "mvt", "tileserver"] diff --git a/martin-tile-utils/src/lib.rs b/martin-tile-utils/src/lib.rs index 3c9b31a7..f41d685d 100644 --- a/martin-tile-utils/src/lib.rs +++ b/martin-tile-utils/src/lib.rs @@ -9,6 +9,8 @@ use std::fmt::Display; pub const EARTH_CIRCUMFERENCE: f64 = 40_075_016.685_578_5; pub const EARTH_RADIUS: f64 = EARTH_CIRCUMFERENCE / 2.0 / PI; +pub const MAX_ZOOM: u8 = 30; + #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Format { Gif, diff --git a/mbtiles/tests/mbtiles.rs b/mbtiles/tests/copy.rs similarity index 100% rename from mbtiles/tests/mbtiles.rs rename to mbtiles/tests/copy.rs diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-flat.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__flat-flat.snap similarity index 96% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-flat.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__flat-flat.snap index 4570d4c7..07c6751e 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-flat.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__flat-flat.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-hash.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__flat-hash.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-hash.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__flat-hash.snap index 76f3e704..2c5e7f77 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-hash.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__flat-hash.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-norm.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__flat-norm.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-norm.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__flat-norm.snap index bce869b3..7dd593b8 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-norm.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__flat-norm.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-flat.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__hash-flat.snap similarity index 96% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-flat.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__hash-flat.snap index 4570d4c7..07c6751e 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__norm-flat.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__hash-flat.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-hash.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__hash-hash.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-hash.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__hash-hash.snap index 76f3e704..2c5e7f77 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-hash.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__hash-hash.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-norm.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__hash-norm.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-norm.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__hash-norm.snap index bce869b3..7dd593b8 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__flat-norm.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__hash-norm.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-flat.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__norm-flat.snap similarity index 96% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-flat.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__norm-flat.snap index 4570d4c7..07c6751e 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-flat.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__norm-flat.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-hash.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__norm-hash.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-hash.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__norm-hash.snap index 76f3e704..2c5e7f77 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-hash.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__norm-hash.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-norm.snap b/mbtiles/tests/snapshots/copy__convert@v1__z6__norm-norm.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-norm.snap rename to mbtiles/tests/snapshots/copy__convert@v1__z6__norm-norm.snap index bce869b3..7dd593b8 100644 --- a/mbtiles/tests/snapshots/mbtiles__convert@v1__z6__hash-norm.snap +++ b/mbtiles/tests/snapshots/copy__convert@v1__z6__norm-norm.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@flat__dif.snap b/mbtiles/tests/snapshots/copy__databases@flat__dif.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__databases@flat__dif.snap rename to mbtiles/tests/snapshots/copy__databases@flat__dif.snap index c31aeb6e..36193a4f 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@flat__dif.snap +++ b/mbtiles/tests/snapshots/copy__databases@flat__dif.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@flat__v1-no-hash.snap b/mbtiles/tests/snapshots/copy__databases@flat__v1-no-hash.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__databases@flat__v1-no-hash.snap rename to mbtiles/tests/snapshots/copy__databases@flat__v1-no-hash.snap index 0dc4aae1..130d4b80 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@flat__v1-no-hash.snap +++ b/mbtiles/tests/snapshots/copy__databases@flat__v1-no-hash.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@flat__v1.snap b/mbtiles/tests/snapshots/copy__databases@flat__v1.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__databases@flat__v1.snap rename to mbtiles/tests/snapshots/copy__databases@flat__v1.snap index 74dcd43d..433234f0 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@flat__v1.snap +++ b/mbtiles/tests/snapshots/copy__databases@flat__v1.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@flat__v2.snap b/mbtiles/tests/snapshots/copy__databases@flat__v2.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__databases@flat__v2.snap rename to mbtiles/tests/snapshots/copy__databases@flat__v2.snap index 2880dd1e..4764e49b 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@flat__v2.snap +++ b/mbtiles/tests/snapshots/copy__databases@flat__v2.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@hash__dif.snap b/mbtiles/tests/snapshots/copy__databases@hash__dif.snap similarity index 97% rename from mbtiles/tests/snapshots/mbtiles__databases@hash__dif.snap rename to mbtiles/tests/snapshots/copy__databases@hash__dif.snap index 5cab2712..ae6e8941 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@hash__dif.snap +++ b/mbtiles/tests/snapshots/copy__databases@hash__dif.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@hash__v1-no-hash.snap b/mbtiles/tests/snapshots/copy__databases@hash__v1-no-hash.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@hash__v1-no-hash.snap rename to mbtiles/tests/snapshots/copy__databases@hash__v1-no-hash.snap index 130e90b0..87e1eb66 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@hash__v1-no-hash.snap +++ b/mbtiles/tests/snapshots/copy__databases@hash__v1-no-hash.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@hash__v1.snap b/mbtiles/tests/snapshots/copy__databases@hash__v1.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@hash__v1.snap rename to mbtiles/tests/snapshots/copy__databases@hash__v1.snap index 34369333..49f15cd3 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@hash__v1.snap +++ b/mbtiles/tests/snapshots/copy__databases@hash__v1.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@hash__v2.snap b/mbtiles/tests/snapshots/copy__databases@hash__v2.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@hash__v2.snap rename to mbtiles/tests/snapshots/copy__databases@hash__v2.snap index da30138d..5eba6d23 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@hash__v2.snap +++ b/mbtiles/tests/snapshots/copy__databases@hash__v2.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@norm__dif.snap b/mbtiles/tests/snapshots/copy__databases@norm__dif.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@norm__dif.snap rename to mbtiles/tests/snapshots/copy__databases@norm__dif.snap index 2007f8b8..3dda5192 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@norm__dif.snap +++ b/mbtiles/tests/snapshots/copy__databases@norm__dif.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@norm__v1-no-hash.snap b/mbtiles/tests/snapshots/copy__databases@norm__v1-no-hash.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@norm__v1-no-hash.snap rename to mbtiles/tests/snapshots/copy__databases@norm__v1-no-hash.snap index 023d2352..f9906982 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@norm__v1-no-hash.snap +++ b/mbtiles/tests/snapshots/copy__databases@norm__v1-no-hash.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@norm__v1.snap b/mbtiles/tests/snapshots/copy__databases@norm__v1.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@norm__v1.snap rename to mbtiles/tests/snapshots/copy__databases@norm__v1.snap index 423b56fb..e24c57ee 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@norm__v1.snap +++ b/mbtiles/tests/snapshots/copy__databases@norm__v1.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]] diff --git a/mbtiles/tests/snapshots/mbtiles__databases@norm__v2.snap b/mbtiles/tests/snapshots/copy__databases@norm__v2.snap similarity index 98% rename from mbtiles/tests/snapshots/mbtiles__databases@norm__v2.snap rename to mbtiles/tests/snapshots/copy__databases@norm__v2.snap index 88c95bd0..db74a36b 100644 --- a/mbtiles/tests/snapshots/mbtiles__databases@norm__v2.snap +++ b/mbtiles/tests/snapshots/copy__databases@norm__v2.snap @@ -1,5 +1,5 @@ --- -source: mbtiles/tests/mbtiles.rs +source: mbtiles/tests/copy.rs expression: actual_value --- [[]]