[pgrouting-dev] Definitions for types

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jun 14 14:00:21 PDT 2013


On 6/14/2013 4:53 PM, Stephen Mather wrote:
> Hi all,
>
> Really basic question.  Playing with the develop branch.  With
> pgr_costresult, what are the pieces of that composite type, and where's
> the best reference for this?  I guessed rightly that cost was one of
> them, e.g.:
>
> SELECT (pgr_astar('SELECT gid AS id, source, target, length AS cost, x1,
> x2, y1, y2 FROM ways', 25352, 21285, false, false)).cost;
>
> I know how to look up types in psql, i.e. '\dT', or better yet '\dt+',
> but there's no description of what the names of the sub-types are in the
> tuple.

http://docs.pgrouting.org/dev/doc/index.html

It is a generic tuple, and each function decides what to put in the 
slots, but the basic usage is something like:

seq - allows you to maintain order of results after joins
id1 - often node id
id2 - often edge id
cost - cost to traverse edge or get to node

But it can vary based on the specific command.

-Steve



More information about the pgrouting-dev mailing list