PolylineSimplifier.Options (API Reference)
Class PolylineSimplifier.Options
- Enclosing class:
- PolylineSimplifier
Controls the strategy of PolylineSimplifier.simplify(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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionlongSets the upper limit on the resulting collection for thePolylineSimplifier.simplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback).static final longValue for simplification tolerance for 14 zoom level without significant artifacts.longSets the accuracy limit for thePolylineSimplifier.simplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback): higher tolerance results in more simplification (fewer points); lower tolerance keeps the line closer to its original shape. -
Constructor Summary
ConstructorsConstructorDescriptionOptions()Creates default options withmaxPointsequal to 0 andsimplificationToleranceInMetersequal toSIMPLIFICATION_IN_METERS_14_ZOOM_LEVEL.Options(long maxPoints, long simplificationToleranceInMeters) Creates options with explicitly specifiedmaxPointsandsimplificationToleranceInMeters. -
Method Summary
-
Field Details
-
SIMPLIFICATION_IN_METERS_14_ZOOM_LEVEL
public static final long SIMPLIFICATION_IN_METERS_14_ZOOM_LEVELValue for simplification tolerance for 14 zoom level without significant artifacts.
- See Also:
-
maxPoints
public long maxPointsSets the upper limit on the resulting collection for the
PolylineSimplifier.simplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback). Lower value results in the lower accuracy of the resulting polyline. IfmaxPointsis less than2then resulting polyline will not have an upper limit on the size and onlysimplificationToleranceInMeterswill be considered. WhenmaxPointsis greater than size of the passed polyline then simplification algorithm will take into account onlysimplificationToleranceInMeters. -
simplificationToleranceInMeters
public long simplificationToleranceInMetersSets the accuracy limit for the
PolylineSimplifier.simplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback):- higher tolerance results in more simplification (fewer points);
- lower tolerance keeps the line closer to its original shape.
If removing a point produces polyline, which deviates from the original one more than
simplificationToleranceInMeters, then this point is left in the collection.If specified tolerance will not allow to create a polyline conforming to
maxPoints, thensimplificationToleranceInMetersis ignored.Default value is equal to
SIMPLIFICATION_IN_METERS_14_ZOOM_LEVEL.
-
-
Constructor Details
-
Options
public Options()Creates default options with
maxPointsequal to 0 andsimplificationToleranceInMetersequal toSIMPLIFICATION_IN_METERS_14_ZOOM_LEVEL. -
Options
public Options(long maxPoints, long simplificationToleranceInMeters) Creates options with explicitly specified
maxPointsandsimplificationToleranceInMeters.- Parameters:
maxPoints-Sets the upper limit on the resulting collection for the
PolylineSimplifier.simplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback). Lower value results in the lower accuracy of the resulting polyline. IfmaxPointsis less than2then resulting polyline will not have an upper limit on the size and onlysimplificationToleranceInMeterswill be considered. WhenmaxPointsis greater than size of the passed polyline then simplification algorithm will take into account onlysimplificationToleranceInMeters.simplificationToleranceInMeters-Sets the accuracy limit for the
PolylineSimplifier.simplify(java.util.List<com.here.sdk.core.GeoCoordinates>, com.here.sdk.core.PolylineSimplifier.Options, com.here.sdk.core.PolylineSimplificationCallback):- higher tolerance results in more simplification (fewer points);
- lower tolerance keeps the line closer to its original shape.
If removing a point produces polyline, which deviates from the original one more than
simplificationToleranceInMeters, then this point is left in the collection.If specified tolerance will not allow to create a polyline conforming to
maxPoints, thensimplificationToleranceInMetersis ignored.Default value is equal to
SIMPLIFICATION_IN_METERS_14_ZOOM_LEVEL.
-