Open
Conversation
tomstitt
reviewed
Jan 31, 2020
|
|
||
| if args.type == "cluster": | ||
| cluster = DBSCAN(eps=args.radius, min_samples=10) | ||
| cluster = DBSCAN(eps=args.radius, min_samples=args.min_cluster_size) |
tomstitt
reviewed
Jan 31, 2020
| parser.add_argument("--gpx-dir", default="strava", | ||
| help="directory with gpx files") | ||
| parser.add_argument("--use-osm", default=False, action="store_true", | ||
| help="overlay heatmap on top of OpenStreetMap") |
Owner
|
I think it would be better to split segments with large jumps into multiple segments, that way they don't need to be skipped. In that case a track with 1 segment that includes a skip: <trk>
<name>Lunch Ride</name>
<type>1</type>
<trkseg>
<trkpt lat="37.8350560" lon="-122.1949540">
<ele>328.0</ele>
<time>2017-05-21T19:16:51Z</time>
</trkpt>
<trkpt lat="37.8350850" lon="-122.1948800">
<ele>327.4</ele>
<time>2017-05-21T19:16:52Z</time>
</trkpt>
<trkpt lat="37.8350570" lon="-122.1948800">
<ele>327.5</ele>
<time>2017-05-21T19:16:55Z</time>
</trkpt>
<!--Let's say the skip occurs here-->
<trkpt lat="37.8350320" lon="-122.1949230">
<ele>327.7</ele>
<time>2017-05-21T19:16:57Z</time>
</trkpt>
<trkpt lat="37.8350100" lon="-122.1949850">
<ele>327.8</ele>
<time>2017-05-21T19:16:59Z</time>
</trkpt>
<trkpt lat="37.8350050" lon="-122.1950210">
<ele>327.9</ele>
<time>2017-05-21T19:17:00Z</time>
</trkpt>
</trkseg>
</trk>Becomes: <trk>
<name>Lunch Ride</name>
<type>1</type>
<trkseg>
<trkpt lat="37.8350560" lon="-122.1949540">
<ele>328.0</ele>
<time>2017-05-21T19:16:51Z</time>
</trkpt>
<trkpt lat="37.8350850" lon="-122.1948800">
<ele>327.4</ele>
<time>2017-05-21T19:16:52Z</time>
</trkpt>
<trkpt lat="37.8350570" lon="-122.1948800">
<ele>327.5</ele>
<time>2017-05-21T19:16:55Z</time>
</trkpt>
</trkseg>
<!--End last segment, start new one-->
<trkseg>
<trkpt lat="37.8350320" lon="-122.1949230">
<ele>327.7</ele>
<time>2017-05-21T19:16:57Z</time>
</trkpt>
<trkpt lat="37.8350100" lon="-122.1949850">
<ele>327.8</ele>
<time>2017-05-21T19:16:59Z</time>
</trkpt>
<trkpt lat="37.8350050" lon="-122.1950210">
<ele>327.9</ele>
<time>2017-05-21T19:17:00Z</time>
</trkpt>
</trkseg>
</trk>edit: Yes, gpxpy supports updating the gpx objects then saving them back as xml: with open(file, "r") as f:
gpx = gpxpy.parse(f)
track = gpx.tracks[0]
segment = track.segments[0]
if has_jump(segment):
track.segments = ...
with open(file, "w") as f:
file.write(gpx.to_xml())There's an assumption in |
Collaborator
Author
|
good idea! ill make those changes today |
added 3 commits
February 3, 2020 15:40
Owner
|
Can you rename rogue to something more descriptive (split, remove_jumps, etc) and add a line to the readme? Also, what was your motivation for moving the .py files out of the top level? I don't think of this as something ppl will pip (since it's just some scripts) so I'm not sure it's needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also add virtualennv / .DS_Store to the
.gitignore