Package com.massifmaps.core
Class MapEnvelope
java.lang.Object
com.massifmaps.core.MapEnvelope
A bounding area on the map. Can be defined by a map bounds object or by a convex bounding polygon.
This class is intended for conservative object area estimation and fast intersection testing.
This class is intended for conservative object area estimation and fast intersection testing.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty MapEnvelope object.MapEnvelope(MapBounds bounds) Constructs a MapEnvelope object using map bounds.MapEnvelope(MapPosVector convexHull) Constructs a MapEnvelope object from a convex bounding polygon. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(MapEnvelope envelope) Tests whether this map envelope contains another map envelope.booleanChecks if this object is equal to the specified object.Returns the map bounds of this map envelope.Returns the convex hull of this map envelope.inthashCode()Returns the hash value of this object.booleanintersects(MapEnvelope envelope) Tests whether this map envelope intersects with another map envelope.toString()Creates a string representation of this map envelope, useful for logging.
-
Constructor Details
-
MapEnvelope
public MapEnvelope()Constructs an empty MapEnvelope object. Nothing is contained within
this envelope. -
MapEnvelope
Constructs a MapEnvelope object using map bounds.- Parameters:
bounds- The bounds for the envelope.
-
MapEnvelope
Constructs a MapEnvelope object from a convex bounding polygon.- Parameters:
convexHull- The list of convex hull points.
-
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
getBounds
Returns the map bounds of this map envelope.- Returns:
- The map bounds of this map envelope.
-
getConvexHull
Returns the convex hull of this map envelope.- Returns:
- The convex hull of this map envelope.
-
contains
Tests whether this map envelope contains another map envelope.- Parameters:
envelope- The other map envelope.- Returns:
- True if this map envelope contains the other map envelope.
-
intersects
Tests whether this map envelope intersects with another map envelope.- Parameters:
envelope- The other map envelope.- Returns:
- True if this map envelope intersects the other map envelope.
-
toString
Creates a string representation of this map envelope, useful for logging.
-