fix: fetch both sides when viewport crosses antimeridian in untiled mode#65
Open
egagli wants to merge 2 commits into
Open
fix: fetch both sides when viewport crosses antimeridian in untiled mode#65egagli wants to merge 2 commits into
egagli wants to merge 2 commits into
Conversation
When the viewport extends past 180 degrees, getBounds returns east > xMax (e.g. east=185). geoToArrayIndex clamps that to the dataset edge, so the region range only covers the side of the antimeridian already in view. The other side is never fetched. Detect the crossing with east > xMax || west < xMin and fetch two narrow strips instead: the trailing edge of the dataset and the leading edge on the wrapped side. The wrapped coordinate is found by subtracting or adding the full longitudinal extent before passing to geoToArrayIndex. Fixes data missing on one side of the antimeridian in both Globe and Mercator projections for untiled datasets.
|
@egagli is attempting to deploy a commit to the carbonplan Team on Vercel. A member of the Team first needs to authorize it. |
…en bbox corners are outside CRS domain For projections like MODIS sinusoidal, the rectangular bounding box corners can be outside the valid CRS domain (near-polar latitudes give out-of-domain longitude values), causing the projected Mercator width to be NaN or > full world width. This makes worldFraction incorrect, forcing the finest pyramid level at all zoom levels. Fix: detect dataWidthMeters that is non-finite or > fullWorldMeters, then re-project using y=0 (equatorial strip) which is always in-domain. Also clamp worldFraction to [0, 1] as a safety net. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Shane98c
added a commit
that referenced
this pull request
Jun 16, 2026
Co-authored-by: Eric Gagliano <egagli@uw.edu>
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.
Fixes #64
Hoping this fixes data missing on one side of the antimeridian in both Globe and Mercator projections for untiled datasets. When the viewport extends past 180 degrees, geoToArrayIndex clamps coords to the dataset edge, so the region range only covers the side of the antimeridian already in view. The other side is never fetched.
Here we detect the crossing with east > xMax || west < xMin and fetch two narrow strips instead: the trailing edge of the dataset and the leading edge on the wrapped side. The wrapped coordinate is found by subtracting or adding the full longitudinal extent before passing to geoToArrayIndex.
Seems to be working on my side!!