Class BoundingBoxes

java.lang.Object
com.here.platform.location.core.geospatial.BoundingBoxes

public class BoundingBoxes extends Object
Higher-level operations on bounding box types (for which a BoundingBoxOperations implementation is available).
  • Constructor Details

    • BoundingBoxes

      public BoundingBoxes()
  • Method Details

    • isValid

      public static <BB> boolean isValid(BB bbox, BoundingBoxOperations<BB> bbo)
      Returns true if -90 ≤ south latitude ≤ north latitude ≤ 90, and the longitudes are in the range [-180, 180], inclusive.
    • isAcrossMeridian180

      public static <BB> boolean isAcrossMeridian180(BB bbox, BoundingBoxOperations<BB> bbo)
      Returns true if the bounding box crosses the meridian 180 (antimeridian).
    • contains

      public static <BB, GC> boolean contains(BB bbox, GC coordinates, BoundingBoxOperations<BB> bbo, GeoCoordinateOperations<GC> gco)
      Returns true if the coordinates are inside the bounding box, including its edges and corners.
    • containsStrict

      public static <BB, GC> boolean containsStrict(BB bbox, GC coordinates, BoundingBoxOperations<BB> bbo, GeoCoordinateOperations<GC> gco)
      Returns true if the coordinates are inside the bounding box, on its north or east edge or on the north-eastern corner.

      When an area was partitioned with a set of disjoint bounding boxes, this method can be used to determine to which partition the coordinates belong to in an unambiguous way.

    • center

      public static <BB> GeoCoordinate center(BB bbox, BoundingBoxOperations<BB> bbo)
      Returns the center of the bounding box.
    • intersectsLineSegment

      public static <BB, GC> boolean intersectsLineSegment(BB bbox, GC pointA, GC pointB, BoundingBoxOperations<BB> evidence$1, GeoCoordinateOperations<GC> evidence$2)
      Returns true if the line segment intersects or is contained the bounding box, including its edges and corners.

      The line segment taken in consideration is the shortest one that connects the input points in an equirectangular projection.

    • intersects

      public static <BB1, BB2> boolean intersects(BB1 bbox1, BB2 bbox2, BoundingBoxOperations<BB1> evidence$7, BoundingBoxOperations<BB2> evidence$8)
      Returns true if the two bounding boxes overlap in longitude and in latitude.