Skip to content

Conversation

@dwj300
Copy link
Collaborator

@dwj300 dwj300 commented Jan 29, 2020

Also add virtualennv / .DS_Store to the .gitignore


if args.type == "cluster":
cluster = DBSCAN(eps=args.radius, min_samples=10)
cluster = DBSCAN(eps=args.radius, min_samples=args.min_cluster_size)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@tomstitt
Copy link
Owner

tomstitt commented Jan 31, 2020

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 load_gpx that there is only one segment but that's easy to change

@dwj300
Copy link
Collaborator Author

dwj300 commented Jan 31, 2020

good idea! ill make those changes today

@tomstitt
Copy link
Owner

tomstitt commented Feb 5, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants