[pgrouting-users] TRSP returns "Start id was not found"

Hello All!

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)

pgr_version: 2.0.0,pgrouting-2.0.0,0,f26831f,master,1.53.0

Please could you tell me what’s wrong ?

Hi again.

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);

Thanks very much to author of this post for idea.

Best regards.

Hello All!

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)

pgr_version: 2.0.0,pgrouting-2.0.0,0,f26831f,master,1.53.0

Please could you tell me what’s wrong ?


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Vladimir,

This is a good catch!

Can you please write a bug on this issue so we remember to resolve it in the next release.

Glad you got this working.

Thanks,
   -Steve

On 3/7/2014 5:45 AM, Vladimir wrote:

Hi again.

As written in the documentation
<http://docs.pgrouting.org/2.0/en/src/trsp/doc/index.html#trsp&gt;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);

Thanks very much to author of this
<http://pgrouting-users.974093.n3.nabble.com/pgrouting-users-Shortest-Path-TRSP-td3782221.html&gt;
post for idea.

Best regards.

    Hello All!

    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)

    pgr_version: 2.0.0,pgrouting-2.0.0,0,f26831f,master,1.53.0

    Please could you tell me what's wrong ?

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    </compose?To=Pgrouting%2dusers@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Stephen,

I added new issue about a couple of bugs pgr_createTopology:
https://github.com/pgRouting/pgrouting/issues/240
Thanks very much for you efforts.

Best regards.

Hi Vladimir,

This is a good catch!

Can you please write a bug on this issue so we remember to resolve it in
the next release.

Glad you got this working.

Thanks,
-Steve

On 3/7/2014 5:45 AM, Vladimir wrote:

Hi again.

As written in the documentation
<http://docs.pgrouting.org/2.0/en/src/trsp/doc/index.html#trsp>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);

Thanks very much to author of this
<http://pgrouting-users.974093.n3.nabble.com/pgrouting-users-Shortest-Path-TRSP-td3782221.html>
post for idea.

Best regards.

Hello All!

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)

pgr_version: 2.0.0,pgrouting-2.0.0,0,f26831f,master,1.53.0

Please could you tell me what’s wrong ?


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
/compose?To=Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

On Sun, Mar 9, 2014 at 3:52 AM, Vladimir <fl_v@inbox.ru> wrote:

Hi Stephen,

I added new issue about a couple of bugs pgr_createTopology:
https://github.com/pgRouting/pgrouting/issues/240
Thanks very much for you efforts.

Best regards.

Hi Vladimir,

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

Hello Daniel,

I’ve corrected the issue.
Sorry for my mistake.

Best regards.

···

On Sun, Mar 9, 2014 at 3:52 AM, Vladimir fl_v@inbox.ru wrote:

Hi Stephen,

I added new issue about a couple of bugs pgr_createTopology:
https://github.com/pgRouting/pgrouting/issues/240
Thanks very much for you efforts.

Best regards.

Hi Vladimir,

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