Add includeEnd into the totalFrameCount game #53422
Closed
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.
Layers with instantanous events (zero length, e.g. vector or mesh layers) missed the last events because totalFrameCount was off by one.
To fix the totalFrameCount, we add a microsecond to the temporal project extent, ONLY when there is a chance that there are any instantaneous events which are ON the temporal project extent.
We trigger the addition of the microsecond by going over alls layer and check for potential events ON the temporal project extent. If so we let the calculateTemporalRangeForProject return a QgsDateTimeRange which includes the end.
This fixes for example: #48942
To see it yourself, load both netcdf files from this zip.
3steps.zip
Both have 3 datasets but ugrid3timestepstart24.nc received just 2 steps.
This is also reproducable with a csv with instantanous events (without a length).
The drawback of this pull is that it sometimes adds one step extra...
THIS PR supersedes: #52857 which ALWAYS added the extra time step.
Personally I prefer that PR, as it is simpler.