Don't use an ancestor tile if it needs to be reprojected and hasn't been #4811
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 #4777
Here's what happens to trigger the exception:
T1
, loads an imagery tileI1
.T1
doesn't cross the web mercator boundary, so reprojection ofI1
is unnecessary.I1
eventually enters theREADY
state without being reprojected.T2
, finds that an imagery tile it would like to use is not available (missing, max level exceeded, etc.). It walks up the parent chain from that tile until it findsI1
.I1
is ready so it selects it for rendering. ButT2
does cross the web mercator boundary, soI1
must be reprojected before it can be used.T2
withI1
, butI1
isn't really ready for use byT2
, so we get the "readyImagery is not actually ready" exception.The fix is, when walking up the parent chain looking for a usable tile, to make sure that the candidate imagery tile is not only ready but that it also has been reprojected if this terrain tile needs it to be.