Skip to content
Snippets Groups Projects
Commit ca6fac15 authored by Florian Burgener's avatar Florian Burgener
Browse files

Quality of life update

parent b4206076
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,8 @@ mod utils;
use crate::isochrone::utils::haversine_distance;
use crate::routing::find_reachable_stops_within_time_limit;
use crate::routing::RouteResult;
use crate::routing::RouteSectionResult;
use crate::routing::Route;
use crate::routing::RouteSection;
use constants::WALKING_SPEED_IN_KILOMETERS_PER_HOUR;
use hrdf_parser::CoordinateSystem;
use hrdf_parser::Coordinates;
......@@ -72,10 +72,10 @@ pub fn compute_isochrones(
// A false route is created to represent the point of origin in the results.
let (easting, northing) = wgs84_to_lv95(origin_point_latitude, origin_point_longitude);
let route = RouteResult::new(
let route = Route::new(
NaiveDateTime::default(),
departure_at,
vec![RouteSectionResult::new(
vec![RouteSection::new(
None,
0,
Some(Coordinates::default()),
......@@ -190,7 +190,7 @@ fn adjust_departure_at(
(adjusted_departure_at, adjusted_time_limit)
}
fn get_data(routes: Vec<RouteResult>, departure_at: NaiveDateTime) -> Vec<(Coordinates, Duration)> {
fn get_data(routes: Vec<Route>, departure_at: NaiveDateTime) -> Vec<(Coordinates, Duration)> {
routes
.iter()
.filter_map(|route| {
......
......@@ -7,6 +7,8 @@ mod utils;
pub use isochrone::compute_isochrones;
pub use routing::find_reachable_stops_within_time_limit;
pub use routing::plan_journey;
pub use routing::Route;
pub use routing::RouteSection;
use std::{env, error::Error};
......
......@@ -8,8 +8,8 @@ mod route_impl;
mod utils;
use hrdf_parser::Hrdf;
pub use models::RouteResult;
pub use models::RouteSectionResult;
pub use models::RouteResult as Route;
pub use models::RouteSectionResult as RouteSection;
use core::compute_routing;
......@@ -24,7 +24,7 @@ pub fn plan_journey(
arrival_stop_id: i32,
departure_at: NaiveDateTime,
verbose: bool,
) -> Option<RouteResult> {
) -> Option<Route> {
let result = compute_routing(
hrdf.data_storage(),
departure_stop_id,
......@@ -53,7 +53,7 @@ pub fn find_reachable_stops_within_time_limit(
departure_at: NaiveDateTime,
time_limit: Duration,
verbose: bool,
) -> Vec<RouteResult> {
) -> Vec<Route> {
let routes = compute_routing(
hrdf.data_storage(),
departure_stop_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment