Implement S2CellIndex and S2ClosestCellQuery#2
Merged
missinglink merged 16 commits intomissinglink:mainfrom Jan 26, 2026
Merged
Implement S2CellIndex and S2ClosestCellQuery#2missinglink merged 16 commits intomissinglink:mainfrom
missinglink merged 16 commits intomissinglink:mainfrom
Conversation
Contributor
Author
|
Am a little nervous here, public tests for S2 are not great. Current coverage stats: Collected with |
Closed
Owner
|
Fantastic thanks @benjamin-cooper-ai it might take me some time to review, thanks for all your work |
Owner
|
Hey thanks so much @benjamin-cooper-ai, I had a quick look over it and it's a very welcome addition to the library 🎉 Docs available here: https://s2js.org/classes/s2js.s2.CellIndex.html |
|
🎉 This PR is included in version 1.44.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Owner
|
hi @benjamin-cooper-ai I just noticed this TODO on the readme, what are the action items for this?
|
Contributor
Author
|
whoops will put up a README fix! |
Contributor
Author
|
#5 quick README fix here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is an implementation of S2CellIndex. Making this useful required implementing S2ClosestCellQuery and S2ClosestEdgeQuery.
I tried to test this as well as possible - I ported over a union of tests from the C++ library, the Golang library, and added some other example tests that match what those libraries return.
Let me know what I can add to build confidence here!
Fixes #1