| Ticket Hash: | 30b9b033388906faec6f0473bf44bdb7fe2293eb | |||
| Title: | pgr_routing like dynamic costing in VirtualRouting | |||
| Status: | Closed | Type: | Feature_Request | |
| Severity: | Severe | Priority: | Immediate | |
| Subsystem: | Resolution: | Works_As_Designed | ||
| Last Modified: | 2020-09-25 13:36:51 | |||
| Version Found In: | 5.0.0 | |||
| User Comments: | ||||
anonymous added on 2020-08-27 03:56:01:
I am using Virtual Routing to find routes. My cost expression for a link is a function of link attributes.
For e.g. something like this'case when speed_limit < 30 then 0.5 else 1 end'.
In some cases it would be a function of other attributes like 'elevation' or 'gradient'.
In pg_routing, once the network topology has been created on the edge table, one can write queries like this to create routes using custom cost expression.
E.g.
select pgr_dijkstra('SELECT *, <some-sql-expression>as cost FROM testschema.edge_table', 17914, 1248);
Is there some way to specify custom sql expression for cost in VirtualRouting?
I have also included below a link to the pg_routing documentation as well.
https://docs.pgrouting.org/2.5/en/pgRouting-concepts.html
sandro added on 2020-09-25 13:36:51: the design of VirtualRouting is not the same of the one adopted by pgRouting, and is based on static snapshots of the network. different cost policies can be easily supported by defining separate snapshosts adopting different cost expressions. for a more detailed explanation please see https://groups.google.com/forum/#!topic/spatialite-users/Y5q7SWM0LDA | ||||