[pgrouting-users] pass query results to routing function
hghklly at gmail.com
Mon May 9 12:43:06 PDT 2022
To follow up, the structure below seems to work fairly well for this. would
still be curious to see better options if anyone knows of any.
This is a little awkward since it ends up returning a results table that's
a single column that's a pseudo type record.
drop table if exists scratch.routing_pairs;
create table scratch.routing_pairs as (
dp1.tdg_id as origin_id,
dp1.nearest_net_node as origin_node,
dp2.tdg_id as dest_id,
dp2.nearest_net_node as dest_node
left join automated.doors_and_parking dp2 on st_dwithin(dp1.geom,
'SELECT tdg_id as id, source, target, length_cost as cost FROM
automated.ped_network as edge_table where source is not null and target is
On Mon, May 9, 2022 at 3:22 PM Hugh Kelley <hghklly at gmail.com> wrote:
> I'm wondering if anyone has an example of a query that calculates routes
> between pairs of nodes that is a subset of all the possible pairs in the
> I have a network with ~5297 nodes, for ~28 million possible pairs. I could
> calculate routes for all of these pairs and then use the subset of routes
> that i need, but it seems that there could be a way to calculate only
> routes for the ~17 thousand pairs I actually care about. If possible I
> would filter to only calculate pairs where the origin node is
> ST_DWITHIN(a.geom, b.geom, 250), for example.
> is there a way to pass the results of a query to the pgr_dijkstra()
> function? I haven't seen an example of that as I've read through the docs.
> is there a way to apply a condition like st_diwthin() to the arrays passed
> to the function?
> thanks for any advice or suggestions, hope everyone's week is off to a
> good start.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pgrouting-users