简体   繁体   English

pgr_trsp-应用限制而不考虑其成本

[英]pgr_trsp - applying restrictions with no consideration to their cost

I'm trying to solve a common problem which is railway routing, thus enforcing several turn restrictions, eg: "Cannot go from EDGE A to EDGE B via NODE c" 我正在尝试解决一个常见问题,即铁路路线,因此实施了一些转弯限制,例如:“无法通过NODE c从EDGE A到EDGE B”

Trains cannot do sharp turns and other stuff, so what I have now is a list of source and target edges that I dont want to present in my shortest path result. 火车无法进行急转弯和其他操作,因此我现在要列出的是我不想在最短路径结果中显示的源和目标边的列表。 The problem is that the way pgr_trsp works right now, we have weighted restrictions, which is not ideal because those turns can NEVER happen, not based on their weights but by the simple fact that it is impossible for a train to maneuver like that, under normal conditions and speed. 问题在于pgr_trsp目前的工作方式,我们有加权限制,这是不理想的,因为这些转弯永远都不会发生,不是基于它们的重量,而是因为一个简单的事实,即火车在这种情况下无法像这样操纵正常情况和速度。

My question is, is there any possibility of ignoring the weight and just to check if the turn is allowed or not ? 我的问题是,是否有可能忽略重量而只是检查是否允许转弯? Am I missing something on the documentation or any attribute that specifies that ? 我是否在文档中缺少某些内容或指定该内容的任何属性?

pgr_trsp(
    sql text,
    source_eid integer,
    source_pos double precision,
    target_eid integer,
    target_pos double precision,
    directed boolean,
    has_reverse_cost boolean,
    turn_restrict_sql text DEFAULT NULL::text)

Maybe setting the weight to some specific/magical value perhaps ? 也许将权重设置为某些特定/神奇的值?

The expected result is if there are no valid paths that intersect the valid maneuvers, then no output should be expected. 预期的结果是,如果没有与有效操作相交的有效路径,则不应预期输出。

I'm not sure if that is implemented. 我不确定是否已实现。 Try setting the cost to -1 and see if that works. 尝试将成本设置为-1,看看是否可行。

Otherwise all you can do is set the cost to a really high number which will force it to find a lower cost alternative route. 否则,您所要做的就是将成本设置为一个很高的数字,这将迫使其寻找成本更低的替代路线。 Then you will need to check the results and if the high cost turn was included then you need to realize that the requested route is not possible without taking an impossible turn, so treat that as no route was found. 然后,您将需要检查结果,如果包括了高成本转弯,那么您需要意识到,如果不采取不可能的转弯,则无法实现所请求的路线,因此应将其视为未找到路线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM