I try to use TRSP with source_edge/target_edge syntax:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp(‘SELECT id,source::integer,target::integer,cost::float FROM edge_tab’, 138, 0.5, 161, 0.5, false, false);
but the error “Start id was not found” occurs.
Edges with ids 138 and 161 exists in edge_tab that’s checked by
SELECT * FROM edge_tab WHERE id in (138,161)
As written in the documentation for SQL statement of TRSP:
id: int4 identifier of the edge
But pgr_createTopology function creates new “noded” table with “id” of bigint type.
I’ve solved this problem by casting “id” to integer type.
Now that’s works:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp(‘SELECT id::integer,source::integer,target::integer,cost::float FROM edge_tab’, 138, 0.5, 161, 0.5, false, false);
I try to use TRSP with source_edge/target_edge syntax:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp(‘SELECT id,source::integer,target::integer,cost::float FROM edge_tab’, 138, 0.5, 161, 0.5, false, false);
but the error “Start id was not found” occurs.
Edges with ids 138 and 161 exists in edge_tab that’s checked by
SELECT * FROM edge_tab WHERE id in (138,161)
But pgr_createTopology function creates new "noded" table with "id" of
bigint type.
I've solved this problem by casting "id" to integer type.
Now that's works:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp('SELECT
id::integer,source::integer,target::integer,cost::float FROM edge_tab',
138, 0.5, 161, 0.5, false, false);
I try to use TRSP with source_edge/target_edge syntax:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp('SELECT
id,source::integer,target::integer,cost::float FROM edge_tab', 138,
0.5, 161, 0.5, false, false);
but the error "Start id was not found" occurs.
Edges with ids 138 and 161 exists in edge_tab that's checked by
SELECT * FROM edge_tab WHERE id in (138,161)
But pgr_createTopology function creates new “noded” table with “id” of
bigint type.
I’ve solved this problem by casting “id” to integer type.
Now that’s works:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp(‘SELECT
id::integer,source::integer,target::integer,cost::float FROM edge_tab’,
138, 0.5, 161, 0.5, false, false);
I try to use TRSP with source_edge/target_edge syntax:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp(‘SELECT
id,source::integer,target::integer,cost::float FROM edge_tab’, 138,
0.5, 161, 0.5, false, false);
but the error “Start id was not found” occurs.
Edges with ids 138 and 161 exists in edge_tab that’s checked by
SELECT * FROM edge_tab WHERE id in (138,161)
Not sure I misunderstand something, but the "id::int" column in the "sql"
argument of the function is the ID column of the "edges" (or network
table), not the "vertices" (or nodes) table.
Best regards,
Daniel
--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.info
Not sure I misunderstand something, but the “id::int” column in the “sql” argument of the function is the ID column of the “edges” (or network table), not the “vertices” (or nodes) table.