flopp / GpxTrackPoster

Create a visually appealing poster from your GPX tracks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configurable (or automatic) line width for heatmap

laufhannes opened this issue · comments

As already stated in #7, the heatmap is kind of useless if the track collection is wide spread. Still, I'm a big fan of having a look at my complete route net.

My current solution is to reduce line widths by hand, e.g.

for line in scaled_lines:
    d.add(d.polyline(points=line, stroke=color, stroke_opacity=0.02, fill='none', stroke_width=0.5, stroke_linejoin='round', stroke_linecap='round'))
for line in scaled_lines:
    d.add(d.polyline(points=line, stroke=color, stroke_opacity=0.05, fill='none', stroke_width=0.2, stroke_linejoin='round', stroke_linecap='round'))
for line in scaled_lines:
    d.add(d.polyline(points=line, stroke=color, fill='none', stroke_width=0.05, stroke_linejoin='round', stroke_linecap='round'))
for line in scaled_lines_special:
    d.add(d.polyline(points=line, stroke=color_special, fill='none', stroke_width=0.05, stroke_linejoin='round', stroke_linecap='round'))

That is: 0.02, 0.5 and 0.05, 0.2 instead of 0.1, 5.0 and 0.2, 2.0 (for ~2.600 activities from Sweden till the Alps). A high resolution image is required, but it works.

Maybe it's possible to automatically calculate line widths based on d_y and d_x. We could define limits for the values (e.g. both version from above as upper and lower limit respectively).

First attempt to address this issue with #94
Please test it.

Thanks,
LT.

That looks great, thanks!