I have some data on frequency of different road segments, and need to visualise it as a heatmap. Is there some utility/plugin for Mapbox or Leaflet which does this kind of visualisation. I am only able to find Leaflet plugins for visualising points as heatmap.

My current approach is to convert the frequency into a colour range, and then put it in GeoJSON. But it suffers from the problem where I can't assign proper weights to the polyline. I need the line to exactly overlap the road (proper width and following the road curve), so that it seems like highlighting the road.

Another approach could be breaking the line into multiple points, encoding frequency in them and making a heatmap out of that. But that would be too artificial, and I think that there should be a better elegant way out there.

  • @arpanmangal Have you already checked this article? – Taras Jul 9 '18 at 12:37
  • @TarasDubrava none of them exactly meets the requirements. Most of them are not for mapbox or leaflet. I found only one, but that is a bit outdated, and I don't think it is plotting the line such as to cover the exact width of the road – arpanmangal Jul 9 '18 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.