-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring of get profile (fix, simplification, clarity, performance)
- Loading branch information
Showing
6 changed files
with
92 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...org/noise_planet/noisemodelling/pathfinder/profilebuilder/CutPointDistanceComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.noise_planet.noisemodelling.pathfinder.profilebuilder; | ||
|
||
import org.locationtech.jts.geom.Coordinate; | ||
|
||
import java.util.Comparator; | ||
|
||
public class CutPointDistanceComparator implements Comparator<CutPoint> { | ||
private final Coordinate reference; | ||
|
||
public CutPointDistanceComparator(Coordinate reference) { | ||
this.reference = reference; | ||
} | ||
|
||
@Override | ||
public int compare(CutPoint o1, CutPoint o2) { | ||
return Double.compare(o1.coordinate.distance(reference), o2.coordinate.distance(reference)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.