/// Returns all reachable nodes in a vicinity. This can be a lot, so take care!
Returns all reachable nodes in a vicinity. This can be a lot, so take care!
Returns all reachable nodes in a vicinity . This can be a lot so take care!
pub fn reachability(req: &mut Request) -> IronResult<Response> {
    let graph = req.get::<Read<GraphPool>>().unwrap();
    use params::{Params, Value};
    let map = req.get_ref::<Params>().unwrap();
    match (map.find(&["source-lon"]), map.find(&["source-lat"]), map.find(&["capacity"])) {
        (Some(&Value::String(ref source_lon)), Some(&Value::String(ref source_lat)),
            Some(&Value::String(ref capacity))) => {
            let bellman_start = time::now();
            println!("Starting Reachability Bellman-Ford ...");
            let source_id = graph.get_id_from_lon_lat(source_lon.parse::<f64>().unwrap(),
                                                      source_lat.parse::<f64>().unwrap());
            let res = graph.reachability(source_id, capacity.parse::<f32>().unwrap());
            println!(" ˪— duration: {}s\n", (time::now() - bellman_start).num_seconds());
            Ok(Response::with((iron::status::Ok, reachability_res_to_geojson(res))))
        }
        _ => Ok(Response::with(iron::status::NotFound))
    }
}
pub fn reachability ( req : & mut Request ) -> IronResult < Response > { let graph = req . get :: < Read < GraphPool > > ( ) . unwrap ( ) ; use params :: { Params , Value } ; let map = req . get_ref :: < Params > ( ) . unwrap ( ) ; match ( map . find ( & [ " " ] ) , map . find ( & [ " " ] ) , map . find ( & [ " " ] ) ) { ( Some ( & Value :: String ( ref source_lon ) ) , Some ( & Value :: String ( ref source_lat ) ) , Some ( & Value :: String ( ref capacity ) ) ) => { let bellman_start = time :: now ( ) ; println ! ( " " ) ; let source_id = graph . get_id_from_lon_lat ( source_lon . parse :: < f64 > ( ) . unwrap ( ) , source_lat . parse :: < f64 > ( ) . unwrap ( ) ) ; let res = graph . reachability ( source_id , capacity . parse :: < f32 > ( ) . unwrap ( ) ) ; println ! ( " ,  ( m e::n ()  - lman_start).n u _seconds()) ; Ok ( Response :: with ( ( iron :: status :: Ok , reachability_res_to_geojson ( res ) ) ) ) } _ => Ok ( Response :: with ( iron :: status :: NotFound ) ) } }
Returns all reachable nodes in a vicinity.
Returns all reachable nodes in a vicinity .
req
&mut Request