Don't apply a default band filter to new layer frames#314
Open
Don't apply a default band filter to new layer frames#314
Conversation
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.
When I ran a "create road network" task, I realized that the results were not visualizing properly. The layer would get added to the map, tile requests were sent and recieved correct responses, but nothing appeared on the map. I was able to hunt this down and discover that this was because the
source_filtersfield on thatLayerFramehad a value of{"band": 1}.The "create road network" task does not use the dataset conversion process to create layers and frames. It creates all necessary objects within the task itself. When the
LayerFrameobject is created, no value is specified forsource_filters. Rather than changing the task to specify that field on the frame, a more robust solution would be to change the model definition.The
LayerFramemodel file defines a functiondefault_source_filterswhich is called to populate thesource_filtersfield when no value is specified. We shouldn't be returning this band filter by default, since that would only ever apply to multiband raster data. This PR changes that default value to an empty dictionary, such that no filters are applied by default.