Package globus.glmap
Class GLMapVectorLine
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapVectorObject
globus.glmap.GLMapVectorLine
- All Implemented Interfaces:
GLMapTagsContainer,AutoCloseable
Vector object with line or multiline geometry.
-
Nested Class Summary
Nested classes/interfaces inherited from class globus.glmap.GLMapVectorObject
GLMapVectorObject.Type -
Field Summary
Fields inherited from class globus.glmap.GLMapVectorObject
drawAttributes -
Constructor Summary
ConstructorsConstructorDescriptionGLMapVectorLine(MapGeoPoint start, MapGeoPoint end, double quality) Creates a great-circle line fromstarttoend. -
Method Summary
Modifier and TypeMethodDescriptiondoublelineDistanceToPoint(MapPoint point, MapPoint nearestPoint, double maxDistance) Finds the nearest point on the line and returns distance from the line start to it.pointAtLineDistance(double distance) Finds a point located at the given distance from the start of the line.Methods inherited from class globus.glmap.GLMapVectorObject
asGeoJSON, compare, copyProperties, createFromGeoJSONOrError, createFromGeoJSONOrThrow, createFromGeoJSONStreamOrError, createFromGeoJSONStreamOrThrow, createGeoLine, createGeoPoint, createMultiline, createMultilineGeo, createPoint, createPolygon, createPolygonGeo, equals, getBBox, getLineCount, getLinePointCount, getLinePointStart, getPointAtIndex, getPointCount, getPolygonCount, getPolygonLineCount, getPolygonLineStart, getType, hashCode, localizedName, point, setValueForKey, updateDrawAttributes, valueForKey, valuesForKeyMethods inherited from class globus.glmap.GLNativeObject
close, dispose
-
Constructor Details
-
GLMapVectorLine
Creates a great-circle line fromstarttoend. Useful to display plane routes.- Parameters:
start- start pointend- end pointquality- subdivision step in meters: the line is split until its half-segments are shorter than this, into at most 65536 segments
-
-
Method Details
-
pointAtLineDistance
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
NaNif 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
NaNif nothing is withinmaxDistance
-