Skip to content
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 time frame is reset when changing step size #39994

Closed
anitagraser opened this issue Nov 12, 2020 · 14 comments · Fixed by #40076
Closed

Temporal controller time frame is reset when changing step size #39994

anitagraser opened this issue Nov 12, 2020 · 14 comments · Fixed by #40076
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Temporal Temporal filtering or animation

Comments

@anitagraser
Copy link
Member

In Master, changing the step size in Temporal Controller resets the current time frame. The user therefore always loses the current temporal "position" and it's hard to get back since there is no way to jump to a specific timestamp (#39107)

tempcontroller_issue_stepchange

@anitagraser anitagraser added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 12, 2020
@rduivenvoorde
Copy link
Contributor

See: https://github.com/qgis/QGIS/blob/master/src/core/qgstemporalnavigationobject.h#L132
"Calling this (setFrameDuration) will reset the currentFrameNumber() to the first frame."
and
https://github.com/qgis/QGIS/blob/master/src/core/qgstemporalnavigationobject.cpp#L196

So not a 'bug' but more like a feature request :-) ?

So you would want QGIS to calculate the new frames, and then choose the nearest frame (to your old position)?
That sounds reasonable. As a quick hack you could change the start Range input to the desired value (though I'm aware that if you are fiddling with the inputs, that you are not aware what current frame was.....

@anitagraser
Copy link
Member Author

Nice, so it's a well documented bug :-)

So you would want QGIS to calculate the new frames, and then choose the nearest frame (to your old position)? That sounds reasonable.

TimeManager behavior was to keep the map start time stable and adjust the map end time according to the new settings.

@nyalldawson nyalldawson added Temporal Temporal filtering or animation and removed Time controller labels Nov 15, 2020
@rduivenvoorde rduivenvoorde self-assigned this Nov 15, 2020
@rduivenvoorde
Copy link
Contributor

@anitagraser I think I can tackle this. One important difference (I think) between the TimeManager (TM) and current Temporal Controller (TC), is that TimeManager's state was 'loose', that is in the time-slider, you could 'set' the slider on random positions. While in TC the position is determined by the start of current timeframe.
So for example given an (hourly) dataset of 24 hours, starting at 01:00.
With a timestep of 1 hour you can step 1 hour (in the range of frames: 01:00-02:00, 02:00-03:00 etc etc)
If you change the timestep to 2 hours the steps change (in the range of frames: 1:00-3:00,3.00-5:00 etc etc)
So if the slider is on position 2:00 (which is possible when taking 1 hour steps), IF you go to 2 hour steps, the position is currently NOT available (as only 1,3,5 etc... are valid starttimes of the 2 hour frames). So in my current setup you then go back to 1:00.
Off course if the 'tick' in the slider fits exactly the slider also stays exactly on that point.
What I want to say: the model of TM is a little different from TC so there is no exact copy of functionality possible.
Let me clean up my prototype, do a Pull Request, so you can test.

@anitagraser
Copy link
Member Author

Thanks @rduivenvoorde!
Just thinking while typing here: if TM behavior is what users expect (and I'm not sure about that, we'd have to run a test), it might be possible to imitate this behavior in TC by adjusting the start of the TC time frame in a way that keeps the current slider position a valid frame start time.

@nyalldawson
Copy link
Collaborator

I'm personally +1 to @rduivenvoorde's approach. (I think if a user is wanting to view an exact time frame and then adjust the duration, they should be using the time filter mode in the widget rather than the animation mode.)

@anitagraser
Copy link
Member Author

I'm certainly biased and happy to give this approach a try 🙂

The usual use case for me is to browse through a dataset, and at one point realizing that I'd like to see a bit longer time frame. This is much more common for me than knowing an exact time from the beginning.

@nyalldawson
Copy link
Collaborator

Another option we could do is have little "lock" icons next to different settings in the widget. So if "frame start time" is locked then the overall animation start would be adjusted. If the animation start time is locked, then the frame time is adjusted...

@rduivenvoorde
Copy link
Contributor

rduivenvoorde commented Nov 16, 2020

In TimeManager in my own branch, I had 2 'modes', because that is (what I think) we are talking about:

BOTH 'modes' have their merits/use-cases.

I was bitten bij TimeManager's approach when using WMS-T servers, these often require these 'fixed ticks' when you browse the data (e.g 'yearly rainfall'-data has fixed timeframes (eg. always starting at the first of januari), so you are not suppossed to ask for images of rainfall from june till june... (that is probably the reason we have this model, it started of as WMS-T implementation @Samweli ?).

My gutfeeling is that the 'fixed tick'/current TC mode is more restricted but a little 'easier' to implement/handle corner cases.

But as shown by Anita: there are certainly use cases (especially when you have 'free vector' data to filter (so no fixed 'buckets').
I think both are possible to do, it is just for the user not so clear which mode to choose from... (as some data can only handle one, other data can handle both modes).

@nyalldawson
Copy link
Collaborator

@rduivenvoorde

What you describe is exactly the intention of the split between the time filter "fixed range" mode and the "animation" mode, and I completely agree that both use cases are important.

What's missing is that the fixed range mode doesn't give such as nice UI for setting the visible range. What we really need here is a "double edged" slider, where both the start and end time can be freely dragged to set the start and end of the visible time slice accordingly.

This would then match the behavior seen in google earth and arcmap:

image

image

The only reason this hasn't been done yet is the Qt doesn't have any native widgets for a "double end slider", and we couldn't find any nice 3rd party widgets which were suitable drop-ins...

@nyalldawson
Copy link
Collaborator

I was bitten bij TimeManager's approach when using WMS-T servers, these often require these 'fixed ticks' when you browse the data (e.g 'yearly rainfall'-data has fixed timeframes (eg. always starting at the first of januari), so you are not suppossed to ask for images of rainfall from june till june... (that is probably the reason we have this model, it started of as WMS-T implementation @Samweli ?).

And this situation should already be nicely handled, because the WMS-T layers have support for picking the most appropriate available image, via this option:

image

nyalldawson pushed a commit that referenced this issue Nov 19, 2020
… of resetting to start)

Try to remember/set last timeframe (upon timestep- or timeframe-changes).

Setting the stepsize to a different size, did reset the slider to start
(aka timeframe 0).
Same when you changed the range (data time) extent.

This commit tries to set the slider to the same position as before the
step change, if possible). Else it will take the position of the timeframe
in which the start of the old timeframe fits.

fixes #39994
nyalldawson pushed a commit to nyalldawson/QGIS that referenced this issue Nov 19, 2020
… of resetting to start)

Try to remember/set last timeframe (upon timestep- or timeframe-changes).

Setting the stepsize to a different size, did reset the slider to start
(aka timeframe 0).
Same when you changed the range (data time) extent.

This commit tries to set the slider to the same position as before the
step change, if possible). Else it will take the position of the timeframe
in which the start of the old timeframe fits.

fixes qgis#39994

(cherry picked from commit 6797118)
@rduivenvoorde
Copy link
Contributor

I was bitten bij TimeManager's approach when using WMS-T servers, these often require these 'fixed ticks' when you browse the data (e.g 'yearly rainfall'-data has fixed timeframes (eg. always starting at the first of januari), so you are not suppossed to ask for images of rainfall from june till june... (that is probably the reason we have this model, it started of as WMS-T implementation @Samweli ?).

And this situation should already be nicely handled, because the WMS-T layers have support for picking the most appropriate available image, via this option:

image

Ouch, that is nicely hidden in the Source tab of the layer. Honestly never seen it...
@Samweli @nyalldawson Would it not be better if this would be a (dynamic showing) part of the Temporal tabin the layer props?

Is 'Time slice mode' clear what it means to others?

Using http://geoservices.knmi.nl/cgi-bin/RADNL_OPER_R___25PCPRR_L3.cgi? here:

To me the word 'Range' in the 'Time slice mode' drop down is confusing, I think. It is actually the 'Time Frame' we are talking about isn't it? It is if you use only the start of current frame (&TIME=2020-11-14T00:00:00Z) or only the end (&TIME=2020-11-15T00:00:00Z), of a real 'range' beging from start to end (&TIME=2020-11-14T00:00:00Z/2020-11-15T00:00:00Z).
Another observation: the NOTE is disabled, although it is still valid I think:

Screenshot-20201120124338-727x738

@anitagraser
Copy link
Member Author

Ouch, that is nicely hidden in the Source tab of the layer. Honestly never seen it...
@Samweli @nyalldawson Would it not be better if this would be a (dynamic showing) part of the Temporal tabin the layer props?

Exactly! That's why I opened #36552

@rduivenvoorde
Copy link
Contributor

What you describe is exactly the intention of the split between the time filter "fixed range" mode and the "animation" mode, and I completely agree that both use cases are important.

@nyalldawson this 'fixed frame mode' has never been clear to me. To me it always looked as if I wanted to only see a one time 'slice' of my data?

While in the TimeManager (and the usecase you describe with the 'double slider') is that you can still 'play/animate' (after you set an arbitrary start and an end frame (and thus size of timeframe).

nyalldawson pushed a commit that referenced this issue Nov 20, 2020
… of resetting to start)

Try to remember/set last timeframe (upon timestep- or timeframe-changes).

Setting the stepsize to a different size, did reset the slider to start
(aka timeframe 0).
Same when you changed the range (data time) extent.

This commit tries to set the slider to the same position as before the
step change, if possible). Else it will take the position of the timeframe
in which the start of the old timeframe fits.

fixes #39994

(cherry picked from commit 6797118)
@Samweli
Copy link
Contributor

Samweli commented Nov 25, 2020

Hi @rduivenvoorde, @anitagraser @nyalldawson

Ouch, that is nicely hidden in the Source tab of the layer. Honestly never seen it...
@Samweli @nyalldawson Would it not be better if this would be a (dynamic showing) part of the Temporal tabin the layer props?

The WMS-T settings in source tab can be used with or without the Temporal Controller, moving these settings into the Temporal tab might confuse users who just want to fetch a WMS-T resource and do nothing about the Temporal Controller or the layer's temporal properties.

To me the word 'Range' in the 'Time slice mode' drop down is confusing, I think. It is actually the 'Time Frame' we are talking about isn't it?

Yes, in the context of using these settings with the Temporal Controller, might need to find words that fit both use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Temporal Temporal filtering or animation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants