feat: mask raster for features hidden by table filters - #664
Open
BRaimbault wants to merge 6 commits into
Open
BRaimbault wants to merge 6 commits into
BRaimbault wants to merge 6 commits into
Conversation
|
BRaimbault
marked this pull request as ready for review
July 29, 2026 13:26
BRaimbault
force-pushed
the
feat/ee-mask-filtered-features
branch
from
September 1, 2026 10:40
e074398 to
7160cc3
Compare
Prefer toHaveLength() over a generic length assertion, for better failure reporting.
setVisibleIds() (base Layer class) applies an "only show these ids" filter to every registered GL layer, including EarthEngine's new mask layer added in the previous commit. Since the mask's own data is deliberately the complement (the *hidden* ids), that filter matched none of its features and silently zeroed it out - so selectionFilter/ Combined's combinedVisibleIds (which go through setVisibleIds) never visibly masked the raster, even though dataFilters (which goes through filter() instead) did. Layer.addLayer() now accepts an excludeFromVisibleIdsFilter option, used to exempt the mask layer from that blanket filter.
Rebasing in the raster-mask feature added a 5th layer (the mask) to every addTo() call, making this pre-existing test's "4, not 8" duplicate-call assertion stale.
BRaimbault
force-pushed
the
feat/ee-mask-filtered-features
branch
from
September 4, 2026 08:50
7160cc3 to
aab04e5
Compare
|
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
What
Adds a translucent "no data" mask layer to
EarthEnginethat covers raster cells whose underlying feature has been hidden by the data-table filter (filter()) or bysetVisibleIds().Why
Filtering or hiding features via the data table already hides the vector polygon/point overlay, but the EE raster underneath kept rendering regardless, so a filtered-out area still visually appeared to have data. The mask closes that gap by painting the excluded region with
noDataColor.Key changes
EarthEnginecreates a second GeoJSON source/layer per instance (${id}-mask), inserted before the polygon/outline/point layers so it renders under them but over the raster._updateMask()computes the mask's data as the complement of the currently visible features — the union of ids excluded byfilter()and bysetVisibleIds()— and is called whenever either changes.Layer's ownsetVisibleIdsfiltering. Added a newexcludeFromVisibleIdsFilteroption toLayer#addLayer()(tracked via_visibleIdsFilterExemptIds) sosetVisibleIds()skipssetFilter()on the mask layer.filter()alone,setVisibleIds()alone, the union of both, clearing both, a no-op when the mask source isn't available yet, and that the mask layer itself is exempted from the visible-ids filter.