Module org.arakhne.afc.gis.gisroad
Interface RoadSegmentContainer
-
- All Superinterfaces:
Graph<RoadSegment,RoadConnection>
,Iterable<RoadSegment>
- All Known Subinterfaces:
RoadNetwork
- All Known Implementing Classes:
StandardRoadNetwork
,SubRoadNetwork
public interface RoadSegmentContainer extends Graph<RoadSegment,RoadConnection>
This interface describes a road segment container.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:55
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisroad
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
contains(RoadSegment segment)
Replies if the given road segment is inside this road network.default GraphIterator<RoadSegment,RoadConnection>
depthIterator(RoadSegment startingSegment, double depth, double positionFromStartingPoint, RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point.GraphIterator<RoadSegment,RoadConnection>
depthIterator(RoadSegment startingSegment, double depth, double positionFromStartingPoint, RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<RoadSegment,RoadConnection> dynamicDepthUpdater)
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point.RoadSegment
getRoadSegment(GeoId geoId)
Replies the road segment with the given identifier.RoadSegment
getRoadSegment(GeoLocation location)
Replies the road segment with the given location.boolean
isLeftSidedTrafficDirection()
Replies if this road network uses a left-side circulation direction rule.boolean
isRightSidedTrafficDirection()
Replies if this road network uses a right-side circulation direction rule.GraphIterator<RoadSegment,RoadConnection>
iterator(RoadSegment starting_segment, RoadConnection starting_point, boolean allowManyReplies, boolean assumeOrientedSegments)
Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.Iterator<? extends RoadSegment>
iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Iterates on the segments that intersect the specified bounds.Iterator<? extends RoadSegment>
iterator(Rectangle2afp<?,?,?,?,?,?> bounds, int budget)
Iterates on the segments that intersect the specified bounds.Iterable<? extends RoadSegment>
toIterable(Rectangle2afp<?,?,?,?,?,?> bounds)
Iterates on the segments that intersect the specified bounds.Iterable<? extends RoadSegment>
toIterable(Rectangle2afp<?,?,?,?,?,?> bounds, int budget)
Iterates on the segments that intersect the specified bounds.-
Methods inherited from interface org.arakhne.afc.math.graph.Graph
contains, getPointCount, getSegmentCount, isEmpty
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
isLeftSidedTrafficDirection
@Pure boolean isLeftSidedTrafficDirection()
Replies if this road network uses a left-side circulation direction rule.When left-side circulation direction rule is used, it is supposed that all vehicles are going on the left side of the roads. For example, this rule is used in UK.
- Returns:
true
if the left-side rule is used on this network, otherwisefalse
.
-
isRightSidedTrafficDirection
@Pure boolean isRightSidedTrafficDirection()
Replies if this road network uses a right-side circulation direction rule.When right-side circulation direction rule is used, it is supposed that all vehicles are going on the right side of the roads. For example, this rule is used in France.
- Returns:
true
if the right-side rule is used on this network, otherwisefalse
.
-
contains
@Pure boolean contains(RoadSegment segment)
Replies if the given road segment is inside this road network.- Parameters:
segment
- a segment.- Returns:
true
if the segment is inside the road network, otherwisefalse
-
getRoadSegment
@Pure RoadSegment getRoadSegment(GeoId geoId)
Replies the road segment with the given identifier.This function is time consuming because the location of the road segment could not be retrieved from the geoId.
- Parameters:
geoId
- an identifier.- Returns:
- the road segment or
null
if not found.
-
getRoadSegment
@Pure RoadSegment getRoadSegment(GeoLocation location)
Replies the road segment with the given location.- Parameters:
location
- a location- Returns:
- the road segment or
null
if not found.
-
depthIterator
@Pure default GraphIterator<RoadSegment,RoadConnection> depthIterator(RoadSegment startingSegment, double depth, double positionFromStartingPoint, RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments)
Description copied from interface:Graph
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point. If the specified starting point is not one of the ends of the segment, this function assumes to start from the point replied byGraphSegment.getBeginPoint()
.This function does not allow the cycles during the iterations.
- Specified by:
depthIterator
in interfaceGraph<RoadSegment,RoadConnection>
- Parameters:
startingSegment
- is the first segment to iterate.depth
- is the maximal depth to reach.positionFromStartingPoint
- is the starting position from thestartingPoint
.startingPoint
- is the starting point of the iterations.allowManyReplies
- may betrue
to allow to reply many times the same segment, otherwhisefalse
.assumeOrientedSegments
- may betrue
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 isfalse
to assume that the end points of a segment are not distinguished.- Returns:
- the iterator.
- See Also:
Graph.depthIterator(GraphSegment, double, double, GraphPoint, boolean, boolean, DynamicDepthUpdater)
-
depthIterator
@Pure GraphIterator<RoadSegment,RoadConnection> depthIterator(RoadSegment startingSegment, double depth, double positionFromStartingPoint, RoadConnection startingPoint, boolean allowManyReplies, boolean assumeOrientedSegments, DynamicDepthUpdater<RoadSegment,RoadConnection> dynamicDepthUpdater)
Description copied from interface:Graph
Replies an iterator that permits to move along the segment's graph starting from the specified segment and from the specified starting point. If the specified starting point is not one of the ends of the segment, this function assumes to start from the point replied byGraphSegment.getBeginPoint()
.This function does not allow the cycles during the iterations.
- Specified by:
depthIterator
in interfaceGraph<RoadSegment,RoadConnection>
- Parameters:
startingSegment
- is the first segment to iterate.depth
- is the maximal depth to reach.positionFromStartingPoint
- is the starting position from thestartingPoint
.startingPoint
- is the starting point of the iterations.allowManyReplies
- may betrue
to allow to reply many times the same segment, otherwhisefalse
.assumeOrientedSegments
- may betrue
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 isfalse
to assume that the end points of a segment are not distinguished.dynamicDepthUpdater
- if notnull
, it is a lambda that is used for dynamically updating the maximal depth.- Returns:
- the iterator.
- See Also:
Graph.depthIterator(GraphSegment, double, double, GraphPoint, boolean, boolean)
-
iterator
@Pure GraphIterator<RoadSegment,RoadConnection> iterator(RoadSegment starting_segment, RoadConnection starting_point, boolean allowManyReplies, boolean assumeOrientedSegments)
Description copied from interface:Graph
Replies an iterator that permits to move along the road segment's graph starting from this road segment and from the specified starting point.- Specified by:
iterator
in interfaceGraph<RoadSegment,RoadConnection>
- Parameters:
starting_segment
- is the first segment to iterate.starting_point
- is the starting point of the iterations.allowManyReplies
- may betrue
to allow to reply many times the same segment, otherwhisefalse
.assumeOrientedSegments
- may betrue
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 isfalse
to assume that the end points of a segment are not distinguished.- Returns:
- the iterator.
-
iterator
@Pure Iterator<? extends RoadSegment> iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Iterates on the segments that intersect the specified bounds.- Parameters:
bounds
- is the rectangle inside which the replied elements must be located- Returns:
- an iterator.
-
iterator
@Pure Iterator<? extends RoadSegment> iterator(Rectangle2afp<?,?,?,?,?,?> bounds, int budget)
Iterates on the segments that intersect the specified bounds.- Parameters:
bounds
- is the rectangle inside which the replied elements must be locatedbudget
- is the maximal count of elements which will be replied by the iterator.- Returns:
- an iterator.
-
toIterable
@Pure Iterable<? extends RoadSegment> toIterable(Rectangle2afp<?,?,?,?,?,?> bounds)
Iterates on the segments that intersect the specified bounds.- Parameters:
bounds
- is the rectangle inside which the replied elements must be located- Returns:
- an iterator.
-
toIterable
@Pure Iterable<? extends RoadSegment> toIterable(Rectangle2afp<?,?,?,?,?,?> bounds, int budget)
Iterates on the segments that intersect the specified bounds.- Parameters:
bounds
- is the rectangle inside which the replied elements must be locatedbudget
- is the maximal count of elements which will be replied by the iterator.- Returns:
- an iterator.
-
-