Skip to content

Commit

Permalink
Quick bbox reject for bins that can't possibly intersect
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Sep 12, 2024
1 parent 3e3e7a5 commit 78b4fc1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 78b4fc1

Please sign in to comment.