TransWikia.com

Computing large distance matrix with pgrouting?

Geographic Information Systems Asked on June 16, 2021

The last weeks I have tried to make a Distance Matrix with pgrouting.

On small numbers I get a result. For instance < 100 will be 1 sec. < 1000 aprox 15 min. and 2000 aprox 20 min. If I am trying to go for larger numbers, for instance 4000, my computer crashes…. I have tried to change shared buffers, temp buffers, but that seems to make the system more unstable.

I am using postgreSQL 9.6, pgrouting 2.4.1 on a WIN 7 machine with 8GB RAM.
On Pgadmin query tool.

SELECT start_vid, end_vid, agg_cost FROM pgr_dijkstraCostMatrix(
    'SELECT gid AS id, source, target, trunc(length_m) AS cost, trunc(length_m) AS reverse_cost FROM public.ways',
    (SELECT array_agg(id) FROM  public.ways_vertices_pgr WHERE id < 100)
);

Does any one have some advice?

I would like a matrix to try before I would go for a compromise like Euclidean.

One Answer

Did you tried doing it by small pieces and saving the results on a table for every query? Using LIMIT and OFFSET in the "public.ways_vertices_pgr" array may help.

I think it's a problem related to your hardware capabilities.

Answered by guillermo_dangelo on June 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP