Class MatchedPathToSegmentAnchorConverter
This is an experimental API. It may be removed or changed from one version to the next.
Converts MatchedPath
s 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 aMatchedPath
to 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 aMatchedPath
to HERE Map ContentSegmentAnchors
.It is possible for a single
MatchedPath
to be converted to multiple SegmentAnchors, when there areOffRoad
orUnknown
matches. Every contiguous sequence of transitions linking onlyOnRoad
results will be converted into aSegmentAnchor
.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 ofSegmentAnchors
. The reason for that is that the requirements are more strict for a sequence ofSegmentAnchors
to be valid than for a matched path. That is why,MatchedPathToSegmentAnchorConverter
works 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-
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
OnRoad
s projected on the same vertex must form a monotonically nondecreasing sequence. TwoOnRoads
A
andB
are consecutive if there is a transition such thattransition.from
points toA
andtransition.to
points toB
. For example, if there are two consecutiveOnRoads
projected on the same vertex, then the firstOnRoad
fraction should be less than or equal to the secondOnRoad
fraction, otherwise an exception will be thrown.
- Returns:
- A SegmentAnchor for each
OnRoad
section of the matched path
- The matched path must not contain transitions between non-
-