Repository navigation
Vector Rendering Performance – Introduce viewport-aware geometry processing 5/7 - #92
Merged
Merged
Conversation
- Filter automatic MapView scenes through OGR spatial extents`n- Reuse padded scenes during small viewport changes`n- Cover filtering, cache reuse, and diagnostics with tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
A critical exception-safety flaw can leave an interrupted viewport refresh marked current, causing subsequent scene requests to return an old selection that omits visible features.
3 open issues
What changed in this PR
Implements Phase 5 of the vector rendering performance plan by adding viewport-aware scene preparation to Core’s MapView, while preserving complete caller-prepared scenes.
Changes:
- Selects features through an OGR spatial filter with a 64-pixel viewport margin.
- Reuses cached geometry within that margin and rebuilds affected selections beyond it.
- Adds filtering, cache-reuse, and diagnostics tests, plus architecture documentation.
Builds and tests were not run during this review; the PR reports a successful Debug/x64 build and 462 passing non-interactive tests.
| File | Description |
|---|---|
tests/MapWinGIS.Core.Tests/VectorRenderSceneTests.cpp |
Tests boundary filtering and invalid extents. |
tests/MapWinGIS.Core.Tests/PerformanceDiagnosticsTests.cpp |
Tests counts of features excluded by filtering. |
tests/MapWinGIS.Core.Tests/MapViewTests.cpp |
Tests viewport selection, small-pan reuse, and prepared scenes. |
src/MapWinGIS.Core/src/vector/VectorDataset.cpp |
Applies temporary spatial filters and preserves metadata caches. |
src/MapWinGIS.Core/src/rendering/VectorRenderScene.cpp |
Validates filters and computes selected geometry bounds. |
src/MapWinGIS.Core/src/map/MapView.cpp |
Tracks cache coverage and refreshes viewport selections. |
src/MapWinGIS.Core/src/internal/VectorLayerAccess.h |
Adds an optional filter to geometry traversal. |
src/MapWinGIS.Core/include/mapwingis/rendering/VectorRenderScene.h |
Exposes spatial-filter options and documents their contract. |
src/MapWinGIS.Core/include/mapwingis/map/MapView.h |
Documents viewport caching and defines the margin. |
docs/ARCHITECTURE.md |
Describes filtered scenes and cache reuse. |
.github/plans/Vector-Rendering-Performance-Improvement.md |
Records Phase 5 completion and limitations. |
.ai/memory/architecture/core-library.md |
Records filtering and metadata-preservation rules. |
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Keep interrupted viewport scene refreshes marked stale for retry - Cover restored filters, cursors, metadata caches, and unfiltered reads Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pmeems
enabled auto-merge (squash)
November 21, 2026 11:28
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.


Motivation
Large vector layers currently copy and prepare every feature before the first visible render, even when most features are outside the viewport.
Context
Phase 5 of the vector rendering performance plan adds OGR-backed spatial filtering at the Core/
MapViewboundary while preserving complete caller-prepared scenes.Design
Dependencies
No new dependencies.
The shared Core architecture memory was updated with the verified viewport-filter and cache-coverage rules.
Validation
Debug/x64 CMake build succeeded. All 462 non-interactive CTest tests passed.
Larger pans or zoom-outs rebuild affected layer selections; incremental feature-level merging and tiling remain future work.