CD / docs /SHAPE_AWARE_ROAD_CONNECTION.md
tkadkghdlf's picture
Sync DemoService 7323ab7b07d7875804d4fa77e47a6caa86927f52
3e3f767 verified
|
Raw History Blame Contribute Delete
2.65 kB

Shape-aware road connection experiment (2026-11-02)

Normal shape-priority route generation now compares three connected road paths for the first twelve GPX placements at each search scale: the previous length-only shortest path and two soft corridor routes. A corridor route penalizes distance from the current GPX segment, backward progress, and repeated directed edges. A leg longer than 1.8 times its shortest alternative falls back to the shortest road path. All output edges remain in the walking graph. The complete path is ranked against its source GPX outline; the shortest route remains a candidate and can win.

If the usual Overpass graph provider is unavailable, shape-priority search tries the same cached 2 km OSM walking graph used for map-point discovery before falling back to the independent route provider. This recovery uses 4, 7, and 10 km search scales so the smaller graph can still produce a shape-aware candidate. It keeps the independent provider as the last real-road recovery path when OSM map data cannot be fetched either. The recovered graph is reused in memory for later requests in the same worker.

Local checks on a Seoul road graph (6,021 nodes) with 10 fixed placements across five labels: the best corridor option improved the existing GPX similarity in 8 cases and decreased it in 2; the mean raw difference was +0.0025. The complete generator with a fixed seed and 8 templates per label returned six paths per label:

Label Old best / mean New best / mean New contour paths Old / new seconds
Dog .9771 / .9615 .9816 / .9748 0 10.7 / 12.1
Star .9862 / .9604 .9862 / .9751 0 10.4 / 11.8
T-shirt .9895 / .9481 .9895 / .9854 2 12.7 / 12.9

These are geometry scores on limited placements, not proof that people will recognize every shape. Heart and tree full-generator comparisons were not completed because a heart baseline attempt took over five minutes on the local machine. The deployed candidate generation remains bounded to twelve contour attempts per search scale. Once enough GPX-guided candidates exist, random loops are skipped. On the same local graph this changed the new generator from 10–13 seconds to 1.6–2.0 seconds for dog, star, and T-shirt, without changing the six selected paths or their measured scores. The first live request before this optimization took 99 seconds and did produce two connected T-shirt paths, one with contour routing. Live latency after the optimization still needs measurement. Visual review and broader regional tests are also needed before calling the new paths consistently better.