Skip to content

Commit

Permalink
Use DEFAULT_LATLON_PRECISION
Browse files Browse the repository at this point in the history
  • Loading branch information
RZR-UA committed Feb 21, 2025
1 parent 4b2fa59 commit 0c6886c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class OverlappedSegmentsMergerDS {

private static final double PRECISION = KMapUtils.HIGH_LATLON_PRECISION;
private static final double PRECISION = KMapUtils.DEFAULT_LATLON_PRECISION;

public static Track mergeSegmentsWithOverlapHandling(Track originalTrack) {
List<TrkSegment> originalSegments = new ArrayList<>(originalTrack.getSegments());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class OverlappedSegmentsMergerGPT {
* @param track the input Track containing one or more segments
* @return a new Track consisting of segments without duplicate overlaps and loops
*/
private static final double PRECISION = KMapUtils.DEFAULT_LATLON_PRECISION;

public static Track mergeSegmentsWithOverlapHandling(Track track) {
// Step 1. Extract polylines from segments
List<List<WptPt>> polylines = new ArrayList<>();
Expand Down Expand Up @@ -192,6 +194,6 @@ private static int indexOfPoint(List<WptPt> list, WptPt pt) {
private static boolean pointsEqual(WptPt a, WptPt b) {
KLatLon p1 = new KLatLon(a.getLatitude(), a.getLongitude());
KLatLon p2 = new KLatLon(b.getLatitude(), b.getLongitude());
return KMapUtils.INSTANCE.areLatLonEqual(p1, p2);
return KMapUtils.INSTANCE.areLatLonEqual(p1, p2, PRECISION);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
import net.osmand.shared.util.KMapAlgorithms;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import net.osmand.util.OverlappedSegmentsMergerDS;
import net.osmand.util.OverlappedSegmentsMergerGPT;

import org.apache.commons.logging.Log;

Expand Down

0 comments on commit 0c6886c

Please sign in to comment.