Class PolylineSimplifier
Class PolylineSimplifier
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.core.PolylineSimplifier
-
public final class PolylineSimplifier extends NativeBase
PolylineSimplifier helps to reduce the number of points in the polyline by removing redundant elements using Douglas–Peucker algorithm, so that result stays within
PolylineSimplifier.Options.Typical use case is to perform input preparation step before invoking computationally heavy API. Such API have an upper limit on the input collection size and is subject to reduced performance when collection is huge. Examples of such API are:
TrafficEnginemethods which accept aGeoCorridor;RoutePrefetcher.prefetchGeoCorridor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPolylineSimplifier.OptionsControls the strategy ofsimplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback)when reducing a size of polyline.
-
Constructor Summary
Constructors Constructor Description PolylineSimplifier()Creates a new instance ofPolylineSimplifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskHandlesimplify(java.util.List<GeoCoordinates> polyline, PolylineSimplifier.Options simplificationParameters, PolylineSimplificationCallback callback)Reduces the number of points in the input polyline.
-
-
-
Constructor Detail
-
PolylineSimplifier
public PolylineSimplifier() throws InstantiationErrorExceptionCreates a new instance of
PolylineSimplifier.- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
-
Method Detail
-
simplify
@NonNull public TaskHandle simplify(@NonNull java.util.List<GeoCoordinates> polyline, @NonNull PolylineSimplifier.Options simplificationParameters, @NonNull PolylineSimplificationCallback callback)
Reduces the number of points in the input polyline. Does this by removing points which are not significant according to the passed
PolylineSimplifier.Options. Simplification process is performed on the device without connecting to the network and is computationally intensive.- Parameters:
polyline-Input polyline that should be reduced in size.
simplificationParameters-Strategy, that controls the behavior of the underlying algorithm.
callback-Callback, which will be invoked on the main thread, when operation is finished.
- Returns:
Controls an asynchronous operation.
-
-