pybind: Add S2LatLng bindings - #581
Merged
Merged
Conversation
deustis
commented
Apr 24, 2026
deustis
marked this pull request as draft
April 24, 2026 17:44
…rmalized - Use absl::StrCat in MaybeThrowNotValid instead of std::ostringstream. - Change `coords` from a method returning a tuple to a readonly property returning R2Point, matching the C++ signature. - Move `to_string_in_degrees` into the string representation section. - Add `from_radians_normalized` factory that clamps latitude and wraps longitude, accepting any finite values.
deustis
marked this pull request as ready for review
April 24, 2026 18:04
Contributor
Author
|
@jmr, next installment here. Getting to the fun/useful stuff. |
deustis
commented
Apr 24, 2026
jmr
reviewed
Apr 27, 2026
jmr
reviewed
Apr 27, 2026
jmr
reviewed
Apr 27, 2026
- Add missing absl/strings BUILD dep to s2latlng_bindings. - Drop stray "S2LatLng" in README invalid-values example. - Rename from_radians_normalized to normalized_from_radians for clarity.
deustis
force-pushed
the
deustis/s2latlng_bindings
branch
from
April 27, 2026 18:20
1d18c58 to
70e2c09
Compare
Contributor
Author
|
@jmr, let me know if you have any other suggestions on this PR? I'm not sure why the cmake tests are failing... |
jmr
reviewed
May 1, 2026
| void bind_s1angle(py::module& m); | ||
| void bind_s1interval(py::module& m); | ||
| void bind_s2point(py::module& m); | ||
| void bind_s2latlng(py::module& m); |
Member
There was a problem hiding this comment.
let's keep these sorted alphabetically. You can add // keep-sorted start and // keep-sorted end if you want.
jmr
approved these changes
May 1, 2026
jmr
left a comment
Member
There was a problem hiding this comment.
We can do the sorting change separately.
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.
Add pybind11 bindings for S2LatLng.
Supports downstream PR for S2CellId.
(Part of a series of addressing #524)