MCPcopy Create free account
hub / github.com/comaps/comaps / DistanceToSegment

Function DistanceToSegment

tools/track_analyzing/track_matcher.cpp:27–32  ·  view source on GitHub ↗

Mercator distance from segment to point in meters.

Source from the content-addressed store, hash-verified

25
26// Mercator distance from segment to point in meters.
27double DistanceToSegment(m2::PointD const & segmentBegin, m2::PointD const & segmentEnd, m2::PointD const & point)
28{
29 m2::ParametrizedSegment<m2::PointD> const segment(segmentBegin, segmentEnd);
30 m2::PointD const projectionPoint = segment.ClosestPointTo(point);
31 return mercator::DistanceOnEarth(point, projectionPoint);
32}
33
34double DistanceToSegment(Segment const & segment, m2::PointD const & point, IndexGraph & indexGraph)
35{

Callers 2

FillCandidatesMethod · 0.85

Calls 6

ClosestPointToMethod · 0.80
DistanceOnEarthFunction · 0.50
FromLatLonFunction · 0.50
GetFeatureIdMethod · 0.45
GetPointMethod · 0.45
GetPointIdMethod · 0.45

Tested by

no test coverage detected