Package slash.navigation.base
Class RouteCalculations
java.lang.Object
slash.navigation.base.RouteCalculations
Provides
NavigationPosition calculation functionality.- Author:
- Christian Pesch, Malte Neumann
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Wgs84PositionasWgs84Position(Double longitude, Double latitude) static Wgs84PositionasWgs84Position(Double longitude, Double latitude, String description) static CompactCalendarextrapolateTime(NavigationPosition position, NavigationPosition predecessor, NavigationPosition beforePredecessor) static int[]getInsignificantPositions(List<? extends NavigationPosition> positions, double threshold) Complement ofgetSignificantPositions(java.util.List<? extends slash.navigation.common.NavigationPosition>, double): the indices of positions that Douglas-Peucker did not keep.static int[]getSignificantPositions(List<? extends NavigationPosition> positions, double threshold) Search the significant positions with the Douglas-Peucker-Algorithm.static CompactCalendarinterpolateTime(NavigationPosition position, NavigationPosition predecessor, NavigationPosition successor)
-
Constructor Details
-
RouteCalculations
public RouteCalculations()
-
-
Method Details
-
getSignificantPositions
public static int[] getSignificantPositions(List<? extends NavigationPosition> positions, double threshold) throws InterruptedException Search the significant positions with the Douglas-Peucker-Algorithm. http://de.wikipedia.org/wiki/Douglas-Peucker-Algorithmus- Parameters:
positions- the original list of positionsthreshold- determines the threshold for significance in meter- Returns:
- an array of indices to the original list of positions with the significant positions
- Throws:
InterruptedException- if the calling thread is interrupted while simplifying
-
getInsignificantPositions
public static int[] getInsignificantPositions(List<? extends NavigationPosition> positions, double threshold) throws InterruptedException Complement ofgetSignificantPositions(java.util.List<? extends slash.navigation.common.NavigationPosition>, double): the indices of positions that Douglas-Peucker did not keep.- Parameters:
positions- the original list of positions; the caller is responsible for supplying a list that won't be structurally mutated by another thread while this runs (e.g. a defensive copy taken on the EDT)threshold- determines the threshold for significance in meter- Returns:
- an array of indices to the original list of positions with the insignificant positions
- Throws:
InterruptedException- if the calling thread is interrupted while simplifying
-
asWgs84Position
-
asWgs84Position
-