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
[GPX export] Consecutive and very close points with same timestamp #664
Comments
Hmmh, could be related to the roundabout code or even to this old issue here #290 |
Hmmh, cannot reproduce it with my/your link anymore. But this seems to produce duplicate endpoint which is not what you reported: https://graphhopper.com/maps/?point=46.585689%2C6.604812&point=46.585658%2C6.604792&locale=de&vehicle=car&weighting=fastest&elevation=true&layer=Omniscale Do you have a link where your duplicate time entry can be reproduced? And I guess you have to avoid this to calculate the speed? |
In this GPX file exported from GraphHopper Maps at this link, it happens 20 times, at timestamps:
Zoom on Sample 1
This one is actually not at a roundabout. Yes, division by 0 occurs when calculating speed. Luckily, my code is easy to fix, by first checking for 0 time span. GraphHopper should probably not generate such GPX files in the first place. |
Well, although there might be a bug e.g. with the previous example this very close example makes sense to use identical timestamps as the resolution is just seconds, but even if |
Whether it's a bug or intended is up to you. I'll give my opinion, and maybe other readers here will too, and in the end you decide :) As far as I could research , a GPX file having points at different locations but with the same timestamp is not a violation of the spec. It makes little sense though, as you can't be physically at the same time in different places. Some clients or code reading such GPX file with same timestamps will have trouble, in the worse case even crash. We should avoid generating such problematic files. (For reference, I was using such client which didn't expect same timestamp in different points, it's bentasker/PHP-GPX-Ingest#6.) My preferred option:
Other option, less preferred:
3rd option, least preferred:
|
Thanks - really interesting issue :) !
I'm not sure anymore. As we will have to remove these points in a kind of a preprocessing and loose geometric precision. The problem is not that a vehicle is at two points at the same time, the problem is that the time precision is not high enough.
Sounds good, but I doubt it will remove the chance in every case. A 4th option could be to add a parameter like "gpx.post_processing=remove_dup_timestamps" |
There are GPX exported files with very close points having the same timestamp.
Example
See also Discussion on GraphHopper forum.
The text was updated successfully, but these errors were encountered: