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

Add BBox Option to Heatmap Poster #7

Open
flopp opened this issue Jan 25, 2017 · 6 comments
Open

Add BBox Option to Heatmap Poster #7

flopp opened this issue Jan 25, 2017 · 6 comments

Comments

@flopp
Copy link
Owner

flopp commented Jan 25, 2017

Add bbox option (--bbox COORDS1;COORDS2) to restrict the extent of the heatmap poster.

Rationale: if there are some tracks in your collection that are far away from the other tracks (e.g. runs during vacation), the heatmap poster becomes useless.

@lefty01
Copy link

lefty01 commented Jan 25, 2017

hi, i was looking for the same feature as well ;)
actually I started looking at the heatmap_drawer.py and thought that it might be as easy as overwrite min/max values in this line:

(min_x, min_y, max_x, max_y) = utils.compute_bounds_xy(xy_polylines)
but so far I got no good result.
If you could give some hints here, maybe I could try them in my fork.
For the argument passing probably just add lat/long coordinates to the TracksDrawer draw method (although there are quite some args there already;))

@laufhannes
Copy link
Contributor

Shall all the statistics on the poster's bottom be calculated based on all tracks or only on filtered tracks?

@lefty01 I guess track_loader.py::__filter_tracks(self, tracks) is the right place and you might need something similar to utils.py::compute_bounds_xy(polylines) for lat/lng.

@lefty01
Copy link

lefty01 commented Feb 1, 2017

hi I pushed my works I had so far to my fork and submitted a pull request ... you can review the changes and I would be glad to hear any feedback if that makes sense...
at least it works (as in works for me ;))
I do the restriction by overriding the min/max x/y values as inidcated in my previous comment. This has the drawback to to update the statistics.

so maybe I give your idea with filtering all tracks beforehand and see if they match the given boundaries.
@laufhannes I haven't checked your code for the map feature but does this include this filter already?

cheers
andreas

@laufhannes
Copy link
Contributor

@lefty01 Nope, my work on the background map does use all tracks.

@lefty01
Copy link

lefty01 commented Feb 6, 2017

hi, now had some more time to look into this ... as discussed in the old pull-request comment: #11 (comment)
I made use of gpxpy's get_bounds function to add track bounds as an attribute to each track while loading gpx (will be stored to cache too).
first stage filter should be in place and check if track is completly out of the requested bbox bounds.
you can find those at this branch: comments/suggestions etc. welcome
https://github.com/lefty01/GpxTrackPoster/tree/heatmap-border

@flopp
Copy link
Owner Author

flopp commented Jan 7, 2018

a3d57b8:

add options --heatmap-center LAT,LNG and --heatmap-radius RADIUS_KM to specify the heatmap's center coordinates, and a radius around this center (in km). The scale factor of the heatmap will be computed in a way that all tracks in this circle will be visible.

lowtower referenced this issue in lowtower/GpxTrackPoster Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants