Repository navigation
Silence spurious NotGeoreferencedWarning when rendering overlay tiles - #9
Merged
Merged
Conversation
rasterio.warp.reproject() silences this warning while it wraps the numpy arrays in a temporary in-memory dataset, using warnings.catch_warnings(), which is not thread safe. With several map tiles rendered at the same time, one thread can restore the filters while another is still inside, and "Dataset has no geotransform" is printed. The tiles are correct (parallel and serial renders are identical), so ignore the warning for rasterio. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUYE7j4AsWg97tWfRBT7mu
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.
Summary
When scene overlay tiles render, the terminal sometimes shows this warning:
Cause:
rasterio.warp.reproject()wraps the numpy arrays in a temporary in-memory dataset, which has no transform until rasterio sets it a moment later. Rasterio silences this warning while it does so, usingwarnings.catch_warnings(). That function is not thread safe. When the browser requests several map tiles at once, one thread can restore the warning filters while another is still inside, so the warning leaks out.Fix: the rendered tiles are correct, so
forcelive/overlay.pynow ignoresNotGeoreferencedWarningcoming from rasterio.Testing
python -m pytest -q: 27 passed.Generated by Claude Code