GPXIN-19: Bug: Speed and CalcDistance won't display



Issue Information

Issue Type: Improvement
 
Priority: Major
Status: Closed

Reported By:
Mail Handler
Assigned To:
Ben Tasker
Project: PHP GPXIngest (GPXIN)
Resolution: Fixed (2015-08-11 00:08:44)
Affects Version: 1.02,
Target version: 1.03,

Created: 2015-08-08 15:32:07
Time Spent Working


Description
-------------------------
From: Johann_Schröder <mail@<Domain Hidden>>
To: gpxingest@<Domain Hidden>
Date: Sat, 8 Aug 2015 08:29:36 -0600
Subject: Bug: Speed and CalcDistance won't display
-------------------------


Hey Ben.

I admire your plugin because of its simplicity. I'd like to use it on a private travel blog.

There's one thing I couldn't figure out yet. I tried different GPX files from different applications and devices and I haven't been able to get the speed and distanceTravelled displayed.

So my questions are:
Do I still have to active these features?
Or:
Are these features being surpressed (eventough surpressing is deactivated in my configuration)?

Here is my sample GPX file of Trekbuddy.

Best regards from a german frontend developer living in Nicaragua.
Johann Schröder



Attachments

20150725-055803.gpx

Issue Links

Toggle State Changes

Activity


-------------------------
From: Johann_Schröder <mail@<Domain Hidden>>
To: gpxingest@<Domain Hidden>
Date: Sat, 8 Aug 2015 08:52:46 -0600
Subject: Re: Bug: Speed and CalcDistance won't display
-------------------------


Hey Ben.

I got the calculating of the distance working. Just needed to activate =
it.

However the speed won't show up. It's display in each
trackpart like this in my GPX document:

  <trk>
    <trkseg>
      <trkpt lat=3D"11.543009877" lon=3D"-85.697211027">
        <ele>55.0</ele>
        <time>2015-07-25T12:02:02.989Z</time>
        <extensions>
          <nmea:course>11.6</nmea:course>
          <nmea:speed>1.7</nmea:speed>
        </extensions>
      </trkpt>


Is this maybe not readable for GPXIngest because it's
<nmea:speed>?

Best regards
Johann Schröder


btasker added '1.02' to Version
btasker added '1.03' to Fix Version
-------------------------
From: Ben Tasker <ben@<Domain Hidden>>
To: mail@<Domain Hidden>
CC: gpxingest@<Domain Hidden>
Date: Sun, 9 Aug 2015 00:45:07 +0100
Subject: Re: Bug: Speed and CalcDistance won't display GPXIN-19
-------------------------


Hi Johann,

First, thanks for your kind words!

You're correct, the speed isn't being picked up because it's included in an
extension. The automatic distance calculation is disabled by default as
it's potentially quite intensive, especially on large GPX files, seemed
best to go with the most efficient default.

As of http://projects.bentasker.co.uk/jira_projects/browse/GPXIN-16.html
the class will automatically suppress speed if it isn't present where it's
expected to be. Although I haven't got that far yet, the intention had been
to then calculate the speed based on the lat/lon changes (as well as
calculating time moving etc).

I guess I should probably provide a way to specify that the data is in
extensions as well - out of interest what are you using to generate the GPX
files?

If I get some free time during the week I'll have a look at how
straightforward it'd be to get the speed calculations done (essentially
part of http://projects.bentasker.co.uk/jira_projects/browse/GPXIN-13.html )

Thanks

Ben
--
Ben Tasker
https://www.bentasker.co.uk
-------------------------
From: Johann_Schröder <mail@<Domain Hidden>>
To: ben@<Domain Hidden>
Date: Sat, 8 Aug 2015 21:32:50 -0600
Re: Bug: Speed and CalcDistance won't display GPXIN-19
-------------------------

Hey Ben.

Thanks for the rapid answer.

I'm using the application Trekbuddy to generate the GPX Files on a Samsung Cellphone.
http://www.trekbuddy.net/forum/viewtopic.php?t=7661

Yeah I read in your project plan that you wanted to calculate the speed with the lat/lon changes. I'm excited when your plugin is complete. You could use some custom-styled css3 graphs to let it look awesome. I might do that in the future with your script. I let you know if I get something done.

Adios
-------------------------
From: Ben Tasker <ben@<Domain Hidden>>
To: =?UTF-8?Q?Johann_Schröder?= <mail@<Domain Hidden>>
CC: gpxingest@<Domain Hidden>
Date: Mon, 10 Aug 2015 14:27:11 +0100
Subject: Re: Bug: Speed and CalcDistance won't display GPXIN-19
-------------------------


Hi Johann,

If you clone from the repo now - https://github.com/bentasker/PHP-GPX-Ingest
- you should find you get some speeds back.

I've not got as far as adding support for extensions yet (that'll be
GPXIN-20) but GPXIN-13 is now complete, so if speed isn't where it's
expected to be, and distance calculations are enabled the class will
calculate the speed between trackpoints (in MPH).

I've tested against the GPX file you provided and it seems to work happily
enough:
<?php

require 'GPXIngest.class.php';

$gpx = new GPXIngest();
$gpx->enableExperimental('calcDistance');
$gpx->loadFile('test.gpx');
$gpx->ingest();
echo $json = $gpx->getJSON();


I'll look at getting extension support implemented at some point so that
you can use the speeds written into the file, but I'm still mentally
mapping out how best to go about it.

Let me know how you get on

Ben

On Sun, Aug 9, 2015 at 4:32 AM, Johann Schröder <mail@<Domain Hidden>>
wrote:

> Hey Ben.
>
> Thanks for the rapid answer.
>
> I'm using the application Trekbuddy to generate the GPX Files on a Samsung
> Cellphone.
> http://www.trekbuddy.net/forum/viewtopic.php?t=7661
>
> Yeah I read in your project plan that you wanted to calculate the speed
> with the lat/lon changes. I'm excited when your plugin is complete. You
> could use some custom-styled css3 graphs to let it look awesome. I might do
> that in the future with your script. I let you know if I get something done.
>
> Adios
> Johann
>
> Am 08.08.2015 um 17:45 schrieb Ben Tasker <ben@<Domain Hidden>>:
>
> Hi Johann,
>
> First, thanks for your kind words!
>
> You're correct, the speed isn't being picked up because it's included in
> an extension. The automatic distance calculation is disabled by default as
> it's potentially quite intensive, especially on large GPX files, seemed
> best to go with the most efficient default.
>
> As of http://projects.bentasker.co.uk/jira_projects/browse/GPXIN-16.html
> the class will automatically suppress speed if it isn't present where it's
> expected to be. Although I haven't got that far yet, the intention had been
> to then calculate the speed based on the lat/lon changes (as well as
> calculating time moving etc).
>
> I guess I should probably provide a way to specify that the data is in
> extensions as well - out of interest what are you using to generate the GPX
> files?
>
> If I get some free time during the week I'll have a look at how
> straightforward it'd be to get the speed calculations done (essentially
> part of http://projects.bentasker.co.uk/jira_projects/browse/GPXIN-13.html
> )
>
> Thanks
>
> Ben
>
> > Hey Ben.
> > I got the calculating of the distance working. Just needed to activate
> it.
> > However the speed won't show up. It's display in each
> > trackpart like this in my GPX document:
> > <trk>
> > <trkseg>
> > <trkpt lat=3D"11.543009877" lon=3D"-85.697211027">
> > <ele>55.0</ele>
> > <time>2015-07-25T12:02:02.989Z</time>
> > <extensions>
> > <nmea:course>11.6</nmea:course>
> > <nmea:speed>1.7</nmea:speed>
> > </extensions>
> > </trkpt>
> > Is this maybe not readable for GPXIngest because it's
> > <nmea:speed>?
> > Best regards
> --
> Ben Tasker
> https://www.bentasker.co.uk
>
>
>


--
Ben Tasker
https://www.bentasker.co.uk
All tests seem to have run OK, so closing as Fixed.
btasker changed status from 'Open' to 'Resolved'
btasker added 'Ben Tasker' to assignee
btasker added 'Fixed' to resolution
btasker changed status from 'Resolved' to 'Closed'