graphhopper / map-matching

The map matching functionality is now located in the main repository https://github.com/graphhopper/graphhopper#map-matching
https://www.graphhopper.com/open-source/
Apache License 2.0
785 stars 274 forks source link

Time difference between subsequent location measurements #105

Closed nafis042 closed 6 years ago

nafis042 commented 6 years ago

I ran graphhopper map matching server and when I send request for the first time it works well.But when I send the same request without restarting server it shows me following error:

[java.lang.IllegalStateException: Time difference between subsequent location measurements must be >= 0.] java.lang.IllegalStateException: Time difference between subsequent location measurements must be >= 0. at com.graphhopper.matching.util.HmmProbabilities.normalizedTransitionMetric(HmmProbabilities.java:93) at com.graphhopper.matching.util.HmmProbabilities.transitionLogProbability(HmmProbabilities.java:78) at com.graphhopper.matching.MapMatching.computeTransitionProbabilities(MapMatching.java:310) at com.graphhopper.matching.MapMatching.computeViterbiSequence(MapMatching.java:248) at com.graphhopper.matching.MapMatching.doWork(MapMatching.java:185) at com.graphhopper.matching.http.MatchServlet.doPost(MatchServlet.java:184) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:287) at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:277) at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:182) at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) at com.graphhopper.http.IPFilter.doFilter(IPFilter.java:60) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.graphhopper.http.CORSFilter.doFilter(CORSFilter.java:38) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.graphhopper.http.HeadFilter.doFilter(HeadFilter.java:37) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119) at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133) at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130) at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:462) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at org.eclipse.jetty.server.Server.handle(Server.java:518) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) at java.lang.Thread.run(Thread.java:748)

kodonnell commented 6 years ago

It looks like your data may be wrong - as per the error, two points have the same time but different location. Can you please verify this by checking your GPX? Not sure why it works the first time and not the second.

That said, it's been a while since I looked at this.

nafis042 commented 6 years ago

Thanks for reply.I have one question.Does map matching uses cache? I mean If I give the same file twice then in 2nd time will map matching uses cache for output?

kodonnell commented 6 years ago

I doubt it, though maybe ask on the forums. My suspicion is 'no' (and it wouldn't be worth implementing either) as I doubt many people submit the same file repeatedly (and if they do, they should implement the caching in their software). Anyway, if you issue is resolved, can you close it?