inline double distance ( osmium::unsigned_object_id_type vertexa, osmium::unsigned_object_id_type vertexb ) { osmium::Location A = locations.get ( vertexa ); osmium::Location B = locations.get ( vertexb ); osmium::geom::Coordinates ac {A}; osmium::geom::Coordinates ab {B}; return osmium::geom::haversine::distance ( ac, ab ); }
inline double distance ( osmium::unsigned_object_id_type vertexa, osmium::unsigned_object_id_type vertexb ) { osmium::Location A = locations.get ( vertexa ); //Retrieve value by id. osmium::Location B = locations.get ( vertexb ); //Retrieve value by id. osmium::geom::Coordinates ac {A}; osmium::geom::Coordinates ab {B}; return osmium::geom::haversine::distance ( ac, ab ); //Calculate distance in meters between two sets of coordinates. }