From 78b4fc19ecd3693416d9b5a54d8591ed4be1d1cb Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Thu, 12 Sep 2024 10:08:28 -0700 Subject: [PATCH] Quick bbox reject for bins that can't possibly intersect --- clip.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clip.cpp b/clip.cpp index 959c869d..b10d25a6 100644 --- a/clip.cpp +++ b/clip.cpp @@ -1291,6 +1291,18 @@ void get_quadkey_bounds(long long xmin, long long ymin, long long xmax, long lon static bool bbox_intersects(long long x1min, long long y1min, long long x1max, long long y1max, long long x2min, long long y2min, long long x2max, long long y2max) { + if (x1max < x2min) { + return false; + } + if (x2max < x1min) { + return false; + } + if (y1max < y2min) { + return false; + } + if (y2max < y1min) { + return false; + } return true; }