color of track according to speed/altitude

Started by golgot, April 14, 2011, 06:48:36

0 Members and 2 Guests are viewing this topic.

golgot

I hope that there is no similar wish on the forum this time. :D (last time I was looking for "picture" but the term used was "pic")
My wish (ok, it's just one of my wishes) is that Locus can be able to plot a track with altitude or speed using different colors (eg green at 0 km/h, Orange at 20 and red at the max speed)...
  •  

Menion

#1
hmm I'm looking at it and cannot find simple and memory efficient way how to do this. Don't you have any inspiration in any other app where this works fine?
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

golgot

#2
Locus 3.12? :D

No seriously, I don't know... Looking on Google, it seems that some software are able to do that : http://goopstechnologies.com...  But I don't know if it's cost effective or simple? :)

In the past, I used to have almost the same problem (nothing to do with cartography, it was about wave propagation), and the software I used (Matlab) was able to do that easily (It was only necessary to specify a third color argument for each X,Y ...) And it was really easy to convert a value to a color using RGB values...

But I don't know how do you plot tracks on Locus, so I can't really help...
  •  

berkley

#3
Hi,

this in "My Trails" https://market.android.com/details?id=c ... s.mytrails

Cheers, berkley
Search before posting!!!
XDA Orbit, HTC Touch HD, SGS1, SGS2, Nexus S, S4 Active, OnePlus One, Innos D6000
OnePlus X
  •  

Menion

#4
hmm as I thought. Colorization over all track with some gradient isn't possible in android api. Only solution as I discovered and looks that My trails also, is to cut track to single parts and set and draw gradient for every single part.

this have few main disadvanteges

1. more memory required. For every two points (one part) is needed new object that store these values and also two color values (integers) to hold gradient on start and end of this path (between two points)
2. track looks then similar to track on screenshots from My Trails. So it's not connected and slight track but just single lines that not connect perfectly in the ends

So this actually leads to not well looking and more memory required solution. If any developer have any other solution, it will be very welcome. But this one, I think, doesn't worth it. I really like to see too, colorized tracks, but it actually isn't possible in simple way as I see ...

PS: or anyone use My Trails and tracks looks nice, are fast and fluent? If so, I can go through their code on google code and search there a little ..
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

golgot

#5
Sure that if you need to draw tracks point per point, it can take some memory.

I don't know Android API, but can you draw sort kind of dotted line? If you can put some "jumps", it may be more memory efficient to
 - extract all part of track where speed is between 0 and 9 km/h (for example) and draw this dotted line in green
 - extract all part of track where speed is between 10 and 19 km/h (for example) and draw this dotted line in orange
 - aso

So you only draw, let's say 10 or 20 dotted lines (according to the gradient of color that you expect) which join together

I'm conscious that this is not really a good solution, but I'm sure is better that doing it point per point
 - this will take far less memory (I think)
 - connection problems will only occur if speed change...
  •  

Menion

#6
this is not possible. Gradient is applied from one place on screen to another. So I have to define gradient from one place (first point) to second (second point). This sounds really weird. Have to check My Trails code :)
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

golgot

#7
Hum, I think I was not clear (as usual :)

If fact you don't need to use gradient : Look at the following picture, You've a track with a gradient according let's say to speed.

You divide this track in 3 differents tracks (one green where speed is < maxspeed/3, the second orange where 1/3 * maxspeed<speed<2/3 maxspeed, the last one red where speed > 2/3 maxspeed)..

Now you draw these 3 tracks (without gradients)... Of course, with 3 colors, it's awful, but if your do that with 10 colors or more, it may looks not so bad?
  •  

golgot

#8
was I clear  :?:   :?  :?:
  •  

Menion

#9
yes golgot you was :) It do not have currently so big privilegy so I forgot to answer. This solution is possible but I'm worried it will look terrible :) I have to do some tests when i have some time ...
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

elmuSSo

#10
I was thinking about that. What do you think about that:

Instead of manually set the values in options Interval(meters) or Interval(seconds) you could add a new feature "Interval dependant of the current speed" or something like that. For example, these fixed values are great for some of the situations. You should set them differently in different situations (smaller values when on foot, mediocrate when in the car, big values when on train). But maybe Locus could adapt dynamically to your actual speed and dynamically cahnge these values. And then, instead of colouring the track, you could just make the intermediate points visible for the user. So if the user will go faster, the dots/point will be in bigger distances from each other. If the speed was small, dots will be more condensed. For the user this will look darker in the small speed segments, and more lighter in fast speed segments. Of course i understand that painting all that dots will be memory not efficient. But if you will add quick on/off switch just to oversee the certaing fragment of the track..
  •  

Menion

#11
hi guys, task done .... check new testing version

task is done by simply painting every path between recorded points by one color. No gradient ... just for your info. But it looks fine and it's fast enough
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Fykantrollet

#12
Aii looking good!! This is a great addition. I like it a lot!

Two comments;
1) The resolution is in 8 colors if I count correctly. It is a little bit hard to see nuances with the colors ranging from red through purple to blue. Maybe better to go through a different color? For example red-yellow-green or red-blue-black.
2) it would be nice to have two color schemes to choose from.

Thanks for the effort!
  •  

Menion

#13
glad you like it. I would rather have only one scheme then allow some selections. Currently there is 10 colors, I'll try to change it a little bit
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Khaytsus

#14
Quote from: "menion"hi guys, task done .... check new testing version

task is done by simply painting every path between recorded points by one color. No gradient ... just for your info. But it looks fine and it's fast enough
I'm confused how this works.  i enabled it in the settings, how to see it reflected on existing tracks?
  •