Class MatchedPathToSegmentAnchorConverter

java.lang.Object
com.here.platform.location.integration.optimizedmap.mapmatching.javadsl.MatchedPathToSegmentAnchorConverter

public class MatchedPathToSegmentAnchorConverter extends Object

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

Converts MatchedPaths to HERE Map Content SegmentAnchors.

param: hereMapContentReferencePropertyMap A PropertyMap from matched elements to HERE Map Content References

  • Constructor Details

  • Method Details

    • convert

      public List<com.here.schema.rib.v2.anchor.SegmentAnchor> convert(MatchedPath<Vertex,List<Vertex>> matchedPath)
      Converts a MatchedPath to HERE Map Content SegmentAnchors.

      It is possible for a single MatchedPath to be converted to multiple SegmentAnchors, when there are OffRoad or Unknown matches. Every contiguous sequence of transitions linking only OnRoad results will be converted into a SegmentAnchor.

      Not every matched path can be converted by a MatchedPathToSegmentAnchorConverter because there is no one-to-one correspondence between a matched path and a sequence of SegmentAnchors. The reason for that is that the requirements are more strict for a sequence of SegmentAnchors to be valid than for a matched path. That is why, MatchedPathToSegmentAnchorConverter works only with a subset of all possible matched paths, otherwise it throws IllegalArgumentException. The requirements for the matched path to be processed are as follows:

      • The matched path must not contain transitions between non-OnRoad matches.
      • The matched path must not contains cycles. There is a cycle if the matched path traverses any given segment more than once.
      • The fractions of consecutive OnRoads projected on the same vertex must form a monotonically nondecreasing sequence. Two OnRoads A and B are consecutive if there is a transition such that transition.from points to A and transition.to points to B. For example, if there are two consecutive OnRoads projected on the same vertex, then the first OnRoad fraction should be less than or equal to the second OnRoad fraction, otherwise an exception will be thrown.

      Returns:
      A SegmentAnchor for each OnRoad section of the matched path