Hauk
Hauk copied to clipboard
Feature: Display movement speed
I used my fitness app today after a long time and noticed that I can view how fast I was on a certain position. I could imagine this as a cool feature for Hauk. Below you'll find a screenshot of the map where green is slow and orange/red is fast.
You can already see in the browser how fast you're currently moving, so with this data you can already paint these colors. All this can happen inside the browser.
Hi! Thanks for the suggestion and sorry for taking so long to reply to this. Your suggestion is interesting and it could possibly be a viable feature for the project, most likely an optional feature, that is easy to enable via the config.
The only problem with doing this for real-time data is that the minimum and maximum speed is not predictable. When loading the page, the user might be going at e.g. 30 km/h, but there'd be no way to know if the user then intends to accelerate to e.g. 50 km/h at its highest. If we decide to make 50 km/h the maximum speed on the color scale, what if the user decides to enter the freeway and go 120 km/h? Then the scale would be wrong. It would be possible to set a defined maximum of e.g. 120 km/h and any faster than that will just always be the "fastest" color, but if the user is just walking instead of driving, they'll never be going faster than maybe 10 km/h, and most of the scale would be unused.
I'm not entirely sure how to best implement this. There could be a scale in the config where colors for specific speeds are defined from walking speed up through highway driving speeds, e.g.
$trail_colors = [
0 => '#color1',
4 => '#color2',
10 => '#color3',
30 => '#color4',
70 => '#color5',
120 => '#color6
];
And the chosen color would be determined based on these on a scale, e.g. 25 km/h would be 75% color4 and 25% color3. An alternative would be to have some kind of sliding window that sets the minimum and maximum speed to whatever is the lowest and highest recorded speed currently displayed on the map. E.g. if the user has always moved between 3 and 8 km/h on the current view, 3 km/h would be 0% and 8 km/h would be 100% until either of those values change. However, that would make the colors of the existing trail change as the user's speed exceeds the current maximum or falls below the current minimum, and would also be more complex to implement.
I'm open to suggestions.
I personally would prefer the second option by calculating this in real-time and to dynamically change the scale.
But a more simpler way would be that the user can choose what he's doing. If the user for example chooses the "Walking mode", the highest value would be 10 km/h. But if the user now begins to drive, he could either change the current mode manually or the server detects that the user exceeded the maximum speed for to long and will change the mode to the next higher one, like "Driving mode".
Like you said, it's hard to determine what the user is currently doing by just looking at the speed. I think we should not over-complicate stuff. It would be even enough to let the user choose what he's doing without all that automatic mode switching. My fitness app for example ask me if I'm walking or running and it will change the color scale (I think that at least).
That's a good point. I'm not really that keen on having the user manually input it, as it will probably be an optional feature; whether it's enabled or disabled by default, there will be people who don't use speed-scaled colors, and they won't really have use of an in-app mode selector. But auto-detecting it on the server would mean that it just works seamlessly to the user. I like your idea about pre-defined modes that work for given speed ranges - maybe the exact ranges could also be configurable. E.g. walking is 0-10 km/h, biking at 0-50 km/h, driving at 0-120 km/h, high speed trains or plane travel or whatever at higher speeds than that as well. I'll have to think about it and try to figure out advantages and disadvantages to each approach.
Then there's also the issue of multiple people on the map doing multiple modes of transportation. If one person is walking and one is driving on the highway, I'd need some way to maintain resolution in movement speed for both.
That's actually a very good idea and I have installed Hauk on my personal server and my friends and family are impressed and enjoy the application ! I already got two feedback for the speed. What about starting to add the speed on the top right to see the realtime km/h speed first ? I like the idea of colorizing the path as well but starting with a simple number to see the speed would probably give people the wish to provide feedback on what would be the best for mechanism to colorize. (my personal opinion would be to be able to select the range for 3 colors which is the good balance of details & simplicity)
I've started evaluating hauk if I can make some good use of it. For me calculating current speed and displaying it as a text would work well e.g. 3 km/h when walking.
Hey @pvagner, sorry for answering this 25 days later but this feature is already built-in into Hauk. But maybe you already noticed that D:
Yes, thank you, I have noticed it it's great for my needs.