Package org.onebusaway.geospatial.model

Examples of org.onebusaway.geospatial.model.XYPoint


        if (toIndex < distances.length)
          toIndex++;
      }
    }

    XYPoint xyPoint = new XYPoint(targetPoint.getX(), targetPoint.getY());

    List<PointAndIndex> assignments = _shapePointsLibrary.computePotentialAssignments(
        projectedShapePoints, distances, xyPoint, fromIndex, toIndex);

    Min<ScheduledBlockLocation> best = new Min<ScheduledBlockLocation>();
View Full Code Here


    return forward(latlon, zone);
  }

  public static ProjectedPoint forward(CoordinatePoint latlon, int zone) {
    UTMProjection projection = new UTMProjection(zone);
    XYPoint point = projection.forward(latlon);
    return new ProjectedPoint(latlon.getLat(), latlon.getLon(), point.getX(),
        point.getY(), zone);
  }
View Full Code Here

    return forward(point.toCoordinatePoint(), srid);
  }

  public static ProjectedPoint reverse(double x, double y, int srid) {
    UTMProjection projection = new UTMProjection(srid);
    XYPoint p = new XYPoint(x, y);
    CoordinatePoint latlon = projection.reverse(p);
    return new ProjectedPoint(latlon.getLat(), latlon.getLon(), x, y, srid);
  }
View Full Code Here

    for (int i = 0; i < stopTimePoints.length; i++) {
      PointAndIndex pindex = bestAssignment.get(i);
      if (pindex.distanceAlongShape > maxDistanceTraveled) {
        int index = projectedShapePoints.size() - 1;
        XYPoint point = projectedShapePoints.get(index);
        StopEntryImpl stop = stopTimes.get(i).getStop();
        XYPoint stopPoint = projection.forward(stop.getStopLocation());
        double d = stopPoint.getDistance(point);
        pindex = new PointAndIndex(point, index, d, maxDistanceTraveled);
      }
      stopTimePoints[i] = pindex;
    }
    return stopTimePoints;
View Full Code Here

    List<List<PointAndIndex>> possibleAssignments = new ArrayList<List<PointAndIndex>>();

    for (StopTimeEntryImpl stopTime : stopTimes) {

      StopEntryImpl stop = stopTime.getStop();
      XYPoint stopPoint = projection.forward(stop.getStopLocation());

      List<PointAndIndex> assignments = _shapePointsLibrary.computePotentialAssignments(
          projectedShapePoints, shapePointDistance, stopPoint, 0,
          projectedShapePoints.size());
View Full Code Here

        StopTimeEntryImpl firstStopTime = stopTimes.get(0);

        _log.warn("snapping first stop time id=" + firstStopTime.getId()
            + " to start of shape");

        XYPoint point = projectedShapePoints.get(0);

        StopEntryImpl stop = firstStopTime.getStop();
        XYPoint stopPoint = projection.forward(stop.getStopLocation());

        double d = stopPoint.getDistance(point);

        possibleAssignments.get(0).add(new PointAndIndex(point, 0, d, 0.0));
      }

      int n = possibleAssignments.size();
View Full Code Here

    int i = stopTimes.size() - 1;
    StopTimeEntryImpl lastStopTime = stopTimes.get(i);

    int lastShapePointIndex = projectedShapePoints.size() - 1;
    XYPoint lastShapePoint = projectedShapePoints.get(lastShapePointIndex);
    XYPoint stopLocation = projection.forward(lastStopTime.getStop().getStopLocation());

    double existingDistanceAlongShape = shapePoints.getDistTraveledForIndex(lastShapePointIndex);
    double extraDistanceAlongShape = lastShapePoint.getDistance(stopLocation);
    double distanceAlongShape = existingDistanceAlongShape
        + extraDistanceAlongShape;
View Full Code Here

    points.add(p(3, 0));
    points.add(p(4, 0));

    double[] shapePointDistances = shapePointDistances(points);

    XYPoint target = p(1, 1);

    List<PointAndIndex> result = spl.computePotentialAssignments(points,
        shapePointDistances, target, 0, points.size());

    assertEquals(1, result.size());
View Full Code Here

    points.add(p(10, 1));
    points.add(p(0, 1));

    double[] shapePointDistances = shapePointDistances(points);

    XYPoint target = p(1, 0.5);

    List<PointAndIndex> result = spl.computePotentialAssignments(points,
        shapePointDistances, target, 0, points.size());

    assertEquals(2, result.size());
View Full Code Here

    points.add(p(10, 1));
    points.add(p(0, 1));

    double[] shapePointDistances = shapePointDistances(points);

    XYPoint target = p(1, 0.5);

    List<PointAndIndex> result = spl.computePotentialAssignments(points,
        shapePointDistances, target, 0, points.size());

    assertEquals(3, result.size());
View Full Code Here

TOP

Related Classes of org.onebusaway.geospatial.model.XYPoint

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.