Problem as shown in the image: I like to correct the GPS track (orange) to the right road (black). In a network of roads it is difficult to snap to the right path - for human it's obvious which one is the right - how can we compute?
Until now I tried to find a solution in QGIS: A. in QGIS
- buffer road
- clip track
- extract vertices
- snap to road
- points to path
- snap to road -> corners are often cropped
I also tried to smooth the line before. The problems remain...
B. in QGIS:
- buffer road
- clip track
- extract vertices
- snap to road
- points to path
- select by location (intersecting elements of road) -> results with gaps
C. GRASS in QGIS v.edit -> problems of snapping not to the right road perists
D. in POSTGIS:
- split track in segments of 10m (roads are mostly segments of 10m)
- calculate Hausdorff distance:
CREATE TABLE tracks2 AS
SELECT a.id, a.geom
FROM roads a, track1 b
WHERE ST_HausdorffDistance(a.geom, b.geom)< 3;
-> to many wrong segments, to many missing segments
E. in POSTGIS: I was thinking of a solution with the change of azimuth between points, but I got troubles with the points between the locations of change and corners. (see my previous question: PostGIS: ST_Azimuth between Points in same Table)
And now I found this: Matching segments of different lengths
How can I implement this in POSTGIS? Or is there a completely different approach (Python, ...)?
I also researched the topics map matching / conflation without finding a solution that suits my problem and my possibilities.