bmwcarit / barefoot

Java map matching library for integrating the map into software and services with state-of-the-art online and offline map matching that can be used stand-alone and in the cloud.
Apache License 2.0
664 stars 185 forks source link

Why are the output timestamps rounded to seconds when the input is in ms ? #114

Closed Walfou closed 6 years ago

Walfou commented 6 years ago

I obtained raw GPS coordinates with millisecond precision timestamps. So instead of adding 000 to second-rounded timestamps, I have non-zeros in the 3 last digits of the input timestamp. Nevertheless, the output I receive from barefoot is integer timestamps rounded to seconds.

Any clue?

smattheis commented 6 years ago

To which output format are you referring? Is it the "debug format"?

Walfou commented 6 years ago

Yes it is. Is this the reason the output is rounded?

smattheis commented 6 years ago

The rounding is done only in the output formatter. There's also no special reason except that a debugging tool that I used in the past was using a time resolution in seconds and did not allow time intervals below. If you rely on the output formatter, you can easily edit the rounding to your need (or add another output formatter that is the same as the output formatter with your modifications). See here: https://github.com/bmwcarit/barefoot/blob/master/src/main/java/com/bmwcarit/barefoot/matcher/MatcherKState.java#L107

Walfou commented 6 years ago

Problem solved. Thanks! I am not even sure this is really an "issue" !