Package com.cercalia.sdk.model.common
Class BoundingBox
java.lang.Object
com.cercalia.sdk.model.common.BoundingBox
Represents a geographic bounding box defined by minimum and maximum coordinates.
Used for defining map extents, spatial filters, and search boundaries.
-
Constructor Summary
ConstructorsConstructorDescriptionBoundingBox(double minLat, double minLng, double maxLat, double maxLng) Creates a new BoundingBox. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(@NotNull Coordinate coord) Checks if a coordinate is within this bounding box.booleanstatic @NotNull BoundingBoxfromCorners(@NotNull Coordinate southwest, @NotNull Coordinate northeast) Creates a BoundingBox from two corner coordinates.@NotNull CoordinateReturns the center coordinate of the bounding box.doubleReturns the maximum latitude (north).doubleReturns the maximum longitude (east).doubleReturns the minimum latitude (south).doubleReturns the minimum longitude (west).@NotNull CoordinateReturns the northeast corner coordinate.@NotNull CoordinateReturns the southwest corner coordinate.inthashCode()@NotNull StringReturns the bounding box as a Cercalia format string "minLng,minLat,maxLng,maxLat".toString()
-
Constructor Details
-
BoundingBox
public BoundingBox(double minLat, double minLng, double maxLat, double maxLng) Creates a new BoundingBox.- Parameters:
minLat- minimum latitude (south)minLng- minimum longitude (west)maxLat- maximum latitude (north)maxLng- maximum longitude (east)
-
-
Method Details
-
fromCorners
@NotNull public static @NotNull BoundingBox fromCorners(@NotNull @NotNull Coordinate southwest, @NotNull @NotNull Coordinate northeast) Creates a BoundingBox from two corner coordinates.- Parameters:
southwest- the southwest cornernortheast- the northeast corner- Returns:
- a new BoundingBox
-
getMinLat
public double getMinLat()Returns the minimum latitude (south).- Returns:
- the minimum latitude
-
getMinLng
public double getMinLng()Returns the minimum longitude (west).- Returns:
- the minimum longitude
-
getMaxLat
public double getMaxLat()Returns the maximum latitude (north).- Returns:
- the maximum latitude
-
getMaxLng
public double getMaxLng()Returns the maximum longitude (east).- Returns:
- the maximum longitude
-
getSouthwest
Returns the southwest corner coordinate.- Returns:
- the southwest corner
-
getNortheast
Returns the northeast corner coordinate.- Returns:
- the northeast corner
-
getCenter
Returns the center coordinate of the bounding box.- Returns:
- the center coordinate
-
toCercaliaString
Returns the bounding box as a Cercalia format string "minLng,minLat,maxLng,maxLat".- Returns:
- the bounding box string
-
contains
Checks if a coordinate is within this bounding box.- Parameters:
coord- the coordinate to check- Returns:
- true if the coordinate is within the bounding box
-
equals
-
hashCode
public int hashCode() -
toString
-