Package org.onebusaway.uk.network_rail.gtfs_realtime.graph.RailwayGraph

Examples of org.onebusaway.uk.network_rail.gtfs_realtime.graph.RailwayGraph.Node


      return nodes.get(0).getPoint();
    }
    if (index >= nodes.size()) {
      return nodes.get(nodes.size() - 1).getPoint();
    }
    Node nodeFrom = nodes.get(index - 1);
    Node nodeTo = nodes.get(index);
    double dFrom = relativeShapeDistance[index - 1];
    double dTo = relativeShapeDistance[index];
    double ratio = (d - dFrom) / (dTo - dFrom);
    double x = nodeFrom.getX() + ratio * (nodeTo.getX() - nodeFrom.getX());
    double y = nodeFrom.getY() + ratio * (nodeTo.getY() - nodeFrom.getY());
    return new Point2D.Double(x, y);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.uk.network_rail.gtfs_realtime.graph.RailwayGraph.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.