remove unnecessary spatial calculations when processing feature specifications [MRXN23-602] #1658
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.
Remove leftover spatial queries that get executed on the tail end of the processing of feature specifications.
In practice, this query was used to calculate which features are present in each PU, and to set
(geodb)scenarios_pu_data.feature_list
which is then used in turn by the code that generates tiles for the scenario (so that binary view of features at scenario level can be rendered in scenario maps).There's no need for an expensive spatial query here, though - given the list of features in a scenario, rendering them in binary view can be handled by either:
feature_amounts_per_pu
combined with the list of features active in a given scenario (will require no changes to frontend app)Designs
N/A
Testing instructions
Run scenario feature specifications for a mildly complex project (~20 features, some thousand of regular PUs) - this should complete in seconds, not in hours (or take so long that the stale jobs reaper will eventually consider this as failed).
Feature relevant tickets
https://vizzuality.atlassian.net/browse/MRXN23-602
Checklist before submitting
develop
.deploying to staging/production, please add brief testing instructions
to the deploy checklist (
docs/deployment-checklist.md
)