Search in sources :

Example 1 with SampleVertex

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;
}
Also used : SampleFactory(org.opentripplanner.analyst.request.SampleFactory) Sample(org.opentripplanner.analyst.core.Sample) SampleVertex(org.opentripplanner.routing.vertextype.SampleVertex)

Aggregations

Sample (org.opentripplanner.analyst.core.Sample)1 SampleFactory (org.opentripplanner.analyst.request.SampleFactory)1 SampleVertex (org.opentripplanner.routing.vertextype.SampleVertex)1