Skip to content

Commit 2711e42

Browse files
committed
1-to-1 lrm and traversal: remove lookup_traversal
This function was never exposed on the bindings. In practice we want to manipulate the Lrm Signed-off-by: Tristram Gräbener <tristram+git@tristramg.eu>
1 parent b46bc0b commit 2711e42

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

src/lrs.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,6 @@ pub trait LrsBase {
383383
/// Projects a [`Point`] on all [`Lrm`] where the [`Point`] is in the bounding box.
384384
/// The result is sorted by `orthogonal_offset`: the nearest [`Lrm`] to the [`Point`] is the first item.
385385
fn lookup_lrms(&self, point: Point) -> Vec<LrmProjection>;
386-
/// Projects a [`Point`] on all [`Traversal`]s where the [`Point`] is in the bounding box.
387-
/// The result is sorted by `orthogonal_offset`: the nearest [`Lrm`] to the [`Point`] is the first item.
388-
fn lookup_traversals(&self, point: Point) -> Vec<TraversalProjection>;
389386

390387
/// Given a [`TraversalPosition`], returns it geographical position ([`Point`]).
391388
fn locate_traversal(&self, position: TraversalPosition) -> Result<Point, LrsError>;
@@ -500,26 +497,6 @@ impl<CurveImpl: Curve> LrsBase for Lrs<CurveImpl> {
500497
result
501498
}
502499

503-
fn lookup_traversals(&self, point: Point) -> Vec<TraversalProjection> {
504-
let mut result: Vec<_> = self
505-
.traversals
506-
.iter()
507-
.enumerate()
508-
.flat_map(|(idx, traversal)| traversal.curve.project(point).map(|proj| (idx, proj)))
509-
.map(|(idx, proj)| TraversalProjection {
510-
traversal: TraversalHandle(idx),
511-
orthogonal_offset: proj.offset,
512-
distance_from_start: proj.distance_along_curve,
513-
})
514-
.collect();
515-
result.sort_by(|a, b| {
516-
a.orthogonal_offset
517-
.partial_cmp(&b.orthogonal_offset)
518-
.unwrap_or(Ordering::Equal)
519-
});
520-
result
521-
}
522-
523500
fn locate_traversal(&self, position: TraversalPosition) -> Result<Point, LrsError> {
524501
Ok(self
525502
.get_curve(position.traversal)?
@@ -798,12 +775,6 @@ mod tests {
798775
assert_eq!(result[2].measure.measure.scale_offset, 5.);
799776
}
800777

801-
#[test]
802-
fn lookup_traversals() {
803-
let result = lrs().lookup_traversals(point! {x: 50., y:0.5});
804-
assert_eq!(result.len(), 2);
805-
}
806-
807778
#[test]
808779
fn locate_traversal() {
809780
let result = lrs()

0 commit comments

Comments
 (0)