private void checkNonChMaxWaypointDistance(List<GHPoint> points) { if (nonChMaxWaypointDistance == Integer.MAX_VALUE) { return; } GHPoint lastPoint = points.get(0); GHPoint point; double dist; DistanceCalc calc = DIST_3D; for (int i = 1; i < points.size(); i++) { point = points.get(i); dist = calc.calcDist(lastPoint.getLat(), lastPoint.getLon(), point.getLat(), point.getLon()); if (dist > nonChMaxWaypointDistance) { Map<String, Object> detailMap = new HashMap<>(2); detailMap.put("from", i - 1); detailMap.put("to", i); throw new PointDistanceExceededException("Point " + i + " is too far from Point " + (i - 1) + ": " + point, detailMap); } lastPoint = point; } }
private void checkNonChMaxWaypointDistance(List<GHPoint> points) { if (nonChMaxWaypointDistance == Integer.MAX_VALUE) { return; } GHPoint lastPoint = points.get(0); GHPoint point; double dist; DistanceCalc calc = DIST_3D; for (int i = 1; i < points.size(); i++) { point = points.get(i); dist = calc.calcDist(lastPoint.getLat(), lastPoint.getLon(), point.getLat(), point.getLon()); if (dist > nonChMaxWaypointDistance) { Map<String, Object> detailMap = new HashMap<>(2); detailMap.put("from", i - 1); detailMap.put("to", i); throw new PointDistanceExceededException("Point " + i + " is too far from Point " + (i - 1) + ": " + point, detailMap); } lastPoint = point; } }
private void checkNonChMaxWaypointDistance(List<GHPoint> points) { if (nonChMaxWaypointDistance == Integer.MAX_VALUE) { return; } GHPoint lastPoint = points.get(0); GHPoint point; double dist; DistanceCalc calc = Helper.DIST_3D; for (int i = 1; i < points.size(); i++) { point = points.get(i); dist = calc.calcDist(lastPoint.getLat(), lastPoint.getLon(), point.getLat(), point.getLon()); if (dist > nonChMaxWaypointDistance) { Map<String, Object> detailMap = new HashMap<>(2); detailMap.put("from", i - 1); detailMap.put("to", i); throw new PointDistanceExceededException("Point " + i + " is too far from Point " + (i - 1) + ": " + point, detailMap); } lastPoint = point; } }