Skip to content

Commit

Permalink
fix errors related to paths
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSylex committed Sep 10, 2024
1 parent 1f6554d commit 66a13c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 4 additions & 7 deletions src/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ use std::path::Path;

pub use crate::providers::LandmaskProvider;

pub static GSHHG: &str = "gshhg_mask.tbmap.xz";
pub static OSM: &str = "osm_mask.tbmap.xz";

pub const NY: u64 = 43200;
pub const NX: u64 = 86400;

Expand Down Expand Up @@ -94,8 +91,8 @@ impl RoaringMask {
use crate::OsmData;

let buf = match provider {
LandmaskProvider::Gshhg => GsshgData::get(&GSHHG),
LandmaskProvider::Osm => OsmData::get(&OSM),
LandmaskProvider::Gshhg => GsshgData::get("gshhg_mask.tbmap.xz"),
LandmaskProvider::Osm => OsmData::get("osm_mask.tbmap.xz"),
}
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "cannot find mask"))?;

Expand Down Expand Up @@ -236,8 +233,8 @@ mod tests {
#[bench]
fn load_tmap_compressed(b: &mut Bencher) {
b.iter(|| {
let _mask = RoaringMask::from_compressed(GSHHG).unwrap();
let _mask = RoaringMask::from_compressed(OSM).unwrap();
let _mask = RoaringMask::from_compressed("assets/gshhg_mask.tbmap.xz").unwrap();
let _mask = RoaringMask::from_compressed("assets/osm_mask.tbmap.xz").unwrap();
})
}

Expand Down
11 changes: 4 additions & 7 deletions src/shapes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ use std::path::Path;
use geos::{CoordSeq, Geom, Geometry, PreparedGeometry};
use numpy::{PyArray, PyReadonlyArrayDyn};

pub static GSHHG: &str = "gshhg.wkb.xz";
pub static OSM: &str = "osm.wkb.xz";

pub use crate::providers::LandmaskProvider;

#[pyclass]
Expand Down Expand Up @@ -96,8 +93,8 @@ impl Shapes {
use crate::OsmData;

let buf = match provider {
LandmaskProvider::Gshhg => GsshgData::get(&GSHHG),
LandmaskProvider::Osm => OsmData::get(&OSM),
LandmaskProvider::Gshhg => GsshgData::get("gshhg.wkb.xz"),
LandmaskProvider::Osm => OsmData::get("osm.wkb.xz"),
}
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "cannot find shapes"))?;

Expand Down Expand Up @@ -172,8 +169,8 @@ mod tests {

#[test]
fn test_load_compressed() {
let _s = Shapes::from_compressed(GSHHG).unwrap();
let _s = Shapes::from_compressed(OSM).unwrap();
let _s = Shapes::from_compressed("assets/gshhg.wkb.xz").unwrap();
let _s = Shapes::from_compressed("assets/osm.wkb.xz").unwrap();
}

#[test]
Expand Down

0 comments on commit 66a13c2

Please sign in to comment.