Skip to content

Fix MinDistanceToShapeIndexTarget.capBound returning antipodal Cap - #295

Open
joshua-zingale-rincon wants to merge 1 commit into
golang:masterfrom
joshua-zingale-rincon:master
Open

Fix MinDistanceToShapeIndexTarget.capBound returning antipodal Cap#295
joshua-zingale-rincon wants to merge 1 commit into
golang:masterfrom
joshua-zingale-rincon:master

Conversation

@joshua-zingale-rincon

Copy link
Copy Markdown

This fixes the capBound() implementation on MinDistanceToShapeIndexTarget, which previously calculated the antipodal Cap bound, including also a test that failed on the parent commit. The fix aligns with the C++ implementation.

Closes #293 (which is tested in the added test).

…olang#293)

This aligns the implementation with that of the reference C++ implementation:

  S2Cap S2MinDistanceShapeIndexTarget::GetCapBound() {
    return S2ShapeIndexRegion(index_).GetCapBound();
  }

This also adds an end-to-end EdgeQuery test that would have caught this error.

Fixes GitHub Issue: golang#293
@google-cla

google-cla Bot commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@joshua-zingale-rincon
joshua-zingale-rincon marked this pull request as draft August 3, 2026 19:25
@joshua-zingale-rincon
joshua-zingale-rincon marked this pull request as ready for review August 3, 2026 19:31
@norville-dane-rincon

Copy link
Copy Markdown

Upvote!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EdgeQuery with MinDistanceToShapeIndexTarget fails to find shapes within a distance limit when using optimized method

3 participants