use of org.opentripplanner.routing.vertextype.SampleVertex in project OpenTripPlanner by opentripplanner.
the class StreetVertexIndexServiceImpl method getSampleVertexAt.
@Override
public Vertex getSampleVertexAt(Coordinate coordinate, boolean dest) {
SampleFactory sfac = graph.getSampleFactory();
Sample s = sfac.getSample(coordinate.x, coordinate.y);
if (s == null)
return null;
// create temp vertex
SampleVertex v = new SampleVertex(graph, coordinate);
// create edges
if (dest) {
if (s.v0 != null)
new SampleEdge(s.v0, v, s.d0);
if (s.v1 != null)
new SampleEdge(s.v1, v, s.d1);
} else {
if (s.v0 != null)
new SampleEdge(v, s.v0, s.d0);
if (s.v1 != null)
new SampleEdge(v, s.v1, s.d1);
}
return v;
}
Aggregations