May 2017
Beginner to intermediate
328 pages
7h 17m
English
Turn restrictions shortest path is an algorithm that can make use of turn restrictions, so it possible to model real-world scenarios. In terms of performance, it should be close to A*.
For this example, we will focus on a smaller area to demonstrate how to define and use turn restrictions that should be fed to the pgr_trsp function.
Let's first calculate a route from vertex 26306 to vertex 98111:
select * from pgr_trsp('select gid::int4 as id, source::int4, target::int4, length_m::float8 as cost from pgr.ways', 26306, 98111, false, false);
Our output is as follows:
Seq| id1| id2| cost----+------+-------+-------------------- 0| 26306| 41122| 0.00282144411605047 1| 51491| 132340|0.000500071364908483 ...
Read now
Unlock full access