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 1. buffer road 2. clip track 3. extract vertices 4. snap to road 5. points to path 6. snap to road -> corners ar often cropped
I also tried to smooth the line before. The problems remain...
B. in QGIS: 1. buffer road 2. clip track 3. extract vertices 4. snap to road 5. points to path 6. 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: 1. split track in segments of 10m (roads are mostly segments of 10m) 2. 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 Can someone help mo to 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.