[pgrouting-users] pgRouting Memory Issues

Daniel Kastl daniel at georepublic.de
Thu Jan 13 23:05:10 EST 2011


Hi Richard,

When you make a query you select your whole network table into memory ...
which is huge, if it's all planet.osm road data.
To make this faster you should make a query, that only selects the road data
you need. Why should you for example load North American roads, when you
route in Europe.

As smaller the amount of selected data is, as faster you will get the
result. That's the trick ;-) And if you route long distances you might want
to consider to create a layered network and run multiple queries.
Look at the part with the bounding box wrapper. It applies for all
algorithms, just look at Dijkstra chapter in the workshop:
http://workshop.pgrouting.org/chapters/shortest_path.html#dijkstra

Daniel


2011/1/14 Richard Marsden <winwaed at gmail.com>

> Well I'm back to trying to get pgRouting working again with my planet.osm
> file. This has been loaded into Postgres with Osm2po.
>
> I'm not sure if I've got the right parameters, but pretty much every
> variation I try results in long running (tens of minutes) before it crashes
> with an out of memory error (typically around 39017600).
>
> An example query:
>
> SELECT * FROM shortest_path (
> 'SELECT id, source, target, cost, reverse_cost FROM osm_topo' , 44070476,
> 44070478, true, true );
>
> I've also tried a few different functions other than shortest_path(). The
> node numbers were picked from a query of the first few rows. I also checked
> indexes: osm2po produced indexes on source, target, etc.
>
> It seems that the inner query which is passed as a parameter to
> shortest_path (or any of the other functions) might be querying the entire
> dataset?  Which of course is huge as I've got the entire OSM planet file
> loaded into PostGres. So I tried adding a WHERE clause to the inner SELECT
> that only queries x1,y1 coordinates within a range (x1,y1 for Node 44070476
> is about 55,51, so I chose 50.0->60.0 and 45.0->56.0 as my ranges).
>
> No better.
>
> So I think I'm really pushing the limits. planet.osm is of course huge, and
> despite the significant pruning by osm2po the resulting routing network is
> still very large. I guess pgRouting just doesn't scale to such admittedly
> large datasets.
> (I note that the online OpenLayers-based demos are limited to individual
> cities)
>
> I wish to eventually do my bulk routing on a country-by-country basis, but
> it would not be practical to load each country individually. I'll look to
> see if there are any other approaches, perhaps with a different offline
> routing engine (using a web service is not deemed practical), but it looks
> like this project is probably going to be dead in the water.
>
>
> Richard Marsden
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>


-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20110114/1497765b/attachment-0001.html


More information about the Pgrouting-users mailing list