Ticket #155 (closed bug report: invalid)

Opened 19 months ago

Last modified 19 months ago

PGRouting output is not in sequence order.

Reported by: shafeer Owned by: somebody
Priority: major Milestone: Version 1.1
Component: A* Version: 1.03
Keywords: PGRouting Cc:

Description

I am executing a pgrouting query as shown below: " SELECT rt.gid as geomId, astext(rt.the_geom) as geometry,"E_NAME" as rd_name,length as len FROM new_riyadh,(SELECT gid, the_geom FROM dijkstra_sp('new_riyadh',3785,3586) ) as rt WHERE new_riyadh.gid=rt.gid; "

I successfully retrieved a set of coordinates to draw the routing path. But when when I tried to find the direction I discovered that the coordinates were not in sequence. Is there a way so that I can retrieve a sequence of coordinates as output.

Change History

follow-up: ↓ 2   Changed 19 months ago by daniel

As far as I remember (didn't test it now) a shortest path search also returns "id".
You can do a "ORDER BY id" if your links are in a wrong order.

Was this the question?

in reply to: ↑ 1   Changed 19 months ago by shafeer

Replying to daniel:

As far as I remember (didn't test it now) a shortest path search also returns "id".
You can do a "ORDER BY id" if your links are in a wrong order. Was this the question?

Thanks for your immediate reply.

Can you please explicitly tell me which "ID" should I refer to because my query returns only a gid (sequence id). You mean to tell that pgrouting query returns a id? I am really stuck up with this issue as I am unable to get the proper direction.

  Changed 19 months ago by daniel

  • status changed from new to closed
  • resolution set to invalid

I think the same question came up in this ticket #156, so maybe this also solves your problem. If you use a wrapper function instead of the core function, this will return you the "id" attribute.

So since this is not a ticket actually, I'm going to close it. Please use the forum or mailing list, if you have further questions.

Note: See TracTickets for help on using tickets.