pgrouting icon indicating copy to clipboard operation
pgrouting copied to clipboard

Couple of bugs after pgr_nodeNetwork applying

Open tezkz opened this issue 11 years ago • 4 comments

1)Need of casting "id::integer". The pgr_nodeNetwork function creates new "noded" table with "id" of bigint type, but SQL statement of many Routing Functions assumes "id" int4 type. Casting "id::integer" helps to solve this bug. For TRSP example: a) source_node/target_node syntax - SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp('SELECT id::integer as id,source::integer,target::integer,cost::float FROM test', 10, 9, false, false); returns normal edge ids

seqnodeedgecost
010120.29335
18100.2535
29-10

but they contains strange values without casting of "id" to integer

seqnodeedgecost
0101443565800.29335
181443563080.2535
29-10

b) source_edge/target_edge syntax - SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp('SELECT id::integer,source::integer,target::integer,cost::float FROM test_noded', 12, 0.5, 9, 0.5, false, false); returns normal result

seqnodeedgecost
0-1120.45335
17100.6521
2190

but error "Start id was not found" occurs without casting of "id" to integer

  1. The pgr_nodeNetwork creates a lot of EMPTY GEOMETRY in new "noded" table.

tezkz avatar Mar 08 '14 18:03 tezkz

First all, thank you for reporting this issue!

For better understanding I have a few questions:

Regarding (1) you say that the node ID is of type bigint, which is correct (see https://github.com/pgRouting/pgrouting/blob/develop/src/common/sql/pgrouting_topology.sql#L534). Not correct is, that this node ID is the id of the routing function sql argument. The sql argument requires id, source, target, etc. from the network table. Correct is again that for the network table these must be of type integer.

Regarding (2) can you provide some simple example to reproduce this? This would help a lot.

dkastl avatar Mar 08 '14 18:03 dkastl

I had in mind "pgr_nodeNetwork" function. Sorry for my mistake. I've corrected the issue.

tezkz avatar Mar 08 '14 19:03 tezkz

Main discussion in #419

cvvergara avatar Nov 08 '15 21:11 cvvergara

Not working on pgr_nodeNetwork for version 3.0

cvvergara avatar Jul 19 '19 18:07 cvvergara