Class MatchedPathToSegmentAnchorConverter
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 Summary
ConstructorsConstructorDescriptionMatchedPathToSegmentAnchorConverter(PropertyMap<Vertex, HereMapContentReference> hereMapContentReferencePropertyMap) -
Method Summary
Modifier and TypeMethodDescriptionList<com.here.schema.rib.v2.anchor.SegmentAnchor>convert(MatchedPath<Vertex, List<Vertex>> matchedPath) Converts aMatchedPathto HERE Map ContentSegmentAnchors.
-
Constructor Details
-
MatchedPathToSegmentAnchorConverter
public MatchedPathToSegmentAnchorConverter(PropertyMap<Vertex, HereMapContentReference> hereMapContentReferencePropertyMap)
-
-
Method Details
-
convert
public List<com.here.schema.rib.v2.anchor.SegmentAnchor> convert(MatchedPath<Vertex, List<Vertex>> matchedPath) Converts aMatchedPathto HERE Map ContentSegmentAnchors.It is possible for a single
MatchedPathto be converted to multiple SegmentAnchors, when there areOffRoadorUnknownmatches. Every contiguous sequence of transitions linking onlyOnRoadresults will be converted into aSegmentAnchor.Not every matched path can be converted by a
MatchedPathToSegmentAnchorConverterbecause there is no one-to-one correspondence between a matched path and a sequence ofSegmentAnchors. The reason for that is that the requirements are more strict for a sequence ofSegmentAnchorsto be valid than for a matched path. That is why,MatchedPathToSegmentAnchorConverterworks only with a subset of all possible matched paths, otherwise it throwsIllegalArgumentException. The requirements for the matched path to be processed are as follows:- The matched path must not contain transitions between non-
OnRoadmatches. - 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. TwoOnRoadsAandBare consecutive if there is a transition such thattransition.frompoints toAandtransition.topoints toB. For example, if there are two consecutiveOnRoadsprojected on the same vertex, then the firstOnRoadfraction should be less than or equal to the secondOnRoadfraction, otherwise an exception will be thrown.
- Returns:
- A SegmentAnchor for each
OnRoadsection of the matched path
- The matched path must not contain transitions between non-
-