Store 'stations_considered' into the datastore and read it to plot both the complete set and the considered ones #10767
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 we create the plot for assets in oq-impact, currently the whole set of stations is plotted, regardless from the fact they have been discarded or kept for the calculation. This looks confusing, and it makes impossible to determine from the plot if the filtering was correct with respect to the maximum distance specified for stations. With this PR I want to make it possible to clearly distinguish which stations have been taken into consideration.
After filtering stations, I am now storing into the datastore those that have been kept, so it is possible to distinguish them from the others when plotting the stations together with the assets.
If the
stations_considered
are not available in the datastore (as it is for old calculations), all stations will be displayed, with the labelall stations
in the legend. Otherwise, all stations will be displayed asdiscarded stations
in the legend, then the considered stations will be plotted on top of them and labeled asconsidered stations
.@micheles, perhaps there is a better way to store the information about the stations that are kept, e.g. in the
station_data
object?The image below shows an example using a

maximum source-to-site distance
smaller than themaximum distance of stations
.NOTE: Currently, if the
maximum distance of stations
is not provided, it is set automatically with the same value as themaximum source-to-site distance
. However, doing so, we might have stations close to assets that are within the filtering radius (but very close to the threshold), that would be discarded. I suppose it would make sense to use by default amaximum distance of stations
that is bigger, in order to avoid that.