Package globus.glmap

Class GLMapVectorLine

All Implemented Interfaces:
GLMapTagsContainer, AutoCloseable

public class GLMapVectorLine extends GLMapVectorObject
Vector object with line or multiline geometry.
  • Constructor Details

    • GLMapVectorLine

      public GLMapVectorLine(@NonNull MapGeoPoint start, @NonNull MapGeoPoint end, double quality)
      Creates a great-circle line from start to end. Useful to display plane routes.
      Parameters:
      start - start point
      end - end point
      quality - subdivision step in meters: the line is split until its half-segments are shorter than this, into at most 65536 segments
  • Method Details

    • pointAtLineDistance

      @NonNull public MapPoint pointAtLineDistance(@FloatRange(from=0.0) double distance)
      Finds a point located at the given distance from the start of the line.
      Parameters:
      distance - distance in meters along the line
      Returns:
      point on the line in internal map coordinates; contains NaN if the line is empty
    • lineDistanceToPoint

      public double lineDistanceToPoint(@NonNull MapPoint point, @Nullable MapPoint nearestPoint, @FloatRange(from=0.0) double maxDistance)
      Finds the nearest point on the line and returns distance from the line start to it.
      Parameters:
      point - point to test (internal map coordinates)
      nearestPoint - output: nearest point on the line (optional)
      maxDistance - maximum distance from the line in internal map units
      Returns:
      distance from the start of the line to the nearest point, in meters, or NaN if nothing is within maxDistance