mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Rename to mbtiles crate
This commit is contained in:
parent
fdc9e83ce3
commit
2fd75bad1a
4
.idea/mapr.iml
generated
4
.idea/mapr.iml
generated
@ -2,15 +2,15 @@
|
||||
<module type="CPP_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/libs/mapr_utils/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/libs/style_spec/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/libs/vector_tile/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/libs/wgsl_validate/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/examples" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/benches" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/libs/mbtiles/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/libs/mapr_utils/target" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/libs/mbtiles/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
18
.idea/runConfigurations/Run_downloader.xml
generated
18
.idea/runConfigurations/Run_downloader.xml
generated
@ -1,18 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run downloader" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
|
||||
<option name="command" value="run -p mapr-utils --bin download_tiles" />
|
||||
<option name="workingDirectory" value="file://$PROJECT_DIR$/libs/mapr_utils" />
|
||||
<option name="channel" value="DEFAULT" />
|
||||
<option name="requiredFeatures" value="true" />
|
||||
<option name="allFeatures" value="false" />
|
||||
<option name="emulateTerminal" value="false" />
|
||||
<option name="withSudo" value="false" />
|
||||
<option name="backtrace" value="SHORT" />
|
||||
<envs />
|
||||
<option name="isRedirectInput" value="false" />
|
||||
<option name="redirectInputPath" value="" />
|
||||
<method v="2">
|
||||
<option name="CARGO.BUILD_TASK_PROVIDER" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
135
Cargo.lock
generated
135
Cargo.lock
generated
@ -1384,19 +1384,6 @@ dependencies = [
|
||||
"tokio-rustls",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"hyper",
|
||||
"native-tls",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ident_case"
|
||||
version = "1.0.1"
|
||||
@ -1651,7 +1638,7 @@ dependencies = [
|
||||
"log",
|
||||
"lyon",
|
||||
"lyon_path",
|
||||
"mapr-utils",
|
||||
"mbtiles",
|
||||
"ndk-glue",
|
||||
"reqwest",
|
||||
"reqwest-middleware",
|
||||
@ -1668,25 +1655,22 @@ dependencies = [
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mapr-utils"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"log",
|
||||
"reqwest",
|
||||
"rusqlite",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
"vector-tile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "matches"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
||||
|
||||
[[package]]
|
||||
name = "mbtiles"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"log",
|
||||
"rusqlite",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.4.1"
|
||||
@ -1820,24 +1804,6 @@ dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "native-tls"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"openssl",
|
||||
"openssl-probe",
|
||||
"openssl-sys",
|
||||
"schannel",
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk"
|
||||
version = "0.5.0"
|
||||
@ -2010,39 +1976,6 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
||||
|
||||
[[package]]
|
||||
name = "openssl"
|
||||
version = "0.10.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if 1.0.0",
|
||||
"foreign-types",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"openssl-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-probe"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
|
||||
|
||||
[[package]]
|
||||
name = "openssl-sys"
|
||||
version = "0.9.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking"
|
||||
version = "2.0.0"
|
||||
@ -2301,14 +2234,12 @@ dependencies = [
|
||||
"http-body",
|
||||
"hyper",
|
||||
"hyper-rustls",
|
||||
"hyper-tls",
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"mime",
|
||||
"mime_guess",
|
||||
"native-tls",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rustls",
|
||||
@ -2317,7 +2248,6 @@ dependencies = [
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tokio-rustls",
|
||||
"tokio-util",
|
||||
"url",
|
||||
@ -2454,16 +2384,6 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scoped-tls"
|
||||
version = "1.0.0"
|
||||
@ -2486,29 +2406,6 @@ dependencies = [
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"core-foundation 0.9.2",
|
||||
"core-foundation-sys 0.8.3",
|
||||
"libc",
|
||||
"security-framework-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework-sys"
|
||||
version = "2.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e"
|
||||
dependencies = [
|
||||
"core-foundation-sys 0.8.3",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "0.9.0"
|
||||
@ -2957,16 +2854,6 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-native-tls"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
|
||||
dependencies = [
|
||||
"native-tls",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.23.2"
|
||||
|
||||
@ -4,7 +4,7 @@ members = [
|
||||
"libs/vector_tile",
|
||||
"libs/style_spec",
|
||||
"libs/wgsl_validate",
|
||||
"libs/mapr_utils",
|
||||
"libs/mbtiles",
|
||||
]
|
||||
|
||||
[package]
|
||||
@ -100,7 +100,7 @@ test-env-log = "0.2"
|
||||
|
||||
[build-dependencies]
|
||||
wgsl-validate = { path = "./libs/wgsl_validate" }
|
||||
mapr-utils = { path = "./libs/mapr_utils" }
|
||||
mbtiles = { path = "./libs/mbtiles" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["rlib", "cdylib", "staticlib"] # staticlib is used for apple
|
||||
|
||||
2
build.rs
2
build.rs
@ -1,7 +1,7 @@
|
||||
use std::path::Path;
|
||||
use std::{env, fs};
|
||||
|
||||
use mapr_utils::mbtiles::extract;
|
||||
use mbtiles::extract;
|
||||
use wgsl_validate::validate_project_wgsl;
|
||||
|
||||
pub const MUNICH_X: u32 = 17421;
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
[package]
|
||||
name = "mapr-utils"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4"
|
||||
# Network
|
||||
reqwest = { version = "0.11", features = ["gzip"] }
|
||||
vector-tile = { path = "../vector_tile" }
|
||||
tokio = { version = "1.14", features = ["full"] }
|
||||
rusqlite = "0.26"
|
||||
serde_json = "1.0"
|
||||
flate2 = "1.0"
|
||||
|
||||
[[bin]]
|
||||
name = "download_tiles"
|
||||
path = "src/tile_downloader.rs"
|
||||
@ -1 +0,0 @@
|
||||
pub mod mbtiles;
|
||||
@ -1,34 +0,0 @@
|
||||
use reqwest::Client;
|
||||
use std::fs::File;
|
||||
use std::io::copy;
|
||||
use std::path::Path;
|
||||
|
||||
use vector_tile::grid::*;
|
||||
|
||||
pub async fn download_tiles() {
|
||||
for (z, x, y) in tile_coordinates_bavaria(&google_mercator(), 6) {
|
||||
let target = format!(
|
||||
"https://maps.tuerantuer.org/europe_germany/{z}/{x}/{y}.pbf",
|
||||
z = z,
|
||||
x = x,
|
||||
y = y,
|
||||
);
|
||||
println!("{}", target);
|
||||
let client = Client::builder().gzip(true).build().unwrap();
|
||||
|
||||
let response = client.get(target).send().await.unwrap();
|
||||
if response.status().is_success() {
|
||||
let mut dest = {
|
||||
let fname =
|
||||
Path::new(".").join(format!("test-data/{z}-{x}-{y}.pbf", z = z, x = x, y = y,));
|
||||
File::create(fname).unwrap()
|
||||
};
|
||||
copy(&mut response.bytes().await.unwrap().as_ref(), &mut dest).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
download_tiles().await
|
||||
}
|
||||
11
libs/mbtiles/Cargo.toml
Normal file
11
libs/mbtiles/Cargo.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "mbtiles"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4"
|
||||
rusqlite = "0.26"
|
||||
serde_json = "1.0"
|
||||
flate2 = "1.0"
|
||||
Loading…
x
Reference in New Issue
Block a user