Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chores: bumping libraries and fixing typos #89

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 106 additions & 15 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ path = "src/geometry_from_osm.rs"
[dependencies]
approx = "0.5.1"
flatbuffers = "24.3"
geo = "0.28"
thiserror = "1.0"
geo = "0.29"
thiserror = "2.0"
osm4routing = "0.7.0"
clap = { version = "4.5.1", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
num-traits = "0.2"
8 changes: 4 additions & 4 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ impl Builder {
self.inner.add_node(id, coord.into(), properties)
}

/// Add a new anchor by its cooordinates
/// Add a new anchor by its coordinates
#[pyo3(signature = (id, coord, properties, name=None))]
pub fn add_anchor(
&mut self,
Expand Down Expand Up @@ -391,7 +391,7 @@ impl Builder {
/// Add a new segment
///
/// The geometry represents the curve
/// start_node_index and end_node_index are the topological extremeties returned by `add_node`
/// start_node_index and end_node_index are the topological extremities returned by `add_node`
pub fn add_segment(
&mut self,
id: &str,
Expand All @@ -418,7 +418,7 @@ impl Builder {

/// Add a linear referencing model
///
/// It is composed by the traversal identified by traversa_index (that represents the curve)
/// It is composed by the traversal identified by traversal_index (that represents the curve)
/// and the anchors (that represent the milestones)
pub fn add_lrm(
&mut self,
Expand Down Expand Up @@ -500,7 +500,7 @@ impl Builder {

/// Orient the traversal according to two points
///
/// In the end, the first coordinate must be closer to the begining than the second
/// In the end, the first coordinate must be closer to the beginning than the second
/// If both points are so far from the curve that they are projected to a end, we consider the offset to the curve
pub fn orient_along_points(
&mut self,
Expand Down
10 changes: 5 additions & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};

use flatbuffers::{ForwardsUOffset, Vector, WIPOffset};
use geo::Coord;
use geo::{Coord, Distance};

use crate::curves::{Curve, CurveError, CurveProjection, SphericalLineStringCurve};

Expand All @@ -18,7 +18,7 @@ pub type Properties = std::collections::HashMap<String, String>;

#[macro_export]
/// Build a properties map:
/// `properties!("source" => "openstreetmap", "licence" => "ODbL")`.
/// `properties!("source" => "openstreetmap", "license" => "ODbL")`.
macro_rules! properties {
($($k:expr => $v:expr),* $(,)?) => {{
core::convert::From::from([$(($k.to_owned(), $v.to_owned()),)*])
Expand Down Expand Up @@ -483,13 +483,13 @@ impl<'fbb> Builder<'fbb> {
}
}

/// Gives the euclidian distance between two traversals
/// Gives the euclidean distance between two traversals
/// While working on spherical coordinates, this usually doesn’t make much sense,
/// this is good enough to sort curves by distance
pub fn euclidean_distance(&self, lrm_index_a: usize, lrm_index_b: usize) -> f64 {
let a = &self.temp_traversal[lrm_index_a].curve.geom;
let b = &self.temp_traversal[lrm_index_b].curve.geom;
geo::EuclideanDistance::euclidean_distance(a, b)
geo::Euclidean::distance(a, b)
}

/// Returns the position along the curve of the traversal
Expand All @@ -515,7 +515,7 @@ impl<'fbb> Builder<'fbb> {

/// Orient the traversal according to two points
///
/// In the end, the first coordinate must be closer to the begining than the second
/// In the end, the first coordinate must be closer to the beginning than the second
/// If both points are so far from the curve that they are projected to a end, we consider the offset to the curve
pub fn orient_along_points(
&mut self,
Expand Down
Loading
Loading