mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Add test data
This commit is contained in:
parent
0b81198d73
commit
b31de71054
5
build.rs
5
build.rs
@ -10,12 +10,11 @@ fn main() {
|
||||
let root_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
|
||||
let out = PathBuf::from(Path::new(&out_dir).join("munich-tiles"));
|
||||
let out = PathBuf::from(Path::new(&out_dir).join("extracted-tiles"));
|
||||
if out.exists() && out.is_dir() {
|
||||
fs::remove_dir_all(&out).unwrap()
|
||||
}
|
||||
//let out = PathBuf::from(Path::new(&root_dir).join("test-data/munich-tiles"));
|
||||
let source = Path::new(&root_dir).join("test-data/maptiler-osm-2017-07-03-v3.6.1-germany_munich.mbtiles");
|
||||
let source = Path::new(&root_dir).join("test-data/munich-12.mbtiles");
|
||||
|
||||
// Pack tiles around Maxvorstadt (100 tiles in each direction)
|
||||
extract(source,
|
||||
|
||||
@ -3,12 +3,12 @@ use std::env;
|
||||
|
||||
use include_dir::{Dir, File, include_dir};
|
||||
|
||||
static TILES: Dir = include_dir!("$OUT_DIR/munich-tiles");
|
||||
static TILES: Dir = include_dir!("$OUT_DIR/extracted-tiles");
|
||||
|
||||
static mut TEST: u32 = 0;
|
||||
|
||||
pub fn get_source_path() -> &'static str {
|
||||
concat!(env!("OUT_DIR"), "/munich-tiles")
|
||||
concat!(env!("OUT_DIR"), "/extracted-tiles")
|
||||
}
|
||||
|
||||
pub fn get_tile(x: u32, y: u32, z: u32) -> Option<&'static File<'static>> {
|
||||
|
||||
1
test-data/.gitignore
vendored
1
test-data/.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.mbtiles
|
||||
!munich-12.mbtiles
|
||||
|
||||
BIN
test-data/munich-12.mbtiles
Normal file
BIN
test-data/munich-12.mbtiles
Normal file
Binary file not shown.
16
tools/extract-region
Executable file
16
tools/extract-region
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Bounds copied from https://boundingbox.klokantech.com/
|
||||
|
||||
if ! command -v tilelive-copy &> /dev/null
|
||||
then
|
||||
echo "tilelive-copy could not be found. Install it with 'yarn global add @mapbox/tilelive @mapbox/mbtiles'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
tilelive-copy \
|
||||
--minzoom=12 --maxzoom=12 \
|
||||
--bounds="11.417441,48.036758,11.77999,48.217795" \
|
||||
test-data/europe_germany-2020-02-13-openmaptiles-v3.12.1.mbtiles test-data/munich-12.mbtiles
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user