[pgrouting-dev] Questions about pgrouting dijkstra output table

Dear all,

I’ve just signed to this mailing list even if I would have done it before!
I’ve started using pgRouting only some months ago, when I needed to calculate shortest path on a very huge size graph, that required too much memory and cpu to be loaded and processed into my own application. pgRouting helped me to move complexity of representation and calculation from RAM to a geospatial database. So I 'm really grateful to pgRouting community :slight_smile:
While using pgRouting (pgRouting-1.03) I’ve encountered only the following problem:
as you know the shortest path calculated by dijkstra is stored in a table called “dijkstra_result” and containing “MULTILINESTRING” kind objects. That is shortest path consists of more multilinestrings. The matter is that multllines are not stored into the order I expected. In fact it’s not always true that first table record contains first multiline (containing first point) of shortest path, and the other multilines are not stored so that one record multiline is the next, in the expected order, of the previous record multiline.
This is not a problem if dijkstra_result table has to be used only as a layer to be visualized. But if I need to load into my application dijkstra_result table content and rebuild shortest path, for example by considering all its points coordinates, I need to order multilines, and that’s what I’ve done :slight_smile:

I wonder if this feature is to be considered a bug or if it has never been a problem before.

I apologize for being so long.

thanks in advance

Angela

Hi Angela,

PgRouting doesn't store a result anywhere, but return it as PostgreSQL
result set. It looks like you're using some kind of custom wrapper
around the core function. Can you please tell us how exactly you call
dijkstra function?

Cheers,
Anton.