Packages

package mapmatching

Provides building blocks for implementing customizable map matchers.

See also com.here.platform.location.core.mapmatching.HMMPathMatcher.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. mapmatching
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait CandidateGenerator[O, V] extends AnyRef

    Generates candidate MatchResults for a particular observation.

    Generates candidate MatchResults for a particular observation.

    See also HMMPathMatcher.

    O

    The observation type

    V

    The type of the elements for OnRoad matching

  2. class DirectDistanceCalculator[O, V, E, T] extends DistanceAndTransitionsCalculator[O, V, Seq[V]]

    Calculates the distance between positions by following the road network, but only up to a directly connected vertex.

    Calculates the distance between positions by following the road network, but only up to a directly connected vertex.

    • The distance between positions on the same vertex that are ordered in the same direction as the vertex is their distance along that vertex.
    • The distance between a position on vertex A and a position on a directly connected vertex B is the total length of the parts of A and B that you would have to traverse to get from one position into the other.
    • The distance between two points on vertices that are not directly connected is Double.PositiveInfinity.

    DirectDistanceCalculator also returns a transition for each calculated distance. The transition is the sequence of intermediate vertices that have to be traversed fully to get from one point to the other (excluding start vertex and end vertex).

    • If both positions are on the same vertex or on directly connected vertices, the transition is an empty sequence of vertices because there are no intermediate vertices to traverse.
    • Otherwise, the transition is None because the connectivity between the two points was not determined.
    O

    The observation type

    V

    The graph vertex type

    E

    The graph edge type

    T

    The transition type

  3. trait DistanceAndTransitionsCalculator[-O, V, T] extends AnyRef

    Calculates distances and (optionally) transitions from a current position associated to a current observation, and to several next positions associated to the next observation.

    Calculates distances and (optionally) transitions from a current position associated to a current observation, and to several next positions associated to the next observation.

    It is required by DistanceTransitionProbabilityStrategy.

    O

    The observation type

    V

    The vertex type

    T

    The transition type

    Annotations
    @FunctionalInterface()
  4. class DistanceEmissionProbabilityStrategy[O, V] extends EmissionProbabilityStrategy[O, V]

    Computes emission probabilities for candidates based on distance.

    Computes emission probabilities for candidates based on distance. A java.lang.UnsupportedOperationException is thrown for OffRoad.

    See also com.here.platform.location.core.mapmatching.GaussianProbabilityDistribution.

  5. class DistanceFilter[O] extends Filter[O]

    Filters out observations from a trip that are closer than minDistance to the most recent retained point.

    This is an experimental API. It may be removed or changed from one version to the next.

    Filters out observations from a trip that are closer than minDistance to the most recent retained point.

    For example, consider the observations P1, P2 and P3 with the following distances between them:

    • 2 meters from P1 to P2
    • 4 meters from P1 to P3
    • 2 meters from P2 to P3

    Applying a DistanceFilter with a minDistance of 3 meters to these observations filters out P2. So the result is Seq(Retain(P1), Omit(P2), Retain(P3)).

    O

    The observation type

    Annotations
    @Experimental()
  6. class DistanceTransitionProbabilityStrategy[O, V, T] extends TransitionProbabilityStrategyBase[O, V, T]

    Calculates transition probability values based on the length of the route between projected points.

    Calculates transition probability values based on the length of the route between projected points.

    Specifically, it calculates the straight-line distance between observations and the length of the shortest route connecting each pair of projected points, then calculates the difference between these values and turns it into log(probability) values with probabilityDistribution.

    O

    The observation type

  7. trait EmissionProbabilityStrategy[O, V] extends AnyRef

    Computes emission probabilities for candidates associated with an observation.

  8. class ExponentialProbabilityDistribution extends ProbabilityDistribution

    Exponential distribution.

    Exponential distribution.

    See also Exponential_distribution.

  9. trait Filter[O] extends AnyRef

    Marks each observation in a trip either as to be Omited, or to be Retained.

    This is an experimental API. It may be removed or changed from one version to the next.

    Marks each observation in a trip either as to be Omited, or to be Retained.

    See also

    Annotations
    @Experimental()
  10. sealed trait FilteredObservation[O] extends AnyRef

    The result of applying a Filter to an observation.

    This is an experimental API. It may be removed or changed from one version to the next.

    The result of applying a Filter to an observation. A Filter marks each observation in a trip either as to be Omited, or to be Retained.

    Annotations
    @Experimental()
  11. class GaussianProbabilityDistribution extends ProbabilityDistribution

    Gaussian, or normal, probability distribution.

    Gaussian, or normal, probability distribution.

    See also Normal_distribution.

  12. class HMMPathMatcher[O, V, T] extends PathMatcher[O, V, T]

    An implementation of PathMatcher that creates a Hidden Markov Model (HMM) and calculates the most likely path using the Viterbi algorithm.

    An implementation of PathMatcher that creates a Hidden Markov Model (HMM) and calculates the most likely path using the Viterbi algorithm.

    An instance of HMMPathMatcher delegates the creation of the following HMM components:

    • The candidateGenerator object creates candidate states.
      Candidate states are possible MatchResults for a given observation of type O. Typically, a candidate state is the projection of an observation onto a nearby vertex of type V.
    • The emissionProbabilityStrategy object calculates the emission probabilities.
      The emission probability represents the probability that an observation is emitted supposing that the system is in a given candidate state.
    • The transitionProbabilityStrategy object calculates the transition probabilities. Depending on the implementation, this object may return additional information of type T about the transitions.
      Given two successive observations O1 and O2, a candidate state C1 generated for O1 and a candidate state C2 generated for O2, the transition probability between C1 and C2 represents the probability of the system going from state C1 to state C2.

    See also Hidden Markov Map Matching Through Noise and Sparseness.

  13. trait Interpolator[O, V, T] extends AnyRef

    An Interpolator inserts MatchResults into the provided MatchedPath.results, one for each observation that was marked as Omitted.

    This is an experimental API. It may be removed or changed from one version to the next.

    An Interpolator inserts MatchResults into the provided MatchedPath.results, one for each observation that was marked as Omitted. It also updates MatchedPath.transitions accordingly. This does not modify the original MatchedPath.

    See also PathMatcherWithFilter for more information about filtering and interpolation.

    Annotations
    @Experimental()
  14. final case class LogProbability(value: Double) extends AnyVal with Product with Serializable

    Logarithmic probability used in HMM computations.

    Logarithmic probability used in HMM computations.

    All probabilities are stored and computed using their log value to produce more stable and accurate results.

  15. class LogProbabilityMatrix extends AnyRef

    A Matrix of LogProbability values.

    A Matrix of LogProbability values.

    Internally, the probabilities are stored in an IndexedSeq[LogProbabilitySeq], one LogProbabilitySeq for each row of the matrix.

  16. trait LogProbabilitySeq extends AnyRef

    A Sequence of LogProbability values.

    A Sequence of LogProbability values.

    Internally, the probabilities are stored in an Array[Double]

  17. sealed trait MatchResult[+V] extends AnyRef

    The result of matching an observation to a road network.

  18. case class MatchedPath[V, T](results: Seq[MatchResult[V]], transitions: Seq[Transition[T]]) extends Product with Serializable

    The result of applying a PathMatcher to observations.

    The result of applying a PathMatcher to observations.

    See also TransitionProbabilityStrategy, which may compute transition data.

    V

    The type of the elements for OnRoad results

    T

    The type of transition data

    results

    The MatchResult for each observation. The results will always have the same length as the input trace, and each element will correspond one to one with an input point in the same order. The type of result will indicate if the point was matched OnRoad or not.

    transitions

    The Transitions between results if they were computed during matching. When computed the transitions will contain the information to reconstruct a path connecting results together.

    • Some results may not be connected to transitions, meaning there may be no Transition going from or to that result. For example, a path containing an Unknown result could contain transitions that skip this result. That way, the transitions give a consistent picture of the path traveled while ignoring the Unknown, likely caused by incorrect data.
    • For any transition t, t.from must be less than t.to.
    • For two consecutive transitions t1 and t2, t1.to must be less than or equal to t2.from (the transitions must be sorted in ascending order)
  19. abstract final class NoTransition extends AnyRef

    A type that indicates that no transitions are returned from the corresponding path matcher.

  20. final case class Omit[O](value: O) extends FilteredObservation[O] with Product with Serializable

    The value was filtered out.

    This is an experimental API. It may be removed or changed from one version to the next.

    The value was filtered out.

    Annotations
    @Experimental()
  21. case class OnRoad[V](elementProjection: ElementProjection[V]) extends MatchResult[V] with Product with Serializable

    Represents a successful match to an element of type V.

  22. trait PathMatcher[O, V, T] extends AnyRef

    A path-based map matcher.

    A path-based map matcher.

    O

    The observation type

    V

    The type of the elements for OnRoad results

    T

    The type of transitions computed during matching, if any, and returned as part of the MatchedPath.

  23. class PathMatcherWithFilter[O, V, T] extends PathMatcher[O, V, T]

    A PathMatcher that filters observations, map matches the remaining observations using the inner PathMatcher, and interpolates a MatchResult for each observation previously filtered out.

    This is an experimental API. It may be removed or changed from one version to the next.

    A PathMatcher that filters observations, map matches the remaining observations using the inner PathMatcher, and interpolates a MatchResult for each observation previously filtered out. The Interpolator also adapts the MatchedPath#transitions accordingly.

    Filtering is especially useful when the positions of observations are close to one another. This can happen when, for example, a car is slowly moving in a straight line, recording its position every second. Because of GPS noise, these observations can give the impression that the car was moving back and forth. Handling such a trip directly in a PathMatcher can be challenging. Instead, it is simpler to use a Filter in order to remove the observations that are responsible for this misleading impression.

    Internally, PathMatcherWithFilter uses a Filter to mark each observation as either to be Omitted or to be Retained. It then collects the Retained observations and passes them to the inner PathMatcher for map matching. Last, it uses the Interpolator to process the resulting MatchedPath and create a new MatchedPath. This new MatchedPath contains an interpolated MatchResult for each observation previously filtered out and MatchedPath.transitions adapted to the new MatchedPath.results.

    Annotations
    @Experimental()
  24. trait ProbabilityDistribution extends Serializable

    Defines the probability distribution for a continuous random variable.

  25. class ProjectingInterpolator[O, V, LS] extends Interpolator[O, V, Seq[V]]

    An Interpolator that tries to insert an OnRoad result for each Omitted observation by projecting the observation onto the matchedPath.

    This is an experimental API. It may be removed or changed from one version to the next.

    An Interpolator that tries to insert an OnRoad result for each Omitted observation by projecting the observation onto the matchedPath.

    If a transition connects two OnRoad results for Retained observations, then any Omitted observation that occurred between these observations is covered by this transition and is interpolated to an OnRoad.

    The Interpolator inserts an Unknown for each Omitted observation that is not covered by such a transition between OnRoads.

    It also ensures that the interpolated OnRoad results are in order along the matchedPath.

    Annotations
    @Experimental()
  26. class ProximitySearchCandidateGenerator[O, V] extends CandidateGenerator[O, V]

    Generates candidate States for an observation by proximity search.

    Generates candidate States for an observation by proximity search.

    O

    The type of an observation

    V

    The type of the elements for OnRoad matching

  27. final case class Retain[O](value: O) extends FilteredObservation[O] with Product with Serializable

    The value successfully passed the filter.

    This is an experimental API. It may be removed or changed from one version to the next.

    The value successfully passed the filter.

    Annotations
    @Experimental()
  28. trait SupportForUnknown[O, V] extends CandidateGenerator[O, V]

    Adds an Unknown to the list of generated candidates.

  29. class ToUnknownInterpolator[O, V, T] extends Interpolator[O, V, T]

    An Interpolator that inserts an Unknown for each observation that was marked to be Omitted.

    This is an experimental API. It may be removed or changed from one version to the next.

    An Interpolator that inserts an Unknown for each observation that was marked to be Omitted. It updates only the indices of transitions contained in matchedPath but does not add or remove transitions.

    If you want to use PathMatcherWithFilter but don't need the MatchResults for points that were filtered out, use ToUnknownInterpolator.

    This Interpolator is faster than ProjectingInterpolator. The latter provides OnRoad results.

    Annotations
    @Experimental()
  30. trait TransitionProbabilityStrategy[O, V, T] extends AnyRef

    Computes the transition probabilities and (optionally) additional transition data.

    Computes the transition probabilities and (optionally) additional transition data.

    O

    The type of an observation

    V

    The type of the elements for OnRoad results

    T

    The type of the transitions between candidates. This can be anything related to a transition, for example the path between OnRoad candidates

  31. class SimpleConnectivityTransitionProbabilityStrategy[O, V, E] extends TransitionProbabilityStrategyBase[O, V, NoTransition]

    A simplistic implementation to compute transition probabilities for dense probe points.

    A simplistic implementation to compute transition probabilities for dense probe points.

    Computes a transition probability by classifying the connectivity between road segments using a topology graph. Each case is associated with a constant value for the transition probability.

    This class distinguishes three cases:

    • SameVertex: The two segments are the same
    • Neighboring: The two segments are directly connected
    • Distant/Disconnected: The two segments are not directly connected
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version SDK 2.48) Please use DistanceTransitionProbabilityStrategy

    Note

    Although it produces reasonable results when the map data and the probe data are of high quality, this is not meant for implementing a general purpose map matcher.

Value Members

  1. object CandidateGenerators
  2. object DistanceEmissionProbabilityStrategy
  3. object DistanceTransitionProbabilityStrategy
  4. object ExponentialProbabilityDistribution extends Serializable
  5. object LogProbabilityMatrix
  6. object LogProbabilitySeq
  7. object MatchedPath extends Serializable
  8. object OffRoad extends MatchResult[Nothing] with Product with Serializable

    Represents an "off-road" where a path matcher decides that the corresponding observation occurred outside of the road network.

    Represents an "off-road" where a path matcher decides that the corresponding observation occurred outside of the road network.

    A few examples might be moving on parking lots, or driving off-track.

  9. object ProximitySearchCandidateGenerator
  10. object Solver

    Finds the most likely path through a Map-Matching specific Hidden Markov Model.

    Finds the most likely path through a Map-Matching specific Hidden Markov Model.

    The solver finds the most probable sequence of states, given the provided states and transitions without filtering states or transitions.

    Note

    In case of numerical difficulties the solution is undefined.

  11. object Unknown extends MatchResult[Nothing] with Product with Serializable

    Represents a result when the path matcher fails to match an observation.

    Represents a result when the path matcher fails to match an observation.

    This might happen in case of observation outliers.

Deprecated Value Members

  1. object SimpleConnectivityTransitionProbabilityStrategy
    Annotations
    @deprecated
    Deprecated

    (Since version 2.48) Please use DistanceTransitionProbabilityStrategy

Inherited from AnyRef

Inherited from Any

Ungrouped