-
- All Superinterfaces:
AttributeCollection
,AttributeProvider
,BoundedElement2afp<Rectangle2d>
,BoundedGISElement
,Cloneable
,GISElement
,GISPrimitive
,Graph<RoadSegment,RoadConnection>
,Iterable<RoadSegment>
,JsonableObject
,RoadSegmentContainer
,Serializable
- All Known Implementing Classes:
StandardRoadNetwork
public interface RoadNetwork extends BoundedGISElement, RoadSegmentContainer
This interface describes a road network.- 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
-
-
Field Summary
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISElement
ATTR_NAME, NAME_COMPARATOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
COMPARATOR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRoadNetworkListener(RoadNetworkListener listener)
Add a listener.void
addRoadSegment(RoadSegment segment)
Add a road segment inside the road network.Iterator<Rectangle2afp<?,?,?,?,?,?>>
boundsIterator()
Replies the bounding rectangles of the internal data-structure elements.boolean
clear()
Clear this road network by removing all the road segments.RoadConnection
connectSegmentEndPoint(RoadConnection connection, RoadSegment segment, Point2D<?,?> position)
Connection the end point of the given road segment to the given road connection or to a new connection.RoadConnection
connectSegmentStartPoint(RoadConnection connection, RoadSegment segment, Point2D<?,?> position)
Connection the start point of the given road segment to the given road connection or to a new connection.boolean
contains(RoadSegment segment)
Replies if the given road segment is inside this road network.Collection<RoadConnection>
getConnections(Rectangle2afp<?,?,?,?,?,?> bounds)
Return the the road connections inside the given bounds.Collection<RoadConnection>
getConnections(Rectangle2d bounds)
Return the the road connections inside the given bounds.RoadConnection
getNearestConnection(Point2D<?,?> pos)
Return the nearest point from a position.Point1d
getNearestPosition(Point2D<?,?> pos)
Return the nearest point 1.5D from a 2D position.Point1d
getNearestPositionOnRoadBorder(Point2D<?,?> pos)
Return the nearest point 1.5D on the road borders from a 2D position.RoadSegment
getNearestSegment(Point2D<?,?> pos)
Return the nearest segment from a position.org.eclipse.xtext.xbase.lib.Pair<? extends RoadSegment,Double>
getNearestSegmentData(Point2D<?,?> pos)
Return the nearest segment from a position; and its distance to the 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.Collection<? extends RoadSegment>
getRoadSegments()
Replies a collection of segments inside this road network.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.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.RoadConnection
mergeRoadConnections(Collection<? extends RoadConnection> connections)
Merge the given connections to obtain only one connection.RoadConnection
mergeRoadConnections(RoadConnection... connections)
Merge the given connections to obtain only one connection.void
removeRoadNetworkListener(RoadNetworkListener listener)
Remove a listener.boolean
removeRoadSegment(RoadSegment segment)
Remove a segment from this network.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.attrs.collection.AttributeCollection
addAttributeChangeListener, addAttributes, addAttributes, flush, isEventFirable, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setEventFirable
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCount, getAttributeObject, hasAttribute, toMap, toMap
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.BoundedElement2afp
getBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.BoundedGISElement
getShape, resetBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISElement
clone, copyAttributes, getName, hashKey, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
getGeoId, getGeoLocation, getUUID
-
Methods inherited from interface org.arakhne.afc.math.graph.Graph
contains, getPointCount, getSegmentCount, isEmpty
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.gis.road.primitive.RoadSegmentContainer
depthIterator, depthIterator, iterator
-
-
-
-
Method Detail
-
isLeftSidedTrafficDirection
@Pure boolean isLeftSidedTrafficDirection()
Description copied from interface:RoadSegmentContainer
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.
- Specified by:
isLeftSidedTrafficDirection
in interfaceRoadSegmentContainer
- Returns:
true
if the left-side rule is used on this network, otherwisefalse
.
-
isRightSidedTrafficDirection
@Pure boolean isRightSidedTrafficDirection()
Description copied from interface:RoadSegmentContainer
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.
- Specified by:
isRightSidedTrafficDirection
in interfaceRoadSegmentContainer
- Returns:
true
if the right-side rule is used on this network, otherwisefalse
.
-
getRoadSegments
@Pure Collection<? extends RoadSegment> getRoadSegments()
Replies a collection of segments inside this road network.- Returns:
- a collection of segments inside this road network.
-
contains
@Pure boolean contains(RoadSegment segment)
Description copied from interface:RoadSegmentContainer
Replies if the given road segment is inside this road network.- Specified by:
contains
in interfaceRoadSegmentContainer
- Parameters:
segment
- a segment.- Returns:
true
if the segment is inside the road network, otherwisefalse
-
getRoadSegment
@Pure RoadSegment getRoadSegment(GeoId geoId)
Description copied from interface:RoadSegmentContainer
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.
- Specified by:
getRoadSegment
in interfaceRoadSegmentContainer
- Parameters:
geoId
- an identifier.- Returns:
- the road segment or
null
if not found.
-
getRoadSegment
@Pure RoadSegment getRoadSegment(GeoLocation location)
Description copied from interface:RoadSegmentContainer
Replies the road segment with the given location.- Specified by:
getRoadSegment
in interfaceRoadSegmentContainer
- Parameters:
location
- a location- Returns:
- the road segment or
null
if not found.
-
getNearestConnection
@Pure RoadConnection getNearestConnection(Point2D<?,?> pos)
Return the nearest point from a position.- Parameters:
pos
- is the testing position.- Returns:
- the nearest road network point to the given point.
-
getConnections
@Pure Collection<RoadConnection> getConnections(Rectangle2afp<?,?,?,?,?,?> bounds)
Return the the road connections inside the given bounds.- Parameters:
bounds
- are the bounds to explore.- Returns:
- the road connections in the given bounds.
- Since:
- 4.0
-
getConnections
@Pure Collection<RoadConnection> getConnections(Rectangle2d bounds)
Return the the road connections inside the given bounds.- Parameters:
bounds
- are the bounds to explore.- Returns:
- the road connections in the given bounds.
- Since:
- 4.0
-
getNearestSegment
@Pure RoadSegment getNearestSegment(Point2D<?,?> pos)
Return the nearest segment from a position.- Parameters:
pos
- is the testing position.- Returns:
- the nearest road network segment to the given point.
-
getNearestSegmentData
@Pure org.eclipse.xtext.xbase.lib.Pair<? extends RoadSegment,Double> getNearestSegmentData(Point2D<?,?> pos)
Return the nearest segment from a position; and its distance to the point.- Parameters:
pos
- is the testing position.- Returns:
- the nearest road network segment and its distance
to the given point;
or
null
if none. - Since:
- 4.0
-
getNearestPosition
@Pure Point1d getNearestPosition(Point2D<?,?> pos)
Return the nearest point 1.5D from a 2D position.- Parameters:
pos
- is the testing position.- Returns:
- the nearest 1.5D position on the road network.
-
getNearestPositionOnRoadBorder
@Pure Point1d getNearestPositionOnRoadBorder(Point2D<?,?> pos)
Return the nearest point 1.5D on the road borders from a 2D position.- Parameters:
pos
- is the testing position.- Returns:
- the nearest 1.5D position on the road network.
- Since:
- 16.0
-
addRoadSegment
void addRoadSegment(RoadSegment segment)
Add a road segment inside the road network.- Parameters:
segment
- is the road segment to insert
-
removeRoadSegment
boolean removeRoadSegment(RoadSegment segment)
Remove a segment from this network.- Parameters:
segment
- is the segment to remove- Returns:
true
if the segment was successfully removed, otherwhisefalse
-
clear
boolean clear()
Clear this road network by removing all the road segments.- Returns:
true
if the road network changed due to this call; otherwisefalse
.- Since:
- 4.0
-
mergeRoadConnections
RoadConnection mergeRoadConnections(RoadConnection... connections)
Merge the given connections to obtain only one connection.- Parameters:
connections
- are the connections to merge.- Returns:
- the result of the merging action.
- Since:
- 4.0
-
mergeRoadConnections
RoadConnection mergeRoadConnections(Collection<? extends RoadConnection> connections)
Merge the given connections to obtain only one connection.- Parameters:
connections
- are the connections to merge.- Returns:
- the result of the merging action.
- Since:
- 4.0
-
connectSegmentStartPoint
RoadConnection connectSegmentStartPoint(RoadConnection connection, RoadSegment segment, Point2D<?,?> position)
Connection the start point of the given road segment to the given road connection or to a new connection.- Parameters:
connection
- is the connection to connect to, ornull
if a new connection should be created.segment
- is the road to connected to.position
- is the position where the first point of the segment should be located, ornull
if this position may be unchanged.- Returns:
- the connection to which the segment was attached.
- Since:
- 4.0
-
connectSegmentEndPoint
RoadConnection connectSegmentEndPoint(RoadConnection connection, RoadSegment segment, Point2D<?,?> position)
Connection the end point of the given road segment to the given road connection or to a new connection.- Parameters:
connection
- is the connection to connect to, ornull
if a new connection should be created.segment
- is the road to connected to.position
- is the position where the end point of the segment should be located, ornull
if this position may be unchanged.- Returns:
- the connection to which the segment was attached.
- Since:
- 4.0
-
addRoadNetworkListener
void addRoadNetworkListener(RoadNetworkListener listener)
Add a listener.- Parameters:
listener
- the listener.
-
removeRoadNetworkListener
void removeRoadNetworkListener(RoadNetworkListener listener)
Remove a listener.- Parameters:
listener
- the listener.
-
iterator
@Pure Iterator<? extends RoadSegment> iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Description copied from interface:RoadSegmentContainer
Iterates on the segments that intersect the specified bounds.- Specified by:
iterator
in interfaceRoadSegmentContainer
- 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)
Description copied from interface:RoadSegmentContainer
Iterates on the segments that intersect the specified bounds.- Specified by:
iterator
in interfaceRoadSegmentContainer
- 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)
Description copied from interface:RoadSegmentContainer
Iterates on the segments that intersect the specified bounds.- Specified by:
toIterable
in interfaceRoadSegmentContainer
- 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)
Description copied from interface:RoadSegmentContainer
Iterates on the segments that intersect the specified bounds.- Specified by:
toIterable
in interfaceRoadSegmentContainer
- 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.
-
boundsIterator
@Pure Iterator<Rectangle2afp<?,?,?,?,?,?>> boundsIterator()
Replies the bounding rectangles of the internal data-structure elements.- Returns:
- the bounding boxes in the data-structure.
-
-