public class StreetSplitter extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DESTRUCTIVE_SPLIT
DESTRUCTIVE_SPLIT means edges are split and new edges and vertices are created.
|
static double |
DUPLICATE_WAY_EPSILON_METERS
if there are two ways and the distances to them differ by less than this value, we link to both of them
|
static HashSet<Graph> |
graphsWithSplitters |
static int |
MAX_SEARCH_RADIUS_METERS |
static boolean |
NON_DESTRUCTIVE_SPLIT
NON_DESTRUCTIVE_SPLIT means new temporary edges and vertices are created and no edges are deleted.
|
static int |
WARNING_DISTANCE_METERS |
Constructor and Description |
---|
StreetSplitter(Graph graph)
Construct a new StreetSplitter.
|
StreetSplitter(Graph graph,
HashGridSpatialIndex<Edge> hashGridSpatialIndex,
org.locationtech.jts.index.SpatialIndex transitStopIndex)
Construct a new StreetSplitter.
|
Modifier and Type | Method and Description |
---|---|
Boolean |
getAddExtraEdgesToAreas() |
void |
linkAllStationsToGraph()
Link all relevant vertices to the street network.
|
Vertex |
linkOriginDestination(GenericLocation location,
RoutingRequest options,
boolean endVertex)
Used to link origin and destination points to graph non destructively.
|
boolean |
linkToClosestWalkableEdge(Vertex vertex,
boolean destructiveSplitting,
boolean createSemiPermanentEdges)
Link this vertex into the graph to the closest walkable edge.
|
boolean |
linkToGraph(Vertex vertex,
TraverseMode traverseMode,
RoutingRequest options,
boolean destructiveSplitting,
boolean createSemiPermanentEdges)
Link a vertex into the graph to the closest edge that allows the traversal of the specified mode.
|
boolean |
linkToGraph(Vertex vertex,
TraverseModeSet traverseModeSet,
RoutingRequest options,
boolean destructiveSplitting,
boolean createSemiPermanentEdges)
Link this vertex into the graph (ie, connect the vertex to other vertices in the graph by creating one or more
new edges/vertexes which are then connected to the other vertices/edges of the graph.
|
void |
removeEdgeFromIdx(StreetEdge edge) |
void |
removeRentalStationVertexAndAssociatedSemiPermanentVerticesAndEdges(RentalStationVertex rentalStationVertex)
Helper method for removing all vertices and edges associated with a SemiPermanentSplitterVertex.
|
void |
setAddExtraEdgesToAreas(Boolean addExtraEdgesToAreas) |
public static final int MAX_SEARCH_RADIUS_METERS
public static final int WARNING_DISTANCE_METERS
public static final boolean DESTRUCTIVE_SPLIT
public static final boolean NON_DESTRUCTIVE_SPLIT
public static final double DUPLICATE_WAY_EPSILON_METERS
public StreetSplitter(Graph graph, HashGridSpatialIndex<Edge> hashGridSpatialIndex, org.locationtech.jts.index.SpatialIndex transitStopIndex)
hashGridSpatialIndex
- If not null this index is used instead of creating new onetransitStopIndex
- Index of all transitStops which is generated in org.opentripplanner.routing.impl.StreetVertexIndexServiceImpl
public StreetSplitter(Graph graph)
graph
- public void linkAllStationsToGraph()
public boolean linkToClosestWalkableEdge(Vertex vertex, boolean destructiveSplitting, boolean createSemiPermanentEdges)
vertex
- The vertex to be linked.destructiveSplitting
- If true splitting is permanent (Used when linking transit stops etc.) when
false the original edge is kept in the graph after creating split edges.createSemiPermanentEdges
- If true, semi-permanent edges and a semi-permanent splitter vertex is created.
These vertices and edges are intended to be kept in the graph and linked to
during subsequent requests, but might be removed at a later time. For example a
floating bike rental may need to be removed from the graph once the data is
updated to show that the floating bike rental no longer exists or if its
location has significantly changed.public boolean linkToGraph(Vertex vertex, TraverseMode traverseMode, RoutingRequest options, boolean destructiveSplitting, boolean createSemiPermanentEdges)
public boolean linkToGraph(Vertex vertex, TraverseModeSet traverseModeSet, RoutingRequest options, boolean destructiveSplitting, boolean createSemiPermanentEdges)
vertex
- The vertex to be linked.traverseModeSet
- The traverse modes.options
- The routing options.destructiveSplitting
- If true, splitting is permanent (Used when linking transit stops etc). When
false the original edge is kept in the graph after creating split edges.createSemiPermanentEdges
- If true, semi-permanent edges and a semi-permanent splitter vertex is created.
These vertices and edges are intended to be kept in the graph and linked to
during subsequent requests, but might be removed at a later time. For example a
floating bike rental may need to be removed from the graph once the data is
updated to show that the floating bike rental no longer exists or if its
location has significantly changed.public Vertex linkOriginDestination(GenericLocation location, RoutingRequest options, boolean endVertex)
location
- options
- endVertex
- true if this is destination vertexpublic Boolean getAddExtraEdgesToAreas()
public void setAddExtraEdgesToAreas(Boolean addExtraEdgesToAreas)
public void removeRentalStationVertexAndAssociatedSemiPermanentVerticesAndEdges(RentalStationVertex rentalStationVertex)
public void removeEdgeFromIdx(StreetEdge edge)
Copyright © 2020. All rights reserved.