Skip to content

Commit

Permalink
delete all tiles in bbox at z level start fnn
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Nov 5, 2024
1 parent e0a5d17 commit 60ac224
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ strumbra = "0.5.1"
compact_str = { version = "0.8.0", features = ["serde", "diesel"] }
urlencoding = "2.1.3"
url = "2.5.2"
slippy-map-tiles = "0.16.0"
[[bin]]
name = "maple"
path = "src/maple/main.rs"
Expand Down
17 changes: 17 additions & 0 deletions src/tile_save_and_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ pub async fn get_tile(
.first::<crate::models::TileStorage>(conn)
.await
}

pub fn delete_all_tiles_in_bbox(
conn: &mut bb8::PooledConnection<'_, AsyncDieselConnectionManager<AsyncPgConnection>>,
rect: &geo::Rect<f64>,
z: u8,
c: TileCategory,
) -> Result<(), anyhow::Error> {
//make bbox
let bbox = slippy_map_tiles::BBox::new(
rect.max().y as f32,
rect.min().x as f32,
rect.min().y as f32,
rect.max().x as f32,
);

Ok(())
}

0 comments on commit 60ac224

Please sign in to comment.