flopp / GpxTrackPoster

Create a visually appealing poster from your GPX tracks
MIT License
426 stars 50 forks source link

Heatmap border #11

Closed lefty01 closed 7 years ago

lefty01 commented 7 years ago

Hi this would be a first version of adding --bbox switch to the tool. See the respective issue #7 usage example: ./create_poster.py --gpx-dir ~/Sport/strava/2016/ --year 2016 --title "on the run ..." --athlete "Andreas" --type heatmap --output poster-heat-bbox.svg --bbox 48.81583140218061 8.741218034088893 48.46361655741392 9.539988524403476

sample output without bbox: http://exitzero.de/GpxTrackPoster/poster-heat1.svg and with above bbox setting: http://exitzero.de/GpxTrackPoster/poster-heat-bbox.svg

lefty01 commented 7 years ago

well this actually doesn't look right lol http://exitzero.de/GpxTrackPoster/schoenbuch-heat.svg ... so maybe ignore the merge request for now

laufhannes commented 7 years ago

Setting the boundaries and the view box does probably work, but all polylines are written into the svg, even if they are outside the box. This can cause images like yours and will bloat the svg file with polylines that are not shown anyway.

The tracks have to be filtered at some point. But what's with tracks that are partially contained in the view box? Could be hard to draw only the part of the polyline that's in the box.

lefty01 commented 7 years ago

okay will rework and add filter while iterating over the track.polylines.

as for partial tracks ... maybe in that case we can still apply the boundaries to the box as in this patch but then include far less tracks. So the filter function might not only include all tracks that are completely inside the specified bbox coords but also those only "touching" it. what do you think?

... closing this request for now.

laufhannes commented 7 years ago

It'd be nice to have some kind of a 'transition area', a small line of width 10 at each border, where tracks exceeding the bounding box fade out. But, honestly, I don't think that's possibly with svgwrite without tons of work.

My idea for filtering tracks would be:

flopp commented 7 years ago

@laufhannes Your idea sounds reasonable