| | 339 | * Check if bboxes are functionally equal |
| | 340 | * @param other The other bbox to compare with |
| | 341 | * @param maxDifference The maximum difference (in degrees) between the bboxes. May be null. |
| | 342 | * @return true if they are functionally equivalent |
| | 343 | */ |
| | 344 | public boolean bboxesAreFunctionallyEqual(BBox other, Double maxDifference) { |
| | 345 | return bboxesAreFunctionallyEqual(this, other, maxDifference); |
| | 346 | } |
| | 347 | |
| | 348 | /** |
| | 349 | * Check if bboxes are functionally equal |
| | 350 | * @param bbox1 A bbox to compare with another bbox |
| | 351 | * @param bbox2 The other bbox to compare with |
| | 352 | * @param maxDifference The maximum difference (in degrees) between the bboxes. May be null. |
| | 353 | * @return true if they are functionally equivalent |
| | 354 | */ |
| | 355 | public static boolean bboxesAreFunctionallyEqual(BBox bbox1, BBox bbox2, Double maxDifference) { |
| | 356 | if (maxDifference == null) { |
| | 357 | maxDifference = LatLon.MAX_SERVER_PRECISION; |
| | 358 | } |
| | 359 | return (bbox1 != null && bbox2 != null) |
| | 360 | && (Math.abs(bbox1.getBottomRightLat() - bbox2.getBottomRightLat()) <= maxDifference |
| | 361 | && Math.abs(bbox1.getBottomRightLon() - bbox2.getBottomRightLon()) <= maxDifference |
| | 362 | && Math.abs(bbox1.getTopLeftLat() - bbox2.getTopLeftLat()) <= maxDifference |
| | 363 | && Math.abs(bbox1.getTopLeftLon() - bbox2.getTopLeftLon()) <= maxDifference); |
| | 364 | } |
| | 365 | |
| | 366 | /** |