refactor: Move geo utilities#7881
Open
camdecoster wants to merge 3 commits into
Open
Conversation
emilykl
reviewed
Jun 30, 2026
| * Return a monotonic version of a `[lon0, lon1]` longitude range so its | ||
| * midpoint and span can be computed as if longitude were a regular linear | ||
| * coordinate. When the range crosses the antimeridian (`lon0 > 0`, `lon1 < 0`) | ||
| * `lon1` is shifted by +360°; otherwise the input pair is returned unchanged. |
Contributor
There was a problem hiding this comment.
Wording suggestion for clarity
Suggested change
| * `lon1` is shifted by +360°; otherwise the input pair is returned unchanged. | |
| * 360 is added to `lon1`; otherwise the input pair is returned unchanged. |
emilykl
reviewed
Jun 30, 2026
| * `lon1` is shifted by +360°; otherwise the input pair is returned unchanged. | ||
| * | ||
| * @param {[number, number]} lonRange - `[lon0, lon1]`, each in [-180, 180] | ||
| * @return {[number, number]} the unwrapped range |
Contributor
There was a problem hiding this comment.
Can you expand this description to give the possible range of the returned numbers? I can sort of figure it out by reading the above docstring but it would be clearer to state it explicitly here.
emilykl
approved these changes
Jun 30, 2026
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.
Description
Move a number of geo related utilities to a central location for use throughout the library.
Closes #7879.
Changes
getFitboundsLonRange,doesCrossAntiMeridianunwrapLonRange,ANTIMERIDIAN_LON_SHIFTTesting