有没有办法在A *和Dijkstra中增加转弯限制?


11

我们目前正在使用pgRouting,发现无法实现转弯限制(例如,禁止右转或左转)。尽管可以在Shooting *算法中分配“ to_cost”和“ rule” ...我找不到使用A star和Dijktra算法实现这些限制的方法。

有没有办法在A star和Dijkstra方法中实施特殊的转弯限制?

Answers:


3

是的,我们刚刚实施了转弯限制最短路径(trsp)。我认为它已在origin / trsp中检查到git分支中。尚未记录。如果您有任何疑问或需要帮助,请在种植清单上询问,因为那是我的聚会地点。

-史蒂夫


1

你在找这个吗?

7.2. Restricted access

Another possibility is to restrict access to roads of a certain type by either setting a very high cost for road links with a certain attribute or by not selecting certain road links at all:

UPDATE classes SET cost=100000 WHERE name LIKE 'motorway%';

Through subqueries you can mix your costs as you like and this will change the results of your routing request immediately. Cost changes will affect the next shortest path search, and there is no need to rebuild your network.

Of course certain road classes can be excluded in the WHERE clause of the query as well, for example exclude living_street class:

SELECT * FROM shortest_path_shooting_star(
        'SELECT gid as id, class_id, source, target, length*c.cost as cost,
                x1, y1, x2, y2, rule, to_cost, reverse_cost*c.cost as reverse_cost
        FROM ways w, classes c
        WHERE class_id=c.id AND class_id != 111', 6585, 8247, true, true);

Of course pgRouting allows you all kind of SQL that is possible with PostgreSQL/PostGIS.

这是车间的一个片段。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.