@Test public void testIsAwayEqReturn() throws IOException { assertFalse(Tracks.isAwayEqReturn(toDefault(loadTrack()))); }
public static boolean isAwayEqReturn(Track track) { Distance maxDiff = DefaultDistance.of(75, DistanceUnit.METERS); int parts = 20; List<Segment> segments = Segmenters .getSegmenter(new DivideTrack(parts, Distance.class)) .segment(track).getSegments(); for (int i = 0; i < segments.size() / 2; i++) { WayPoint fw = Iterables.get(segments.get(i).getTrackpoints(), 0); WayPoint bw = Iterables.getLast(segments.get( segments.size() - 1 - i).getTrackpoints()); Distance diffMeters = GeoUtil.calcDistance(fw, bw); if (diffMeters.compareTo(maxDiff) > 0) { return false; } } return true; }
Tracks { public static boolean isAwayEqReturn(Track track) { Distance maxDiff = DefaultDistance.of(75, DistanceUnit.METERS); int parts = 20; List<Segment> segments = Segmenters .getSegmenter(new DivideTrack(parts, Distance.class)) .segment(track).getSegments(); for (int i = 0; i < segments.size() / 2; i++) { WayPoint fw = Iterables.get(segments.get(i).getTrackpoints(), 0); WayPoint bw = Iterables.getLast(segments.get( segments.size() - 1 - i).getTrackpoints()); Distance diffMeters = GeoUtil.calcDistance(fw, bw); if (diffMeters.compareTo(maxDiff) > 0) { return false; } } return true; } }
Tracks { public static boolean isAwayEqReturn(Track track) { Distance maxDiff = DefaultDistance.of(75, DistanceUnit.METERS); int parts = 20; List<Segment> segments = Segmenters .getSegmenter(new DivideTrack(parts, Distance.class)) .segment(track).getSegments(); for (int i = 0; i < segments.size() / 2; i++) { WayPoint fw = Iterables.get(segments.get(i).getTrackpoints(), 0); WayPoint bw = Iterables.getLast(segments.get( segments.size() - 1 - i).getTrackpoints()); Distance diffMeters = GeoUtil.calcDistance(fw, bw); if (diffMeters.compareTo(maxDiff) > 0) { return false; } } return true; } private  Tracks(); }
Tracks { public static boolean isAwayEqReturn(Track track) { Distance maxDiff = DefaultDistance.of(75, DistanceUnit.METERS); int parts = 20; List<Segment> segments = Segmenters .getSegmenter(new DivideTrack(parts, Distance.class)) .segment(track).getSegments(); for (int i = 0; i < segments.size() / 2; i++) { WayPoint fw = Iterables.get(segments.get(i).getTrackpoints(), 0); WayPoint bw = Iterables.getLast(segments.get( segments.size() - 1 - i).getTrackpoints()); Distance diffMeters = GeoUtil.calcDistance(fw, bw); if (diffMeters.compareTo(maxDiff) > 0) { return false; } } return true; } private  Tracks(); static LinkedTrackPoint getStartPoint(Track track); static LinkedTrackPoint getStartPoint(
			Collection<? extends LinkedTrackPoint> trackpoints); static LinkedTrackPoint getEndPoint(Track track); static LinkedTrackPoint getEndPoint(
			Collection<? extends LinkedTrackPoint> trackpoints); static Track reverseView(final Track track); static Track reverse(Track track); static boolean isRoundtrip(Track track); static boolean isAwayEqReturn(Track track); }
Tracks { public static boolean isAwayEqReturn(Track track) { Distance maxDiff = DefaultDistance.of(75, DistanceUnit.METERS); int parts = 20; List<Segment> segments = Segmenters .getSegmenter(new DivideTrack(parts, Distance.class)) .segment(track).getSegments(); for (int i = 0; i < segments.size() / 2; i++) { WayPoint fw = Iterables.get(segments.get(i).getTrackpoints(), 0); WayPoint bw = Iterables.getLast(segments.get( segments.size() - 1 - i).getTrackpoints()); Distance diffMeters = GeoUtil.calcDistance(fw, bw); if (diffMeters.compareTo(maxDiff) > 0) { return false; } } return true; } private  Tracks(); static LinkedTrackPoint getStartPoint(Track track); static LinkedTrackPoint getStartPoint(
			Collection<? extends LinkedTrackPoint> trackpoints); static LinkedTrackPoint getEndPoint(Track track); static LinkedTrackPoint getEndPoint(
			Collection<? extends LinkedTrackPoint> trackpoints); static Track reverseView(final Track track); static Track reverse(Track track); static boolean isRoundtrip(Track track); static boolean isAwayEqReturn(Track track);  }