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

Keep time #10

Closed
thejeshgn opened this issue Jul 29, 2015 · 17 comments · Fixed by #18
Closed

Keep time #10

thejeshgn opened this issue Jul 29, 2015 · 17 comments · Fixed by #18
Labels

Comments

@thejeshgn
Copy link

The time goes missing once the track is simplified. Can we keep the timestamp?

@stefanocudini
Copy link
Owner

I think so, if you try so solve it in a fork I can suppot you... but sorry Now I don't have more free time.
I think this is easily... recovering times data from original track and attach these in new track

@stefanocudini
Copy link
Owner

@Wilkins might be interested

@Wilkins
Copy link
Collaborator

Wilkins commented Jul 29, 2015

Hi @thejeshgn
Could you be more explicit with this issue ? Maybe you have an example of a sample file somewhere ?
Because I don't have timestamps in my track files.
Thanks.

@thejeshgn
Copy link
Author

@Wilkins
Example file: https://thejeshgn.com/blog/wp-content/uploads/2015/07/2015-07-08-car-hubballi-bangalore.gpx

By default every point is

<trkpt lat="13.004387" lon="77.618395">
    <ele>937.45</ele>
    <time>2015-06-04T23:50:18Z</time>
    <pdop>3.20</pdop>
    <extensions>
        <gpxtpx:TrackPointExtension>
            <gpxtpx:course>312.67</gpxtpx:course>
        </gpxtpx:TrackPointExtension>
    </extensions>
</trkpt>

but after simplification it loses time

@thejeshgn
Copy link
Author

@stefanocudini I understand, thank you, its a great tool
@Wilkins Thank you.

@Wilkins
Copy link
Collaborator

Wilkins commented Aug 4, 2015

@thejeshgn, I looked into this issue.
It seems that the upload feature from Leaflet loose the time data and all other data excepted coordinates.
Leaflet converts the uploaded GPX file into GeoJSON raw data and only keep longitutde/latitude coordinates.
I have to look into this more deeply but it seems this is not a simple feature to add to this project...

@stefanocudini
Copy link
Owner

supporting it for all formats may be is not cheap idea.
But only for GPX input and GPX output can be useful.
One simple way I'm thinking now is indexing lat,lon and time from input file and reuse its informations to putting in the output gpx files.. after the simplify and before the download

@Wilkins
Copy link
Collaborator

Wilkins commented Aug 5, 2015

Yeah, I thought of that. But we will have to do it for all the GPX data : ele, pdop, course etc... and for big files, that is a lot of data to handle.
I'll try that for a first try, and @thejeshgn will tell us if it's ok for him.

@thejeshgn
Copy link
Author

@Wilkins sure. I have huge gpx files from my recent trip for testing.

@Wilkins
Copy link
Collaborator

Wilkins commented Aug 5, 2015

Well, it seems to be harder than this...
The Leaflet.FileLayer plugin that handle the GPX upload loose the data on upload. I opened an issue on the project to have help on this : makinacorpus/Leaflet.FileLayer#20

If this way is a dead-end, we can think about a workaround with deeper modifications by changing the file loader plugin with this one : https://github.com/mpetazzoni/leaflet-gpx

Wilkins added a commit to Wilkins/gpx-simplify-optimizer that referenced this issue Feb 5, 2016
Wilkins added a commit to Wilkins/gpx-simplify-optimizer that referenced this issue Feb 5, 2016
stefanocudini added a commit that referenced this issue Feb 7, 2016
 Fixing issue #10 - Adding time and elevation support for GPX/KML
@Wilkins
Copy link
Collaborator

Wilkins commented Feb 7, 2016

Hi @thejeshgn, could you please test this new version with time support ?

@buzden
Copy link

buzden commented Jan 10, 2017

Well, while the original issue author keeps silence, I can say (while using your wonderful tool) that it does not preserve time for points from original GPX files. Actually, I can say that when I'm trying to save simplified track with GeoJSON format, it seems to preserve elevation. But when saving as GPX, the tool does preverse neither elevation nor time.

By the way, the current toGeoJSON saves the times of points in GeoJSON as "coordTimes" array in the properties of the whole track, not like GPX (which saves time of a point as a property of this point). Maybe, this prevents from preserving time when saving optimized track back to GPX.

@Wilkins
Copy link
Collaborator

Wilkins commented Jan 10, 2017

Humm, interesting. I must have messed up something in my tests or in my merge.
Could you please provide me some of your tests file in different formats (geojson and GPX) ? Please be careful of protecting your privacy and remove any private data from the files since they will be publicly readable.
Thank you.

@Wilkins Wilkins reopened this Jan 10, 2017
@buzden
Copy link

buzden commented Jan 10, 2017

Here is an example. The original file is a slightly cut GPX file got from a Garmin device which writes both time and elevation for each track point.

By the way, you can see what is done with UTF-8 string in the name of the track (it is written in Russian).
And, you also can seen that additional XML schemas (with possible additional Garmin info, like track color and etc., which were removed by hand but could left too) were also deleted during this resaving.

@Wilkins Wilkins added the bug label Jan 10, 2017
@Wilkins
Copy link
Collaborator

Wilkins commented Jan 10, 2017

Thank you for the example. I will look into it at the end of january.

@Wilkins
Copy link
Collaborator

Wilkins commented Mar 17, 2017

Issue fixed. But @stefanocudini 's version is not up to date on http://labs.easyblog.it/maps/gpx-simplify-optimizer/
@stefanocudini Could you please update your website ?

Otherwise, people can use the optimizer with this feature on my public copy : http://wilkins.fr/gpx/
NB: This is a working copy so things might get broken sometimes...

@Wilkins Wilkins closed this as completed Mar 17, 2017
Wilkins added a commit to Wilkins/gpx-simplify-optimizer that referenced this issue Mar 17, 2017
Wilkins added a commit that referenced this issue Mar 17, 2017
@stefanocudini
Copy link
Owner

thank you @Wilkins The online version is updated!!

I'm sorry but in the last month I was very busy looking for a new job :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants