Package globus.glmap
Class MapPointSet
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.MapPointSet
A set of
MapPoint instances backed by a native spatial index.
Useful to find the nearest point in internal map coordinates or to test whether a point is already present.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if point with given coordinates exists in set.voidInserts new point to set.booleaninsertUnique(MapPoint point) Inserts new point to set.Returns nearest point in setMethods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
MapPointSet
public MapPointSet()Default constructor. Creates empty set.
-
-
Method Details
-
insert
Inserts new point to set. Use this function if many points with same coordinates can be in set.- Parameters:
point- Point to insert.
-
insertUnique
Inserts new point to set.- Parameters:
point- point to insert.- Returns:
- true if point is inserted. false if point with same coordinates already in set.
-
contains
Checks if point with given coordinates exists in set.- Parameters:
point- point to check.- Returns:
- true if point with given coordinates is in set
-
nearest
Returns nearest point in set- Parameters:
point- reference point to calculate distance- Returns:
- Nearest point in set
-