• java.lang.Object
    • com.here.sdk.core.GeoPolyline

  • public final class GeoPolyline
    extends java.lang.Object

    A list of geographic coordinates representing the vertices of a polyline. An instance of this class, initialized with appropriate vertices. Represents a GeoPolyline as a series of geographic coordinates.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<GeoCoordinates> vertices
      The list of vertices representing the polyline.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoPolyline​(GeoBox geoBox)
      Constructs an instance of this class from GeoBox.
      GeoPolyline​(java.util.List<GeoCoordinates> vertices)
      Constructs a GeoPolyline from the provided vertices.
    • Field Detail

      • vertices

        @NonNull
        public final java.util.List<GeoCoordinates> vertices

        The list of vertices representing the polyline.

    • Constructor Detail

      • GeoPolyline

        public GeoPolyline​(@NonNull
                           java.util.List<GeoCoordinates> vertices)
                    throws InstantiationErrorException

        Constructs a GeoPolyline from the provided vertices. Throws an InstantiationError if the number of vertices is less than two.

        Parameters:
        vertices -

        List of vertices representing the polyline.

        Throws:
        InstantiationErrorException -

        Instantiation error.

      • GeoPolyline

        public GeoPolyline​(@NonNull
                           GeoBox geoBox)

        Constructs an instance of this class from GeoBox.

        Parameters:
        geoBox -

        A GeoBox to be converted into GeoPolyline.

    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getNearestIndexTo

        public long getNearestIndexTo​(@NonNull
                                      GeoCoordinates point)

        Returns the index of the nearest vertex to the given point.

        Parameters:
        point -

        Coordinates of the point.

        Returns:

        Index of the closest vertex of the polyline.