Skip to content

Commit

Permalink
feat: Migrate to 'geo-index' crate
Browse files Browse the repository at this point in the history
  • Loading branch information
gschulze committed Oct 8, 2024
1 parent 16ddd6b commit 084bcdf
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 150 deletions.
85 changes: 38 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ repository = "https://github.com/georust/geotiff"

[dependencies]
delaunator = "1.0"
geo-types = { version = "0.7", features = ["approx", "rstar_0_12"] }
geo-index = "0.1"
geo-types = { version = "0.7" }
num_enum = "0.7"
num-traits = "0.2"
rstar = "0.12"
tiff = "0.9"

[dev-dependencies]
Expand Down
19 changes: 11 additions & 8 deletions src/coordinate_transform.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::rc::Rc;

use geo_index::rtree::OwnedRTree;
use geo_types::Coord;
use rstar::RTree;
use tiff::{TiffError, TiffFormatError, TiffResult};
use crate::coordinate_transform::tie_points::{Face, TreeItem};

use crate::coordinate_transform::tie_points::Face;

mod affine_transform;
mod tie_point_and_pixel_scale;
Expand All @@ -25,9 +27,9 @@ pub enum CoordinateTransform {
},
TiePoints {
raster_mesh: Rc<Vec<Face>>,
raster_index: RTree<TreeItem>,
raster_index: OwnedRTree<f64>,
model_mesh: Rc<Vec<Face>>,
model_index: RTree<TreeItem>,
model_index: OwnedRTree<f64>,
},
}

Expand Down Expand Up @@ -124,11 +126,11 @@ impl CoordinateTransform {
coord,
),
CoordinateTransform::TiePoints {
model_mesh,
raster_index,
raster_mesh,
model_mesh,
..
} => Self::transform_by_tie_points(raster_index, model_mesh, coord),

} => Self::transform_by_tie_points(raster_index, raster_mesh, model_mesh, coord),
}
}

Expand All @@ -149,9 +151,10 @@ impl CoordinateTransform {
),
CoordinateTransform::TiePoints {
model_index,
model_mesh,
raster_mesh,
..
} => Self::transform_by_tie_points(model_index, raster_mesh, coord),
} => Self::transform_by_tie_points(model_index, model_mesh, raster_mesh, coord),
}
}
}
Loading

0 comments on commit 084bcdf

Please sign in to comment.