Class RoadPolyline

    • Constructor Detail

      • RoadPolyline

        public RoadPolyline()
        Create a new road segment.
      • RoadPolyline

        public RoadPolyline​(AttributeCollection attributeProvider)
        Create a new road segment.
        Parameters:
        attributeProvider - is the attribute provider associated to this segment.
      • RoadPolyline

        public RoadPolyline​(UUID id)
        Create a new road segment.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        Since:
        4.0
      • RoadPolyline

        public RoadPolyline​(UUID id,
                            AttributeCollection attributeProvider)
        Create a new road segment.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeProvider - is the attribute provider associated to this segment.
        Since:
        4.0
    • Method Detail

      • equals

        @Pure
        public boolean equals​(Object element)
        Description copied from class: MapElement
        Replies if the specified objects is the same as this one.
        Overrides:
        equals in class MapElement
      • getRoadNetwork

        @Pure
        public StandardRoadNetwork getRoadNetwork()
        Description copied from interface: RoadSegment
        Replies the road network that contains this segment.
        Specified by:
        getRoadNetwork in interface RoadSegment
        Returns:
        the road network that contains this segment.
      • setRoadNetwork

        void setRoadNetwork​(StandardRoadNetwork network)
        Set the road network that contains this segment.
        Parameters:
        network - the network.
      • getBeginPoint

        @Pure
        <CT extends RoadConnection> CT getBeginPoint​(Class<CT> connectionClass)
        Replies the first point of this segment.
        Type Parameters:
        CT - is the type of the connection to reply
        Parameters:
        connectionClass - is the type of the connection to reply
        Returns:
        the first point of null
      • getEndPoint

        @Pure
        <CT extends RoadConnection> CT getEndPoint​(Class<CT> connectionClass)
        Replies the last connection point of this segment.
        Type Parameters:
        CT - is the type of the connection to reply
        Parameters:
        connectionClass - is the type of the connection to reply
        Returns:
        the last point of null
      • getNearestPoint

        @Pure
        <CT extends RoadConnection> CT getNearestPoint​(Class<CT> connectionClass,
                                                       double x,
                                                       double y)
        Replies the nearest start/end point to the specified point.
        Type Parameters:
        CT - is the type of the connection to reply
        Parameters:
        connectionClass - is the type of the connection to reply
        x - x coordinate.
        y - y coordinate.
        Returns:
        the nearest point
      • getNearestPoint

        @Pure
        <CT extends RoadConnection> CT getNearestPoint​(Class<CT> connectionClass,
                                                       double x,
                                                       double y,
                                                       OutputParameter<Double> distance)
        Replies the nearest start/end point to the specified point.
        Type Parameters:
        CT - is the type of the connection to reply
        Parameters:
        connectionClass - is the type of the connection to reply
        x - x coordinate.
        y - y coordinate.
        distance - is the distance between the given point and the start/end point.
        Returns:
        the nearest point
      • getAntepenulvianPoint

        @Pure
        public Point2d getAntepenulvianPoint()
        Description copied from interface: RoadSegment
        Replies the coordinates of the antepenulvian (before last) point.
        Specified by:
        getAntepenulvianPoint in interface RoadSegment
        Returns:
        the coordinates of the antepenulvian (before last) point.
      • invertPointsIn

        public RoadPolyline invertPointsIn​(int groupIndex)
        Description copied from class: MapComposedElement
        invert the points coordinates of this element on the groupIndex in argument.

        This method is reversible: this.invertPointsIn(sameIndex) == this.invertPointsIn(sameIndex).invertPointsIn(sameIndex)

        NOTE: invert each parts with MapComposedElement.invertPointsIn(int) does'nt produce the same result as MapComposedElement.invert().

        This method invert points coordinates only. this.invertPointsIn(0 .. indexCount) != this.invert()

        Overrides:
        invertPointsIn in class MapComposedElement
        Parameters:
        groupIndex - int element on which invert points
        Returns:
        this
      • isConnectedTo

        @Pure
        public boolean isConnectedTo​(RoadSegment otherSegment)
        Description copied from interface: RoadSegment
        Replies if this segment is connected to the specified segment.
        Specified by:
        isConnectedTo in interface RoadSegment
        Parameters:
        otherSegment - a segment.
        Returns:
        true if this segment is connected to the given one, otherwise false
      • isTraversableFrom

        @Pure
        public boolean isTraversableFrom​(RoadConnection point)
        Description copied from interface: RoadSegment
        Replies if this road segment is traversable from the given point.

        If the given point is not the start point nor the end point, then this function replies false.

        Specified by:
        isTraversableFrom in interface RoadSegment
        Parameters:
        point - a point.
        Returns:
        true if this segment is traversable starting from the given point; otherwise false.
      • setTrafficDirection

        public void setTrafficDirection​(TrafficDirection direction)
        Description copied from interface: RoadSegment
        Set the traffic direction on this road segment.
        Specified by:
        setTrafficDirection in interface RoadSegment
        Parameters:
        direction - is the new traffic direction. If null, the default traffic direction will be set.
      • getRoadType

        @Pure
        public RoadType getRoadType()
        Description copied from interface: RoadSegment
        Replies the type of the road segment.
        Specified by:
        getRoadType in interface RoadSegment
        Returns:
        the type of the road segment.
      • setRoadType

        public void setRoadType​(RoadType type)
        Description copied from interface: RoadSegment
        Set the type of the road segment.
        Specified by:
        setRoadType in interface RoadSegment
        Parameters:
        type - is the type of the road segment.
      • getRoadNumber

        @Pure
        public String getRoadNumber()
        Description copied from interface: RoadSegment
        Replies the number of the road segment.
        Specified by:
        getRoadNumber in interface RoadSegment
        Returns:
        the number of the road segment.
      • setRoadNumber

        public void setRoadNumber​(String number)
        Description copied from interface: RoadSegment
        Set the number of the road segment.
        Specified by:
        setRoadNumber in interface RoadSegment
        Parameters:
        number - is the number of the road segment.
      • getSharedConnectionWith

        @Pure
        public RoadConnection getSharedConnectionWith​(RoadSegment otherSegment)
        Description copied from interface: RoadSegment
        Replies the shared connection between this segment and the specified one.
        Specified by:
        getSharedConnectionWith in interface RoadSegment
        Parameters:
        otherSegment - a segment.
        Returns:
        a shared connection if the two segments are connected, otherwise null
      • getDistanceFromStart

        @Pure
        public double getDistanceFromStart​(double ratio)
        Description copied from interface: RoadSegment
        Replies the distance from the starting point.
        Specified by:
        getDistanceFromStart in interface RoadSegment
        Parameters:
        ratio - is the position on the segment. 0 for the starting point and 1 for the ending point.
        Returns:
        the distance
      • getDistanceToEnd

        @Pure
        public double getDistanceToEnd​(double ratio)
        Description copied from interface: RoadSegment
        Replies the distance to the ending point.
        Specified by:
        getDistanceToEnd in interface RoadSegment
        Parameters:
        ratio - is the position on the segment. 0 for the starting point and 1 for the ending point.
        Returns:
        the distance
      • getTangentAt

        @Pure
        public Vector2d getTangentAt​(double positionOnSegment)
        Description copied from interface: Segment1D
        Replies the 2D tangent at the position on the segment.
        Specified by:
        getTangentAt in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        positionOnSegment - is the position on the segment (in 0..length).
        Returns:
        the 2D tangent at the position on the segment.
      • projectsOnPlane

        public void projectsOnPlane​(double positionOnSegment,
                                    Point2D<?,​?> position,
                                    Vector2D<?,​?> tangent)
        Description copied from interface: Segment1D
        Replies the 2D position and the 2D tangent at the position on the segment.
        Specified by:
        projectsOnPlane in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        positionOnSegment - is the position on the segment (in 0..length).
        position - is the position to fill.
        tangent - is the tangent to the segment at the given position.
      • projectsOnPlane

        public void projectsOnPlane​(double positionOnSegment,
                                    double shiftDistance,
                                    Point2D<?,​?> position,
                                    Vector2D<?,​?> tangent)
        Description copied from interface: Segment1D
        Replies the 2D position and the 2D tangent at the position on the segment.
        Specified by:
        projectsOnPlane in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        positionOnSegment - is the position on the segment (in 0..length).
        shiftDistance - is the distance that permits to shift the position from the segment.
        position - is the position to fill.
        tangent - is the tangent to the segment at the given position.
      • getGeoLocationForLocationRatio

        @Pure
        public final Point2d getGeoLocationForLocationRatio​(double ratio)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        Returns:
        the location.
      • getGeoLocationForLocationRatio

        @Pure
        public final Point2d getGeoLocationForLocationRatio​(double ratio,
                                                            double shifting)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.

        The shifting value depends on the given 2D coordinate system.

        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        shifting - is the shifting distance.
        Returns:
        the geo-location.
      • getGeoLocationForLocationRatio

        @Pure
        public final void getGeoLocationForLocationRatio​(double ratio,
                                                         Point2D<?,​?> geoLocation)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        geoLocation - is the point to set with geo-localized coordinates.
      • getGeoLocationForLocationRatio

        @Pure
        public final void getGeoLocationForLocationRatio​(double ratio,
                                                         double shifting,
                                                         Point2D<?,​?> geoLocation)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.

        The shifting value depends on the given 2D coordinate system.

        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        shifting - is the shifting distance.
        geoLocation - is the point to set with geo-localized coordinates.
      • getGeoLocationForLocationRatio

        @Pure
        public final Point2d getGeoLocationForLocationRatio​(double ratio,
                                                            double shifting,
                                                            Vector2D<?,​?> tangent)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        shifting - is the shifting distance.
        tangent - is the vector which will be set by the coordinates of the tangent at the replied point. If null the tangent will not be computed.
        Returns:
        the geo-location.
      • getGeoLocationForLocationRatio

        @Pure
        public final void getGeoLocationForLocationRatio​(double ratio,
                                                         double shifting,
                                                         Point2D<?,​?> output,
                                                         Vector2D<?,​?> tangent)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the location ratio. The location ratio is 0 for the starting point and 1 for the ending point.
        Specified by:
        getGeoLocationForLocationRatio in interface RoadSegment
        Parameters:
        ratio - is the location ratio.
        shifting - is the shifting distance.
        output - is the point to set with geo-localized coordinates.
        tangent - is the vector which will be set by the coordinates of the tangent at the replied point. If null the tangent will not be computed.
      • getGeoLocationForDistance

        @Pure
        public final Point2d getGeoLocationForDistance​(double desired_distance)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        Parameters:
        desired_distance - is the distance for which the geo location must be computed.
        Returns:
        the geo-location.
      • getGeoLocationForDistance

        @Pure
        public final Point2d getGeoLocationForDistance​(double desired_distance,
                                                       double shifting)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        Parameters:
        desired_distance - is the distance for which the geo location must be computed.
        shifting - is the shifting distance.
        Returns:
        the geo-location.
      • getGeoLocationForDistance

        @Pure
        public Point2d getGeoLocationForDistance​(double desired_distance,
                                                 double shifting,
                                                 Vector2D<?,​?> tangent)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        Parameters:
        desired_distance - is the distance for which the geo location must be computed.
        shifting - is the shifting distance.
        tangent - is the vector which will be set by the coordinates of the tangent at the replied point. If null the tangent will not be computed.
        Returns:
        the geo-location.
      • getGeoLocationForDistance

        @Pure
        public final void getGeoLocationForDistance​(double desired_distance,
                                                    Point2D<?,​?> geoLocation)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        Parameters:
        desired_distance - is the distance for which the geo location must be computed.
        geoLocation - is the point to set with geo-localized coordinates.
      • getGeoLocationForDistance

        @Pure
        public final void getGeoLocationForDistance​(double desired_distance,
                                                    double shifting,
                                                    Point2D<?,​?> geoLocation)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        Parameters:
        desired_distance - is the distance for which the geo location must be computed.
        shifting - is the shifting distance.
        geoLocation - is the point to set with geo-localized coordinates.
      • getGeoLocationForDistance

        @Pure
        public void getGeoLocationForDistance​(double desired_distance,
                                              double shifting,
                                              Point2D<?,​?> geoLocation,
                                              Vector2D<?,​?> tangent)
        Description copied from interface: RoadSegment
        Replies the geo-location of the point described by the specified distance. The desired distance is 0 for the starting point and RoadSegment.getLength() for the ending point.
        Specified by:
        getGeoLocationForDistance in interface RoadSegment
        Parameters:
        desired_distance - is the distance for which the geo location must be computed.
        shifting - is the shifting distance.
        geoLocation - is the point to set with geo-localized coordinates.
        tangent - is the vector which will be set by the coordinates of the tangent at the replied point. If null the tangent will not be computed.
      • setStartPoint

        void setStartPoint​(StandardRoadConnection desiredConnection)
        Move the start point of a road segment.

        This function forces the start point of the given segment to correspond to the specified connection point even if the original start point was not near the connection point.

        Parameters:
        desiredConnection - the connection.
      • setEndPoint

        void setEndPoint​(StandardRoadConnection desiredConnection)
        Move the end point of a road segment.

        This function forces the end point of the given segment to correspond to the specified connection point even if the original end point was not near the connection point.

        Parameters:
        desiredConnection - the connection.
      • getSegmentChain

        @Pure
        public List<RoadSegment> getSegmentChain()
        Description copied from interface: RoadSegment
        Replies a list of chained road segments without any cross-road which contains this road segment.
        Specified by:
        getSegmentChain in interface RoadSegment
        Returns:
        a list of road segments.
      • getSegmentChain

        @Pure
        public List<RoadSegment> getSegmentChain​(boolean forward_search,
                                                 boolean backward_search)
        Description copied from interface: RoadSegment
        Replies a list of chained road segments without any cross-road which contains this road segment.
        Specified by:
        getSegmentChain in interface RoadSegment
        Parameters:
        forward_search - must be true to search the chain's segments in the forward direction for this road segment.
        backward_search - must be true to search the chain's segments in the backward direction for this road segment.
        Returns:
        a list of road segments.
      • depthIterator

        @Pure
        public GraphIterator<RoadSegment,​RoadConnection> depthIterator​(double depth,
                                                                             double position_from_starting_point,
                                                                             RoadConnection starting_point,
                                                                             boolean allowManyReplies,
                                                                             boolean assumeOrientedSegments,
                                                                             DynamicDepthUpdater<RoadSegment,​RoadConnection> dynamicDepthUpdate)
        Description copied from interface: RoadSegment
        Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point. If the specified starting point is not one of the ends of th segment, this function assumes to start from the point replied by RoadSegment.getBeginPoint().
        Specified by:
        depthIterator in interface RoadSegment
        Parameters:
        depth - is the maximal depth to reach (in meters).
        position_from_starting_point - is the starting position from the starting_point (in meters).
        starting_point - is the point from which the iteration must start.
        allowManyReplies - may be true to allow to reply many times the same segment, otherwise false.
        assumeOrientedSegments - may be true to assume that the same segment has two different instances for graph iteration: the first instance is associated the first point of the segment and the second instance is associated to the last point of the segment. If this parameter is false to assume that the end points of a segment are not distinguished.
        dynamicDepthUpdate - if not null, it is invoked to dynamically update the depth.
        Returns:
        an iterator
        See Also:
        RoadSegment.depthIterator(double, double, RoadConnection, boolean, boolean)
      • iterator

        @Pure
        public GraphIterator<RoadSegment,​RoadConnection> iterator​(RoadConnection starting_point,
                                                                        boolean allowManyReplies,
                                                                        boolean assumeOrientedSegments)
        Description copied from interface: RoadSegment
        Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point. If the specified starting point is not one of the ends of th segment, this function assumes to start from the point replied by RoadSegment.getBeginPoint().
        Specified by:
        iterator in interface RoadSegment
        Parameters:
        starting_point - is the point from which the iteration must start.
        allowManyReplies - is true to allow cycles during iterations, otherwise false
        assumeOrientedSegments - indicates if the iterator is taking into account the orientation of the road segments. If true it assumes that a segment could be reached by both its end points. If false it assumes that a segment could be reach only one time. This parameter is used only when allowManyReplies was set to true.
        Returns:
        an iterator
      • iterator

        @Pure
        public GraphIterator<RoadSegment,​RoadConnection> iterator()
        Description copied from interface: RoadSegment
        Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point. This function assumes to start from the point replied by RoadSegment.getBeginPoint(). This function does not allow the cycles during the iterations.
        Specified by:
        iterator in interface RoadSegment
        Returns:
        an iterator
      • isFirstPointConnectedTo

        @Pure
        public boolean isFirstPointConnectedTo​(Segment1D<?,​?> segment)
        Description copied from interface: Segment1D
        Replies if this segment is connected to the specified segment by its first point.
        Specified by:
        isFirstPointConnectedTo in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        segment - is the segment to match.
        Returns:
        true if this segment is connected to the given one, otherwise false.
      • isLastPointConnectedTo

        @Pure
        public boolean isLastPointConnectedTo​(Segment1D<?,​?> segment)
        Description copied from interface: Segment1D
        Replies if this segment is connected to the specified segment by its last point.
        Specified by:
        isLastPointConnectedTo in interface Segment1D<Point2d,​Vector2d>
        Parameters:
        segment - is the segment to match.
        Returns:
        true if this segment is connected to the given one, otherwise false.
      • addUserData

        public void addUserData​(String id,
                                Object data)
        Description copied from interface: RoadSegment
        Add an user data associated to this segment.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        addUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to insert in the group
      • setUserData

        public void setUserData​(String id,
                                Object data)
        Description copied from interface: RoadSegment
        Set an user data associated to this segment.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        setUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to insert in the group
      • removeUserData

        public boolean removeUserData​(String id,
                                      Object data)
        Description copied from interface: RoadSegment
        Remove an user data associated to this segment.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        removeUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to remove from the group
        Returns:
        true if the data was removed, otherwise false.
      • clearUserData

        public void clearUserData​(String id)
        Description copied from interface: RoadSegment
        Clear all the data from a group.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        clearUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
      • clearUserData

        public void clearUserData()
        Description copied from interface: RoadSegment
        Clear all the data from all the groups.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        clearUserData in interface RoadSegment
      • getUserData

        @Pure
        public <T> T getUserData​(String id)
        Description copied from interface: RoadSegment
        Replies an user data associated to this segment.

        The user data are not stored as attributes because they are assumed as transient.

        Specified by:
        getUserData in interface RoadSegment
        Type Parameters:
        T - is the type of the data to reply
        Parameters:
        id - is the identifier of the group
        Returns:
        the first data in the group or null.
      • getUserDataCollection

        @Pure
        public <T> Collection<? extends T> getUserDataCollection​(String id)
        Description copied from interface: RoadSegment
        Replies the user data associated to this segment.

        The user data are not stored as attributes because they are assumed as transient.

        Specified by:
        getUserDataCollection in interface RoadSegment
        Type Parameters:
        T - is the type of the data to reply
        Parameters:
        id - is the identifier of the group
        Returns:
        the list of the user data in the group, never null.
      • hasUserData

        @Pure
        public boolean hasUserData​(String id)
        Description copied from interface: RoadSegment
        Replies if at least one user data is associated to the given identifier.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        hasUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        Returns:
        true if one user data exists, otherwise false
      • containsUserData

        @Pure
        public boolean containsUserData​(String id,
                                        Object data)
        Description copied from interface: RoadSegment
        Replies if the given one user data is associated to the given identifier.

        The user data ar not stored as attributes because they are assumed as transient.

        Specified by:
        containsUserData in interface RoadSegment
        Parameters:
        id - is the identifier of the group
        data - is the data to insert in the group
        Returns:
        true if the user data exists, otherwise false
      • getLaneCount

        @Pure
        public int getLaneCount()
        Description copied from interface: RoadSegment
        Replies the count of lanes on this road segment.
        Specified by:
        getLaneCount in interface RoadSegment
        Returns:
        the count of lanes on this road segment.
      • getWidth

        @Pure
        public double getWidth()
        Description copied from class: MapPolyline
        Returns the poly-element width in the geo-located referencial. The width is the distance between the border lines of the polyline.

        The implementation provided by the MapPolyline class always replies 1 meter. The function MapPolyline.getWidth() must be overrided to provide other way to compute the width the polyelements.

        Specified by:
        getWidth in interface RoadSegment
        Overrides:
        getWidth in class MapPolyline
        Returns:
        the width of the poly-element in meters.
      • setWidth

        public void setWidth​(double width)
        Description copied from interface: RoadSegment
        Set the road width in the geo-located referencial. The width is the distance between the border lines of the road.
        Specified by:
        setWidth in interface RoadSegment
        Parameters:
        width - is the width of the road in meters.
      • distance

        @Pure
        public final double distance​(Point2D<?,​?> point)
        Description copied from interface: RoadSegment
        Replies the distance between this MapElement and point.
        Specified by:
        distance in interface RoadSegment
        Parameters:
        point - a point
        Returns:
        the distance. Could be negative depending of the implementation type.
      • getLaneCenter

        @Pure
        public double getLaneCenter​(int laneIndex)
        Description copied from interface: RoadSegment
        Replies the center line of the lane at the given index.

        The center is given by the jutting distance from the road segment center to the center of the lane.

        The lane order is influence by the side-rule of the road network, which is replied by RoadNetwork.isLeftSidedTrafficDirection() or by RoadNetwork.isRightSidedTrafficDirection(): if left-sided the left-most lane has index 0, if right-sided the right-most lane has index 0.

        Specified by:
        getLaneCenter in interface RoadSegment
        Parameters:
        laneIndex - the lane index.
        Returns:
        shift distance from the segment's center to the lane center.
      • getRoadBorderDistance

        @Pure
        public double getRoadBorderDistance()
        Description copied from interface: RoadSegment
        Replies the distance to the road border according to the driving side on the road.

        This function is similar to calls to {@link #getWidth()} / 2 but with a big difference: the previous expression is always positive, the value returned by getRoadBorderDistance() has a positive or negative sign depending on the side where cars are running.

        Specified by:
        getRoadBorderDistance in interface RoadSegment
        Returns:
        shift distance from the segment's center to the road border.
      • getWrappedRoadSegment

        @Pure
        public RoadSegment getWrappedRoadSegment()
        Description copied from interface: RoadSegment
        Replies the wrapped road segment if this object is a wrapper to another road segment. If this object is not a wrapper to another road segment, relies this object iteself.
        Specified by:
        getWrappedRoadSegment in interface RoadSegment
        Returns:
        the wrapped road segment or this road segment itself.
      • toSegment1D

        @Pure
        protected final Segment1D<?,​?> toSegment1D()
        Description copied from class: MapPolyline
        Replies the Segment1D representation of this object.
        Overrides:
        toSegment1D in class MapPolyline
        Returns:
        the Segment1D, never null.