performance of pg_routing with exact location
<p>pg_routing find shortest path from a start and an end point which are exacts vertexes on ways (the nodes), but there's no proper solution when we want to find the shortest path for locations which are not on the ways (like POI, exacts addresses, ...). The general solution is to search the nearest nodes, and then compute the shortest path, but the result can be far from the reality if for example, the road has a big length, or the nearest node is on another road which doesn't intersects the nearest road of the searched location. So, I think about 2 solutions for this problem but I don't really know how pg_routing algorithms are efficient if the network grow up :
1- split the road at each X meters, which will drastically increase the number of nodes, and BTW the topology, and then compute the shortest path on these new nodes,
2- At each pg_routing call, pre-compute for start/end locations : find the nearest way, split this way in 2 parts with ST_LineLocatePoint at the nearest location, append these news ways to the others no-splitted ways, and finally call pg_routing
So, which is the best solution in term of performance, taking into account the fact that for solution 2, I don't know how to dynamically modify the topology?</p>