amillb / pgMapMatch

map-matching of GPS traces
MIT License
77 stars 20 forks source link

U-turn on last edge is not represented #12

Closed amillb closed 5 years ago

amillb commented 5 years ago

If there is a U-turn on the last map-matched edge, that is not represented in the sequence of edges or the PostGIS geometry.

The root problem here is that the U-turn is only "forced" when the trace continues onto a subsequent edge. (The transition probabilities are inherently edge based.)

The best way to resolve this would be to add a section to fillRouteGaps() that checks whether there should be a U-turn on the final edge.

amillb commented 5 years ago

Note this behavior can be turned off by setting mm.allowFinalUtrn=False