New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporal controller monthly time step uses 30 days instead of a month to loop #37829
Comments
@RousseauLambertLP I'm thinking about having a look at @dminor 's pull request, but was wondering about some edge cases like:
|
@rduivenvoorde I think from user perceptive, the next timestep should default to the last day of the next month(for this case it ll be 28th February) |
Currently, we pass the frame duration as a QgsInterval and use the average duration of a month or year during the animation, for instance, 30 days rather than a month. This makes it impossible to have an animation that displays on a particular day each month, as the day in the next month will change depending on the number of days in the previous month. This changes QgsTemporalNavigationObject to take the time step and time step unit as separate arguments. The settings in QgsTemporalUtils::exportAnimation are left unchanged, because in this case the user interface is already set up to use an interval. If the time step has a fractional value, the frame duration is calculated using a QgsInterval as before. If it has an integer value, the calculation uses QDateTime to advance by the specified time step instead. So a value of 1.5 months results in a frame duration of 45 days, but a value of 1 month will result in a duration that depends on the length of the current month. Fixes qgis#37829.
Currently, we pass the frame duration as a QgsInterval and use the average duration of a month or year during the animation, for instance, 30 days rather than a month. This makes it impossible to have an animation that displays on a particular day each month, as the day in the next month will change depending on the number of days in the previous month. This changes QgsTemporalNavigationObject to take the time step and time step unit as separate arguments. The settings in QgsTemporalUtils::exportAnimation are left unchanged, because in this case the user interface is already set up to use an interval. If the time step has a fractional value, the frame duration is calculated using a QgsInterval as before. If it has an integer value, the calculation uses QDateTime to advance by the specified time step instead. So a value of 1.5 months results in a frame duration of 45 days, but a value of 1 month will result in a duration that depends on the length of the current month. Fixes qgis#37829.
@Samweli @nyalldawson are we sure this is to be closed? In my test here with the url of the original issuer: https://geo.weather.gc.ca/geomet?LAYER=CANSIPS.MEM.ETA_TT.10 Things work initially great. You start on the first of the month and you step through all 'firsts' of the upcoming months. But it get heary when you set the timestep to 1 day, go to some day (like the 23th), then change to 30 days, which will by QGIS converted to 1 month(!), and then (seeing "timestep 1 month") QGIS steps 30 days again? Also: because of the code that tries to guess what I want (if I set 7 days, make it a week etc etc), QGIS makes it harde to actually SET the start/end of the timestep. Would it not be better to let the user really decide in what kind of steps the controller is going (like: if I want it 7 days, do not make it a week or so?) I do understand this is getting rather complex... so don't get me wrong :-( @RousseauLambertLP @dminor can you confirm? |
@rduivenvoorde I confirm this on master and QGIS 3.16
I think this is closed, we may need to open another ticket to address the timestep setting issue. |
Sure? so 2 tickets?
|
no , only one ticket.
this is the only ticket that should be opened, a fix for this should also fix other problems as this issue is the root of the other misbehaviour. |
ping @rduivenvoorde |
I see @rduivenvoorde, but I think #40871 is about another issue, let me open a ticket about the 'guessing' stuff. |
@rduivenvoorde see #40894 |
@RousseauLambertLP can you please test. I think this one can be closed. |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
Closing for lack of feedback. |
Sorry for not replying, I was in parental leave for the last 8 months. I tested QGIS 3.20 temporal animation tool using https://geo.weather.gc.ca/geomet?LAYER=CANSIPS.MEM.ETA_TT.10 and the monthly time step (default time step for this WMS layer) and I see the correct behavior for this layer. Thanks all for this work! |
How to Reproduce
Start date: 2013-05-01 00:00:00 / End date: 2018-10-01 00:00:00
animated temporal navigation
and hit the refresh button, then change time step to1 month
go to next frame
button and you will see that it looks like it loops over 30 days instead of a full month. For the layer above here are some of the time steps I get:2013-05-01 00:00:00, 2013-05-31 00:00:00, 2013-06-30 00:00:00, 2013-07-30 00:00:00, 2013-08-29 00:00:00, etc
QGIS and OS versions
Additional context
We have seen this behavior for every monthly time interval WMS layer we have tested in the tool, which result in layers not been displayed.
CC @tomkralidis
The text was updated successfully, but these errors were encountered: