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

GPS track color coded with speed #910

Closed
tjansson60 opened this issue Jul 16, 2018 · 3 comments
Closed

GPS track color coded with speed #910

tjansson60 opened this issue Jul 16, 2018 · 3 comments
Labels
question The issue contains a question about how to do something

Comments

@tjansson60
Copy link

Question

I am trying to find a way to to color code a GPS track with various data, such as speed, pulse etc using folium, but I have not found any solution in the documentation or the example. The is a online image of the effect I am trying to achieve.

Is this possible in folium currently?

@Conengmo Conengmo added the question The issue contains a question about how to do something label Jul 17, 2018
@Conengmo
Copy link
Member

Yes this is possible. You can use the ColorLine class for this:

https://python-visualization.github.io/folium/docs-master/modules.html#folium.features.ColorLine

We also have a Notebook with some example usage:

https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Features.ipynb#ColorLine

If you need more specific behavior you can copy the code from the ColorLine class and hack it yourself. It's basically a wrapper around two other classes: LinearColorMap and PolyLine.

We don't have a legend feature yet, if you would like to work on this you're most welcome. I'll refer to the original issue: #528.

@tjansson60
Copy link
Author

I am embarrassed that I did not find this myself, but thanks a lot for taking the time to help me. :) The ColorLine was exactly what I was looking for.

@Conengmo
Copy link
Member

Great! Good luck with it. I'll close the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue contains a question about how to do something
Projects
None yet
Development

No branches or pull requests

2 participants