1

Using

PostgreSQL 10.4, compiled by Visual C++ build 1800, 64-bit
PostGIS 2.4.4
pgRouting 2.6.0

and This Tutorial I am trying to run this Query

$conn = pg_connect($conString);
$sql = "SELECT gid, AsText(geom) AS wkt,
           length(geom) AS length, ".TABLE.".id
        FROM ".TABLE.",
            (SELECT gid, geom
                FROM dijkstra_sp_delta(
                    '".TABLE."',
                    ".$startEdge['source'].",
                    ".$endEdge['target'].",
                    3000)
             ) as rt
        WHERE ".TABLE.".gid=gid;";
$query = pg_query($conn,$sql);

but I am getting this error:

Warning: pg_query(): Query failed: ERROR: function dijkstra_sp_delta(unknown, integer, integer, integer) does not exist LINE 5: FROM dijkstra_sp_delta( ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in D:\wamp64\www\Route\assets\post.php on line 46

What am I doing wrong?

2
  • Have you defined TABLE?
    – JGH
    Jul 4, 2018 at 21:52
  • Hi , thanks for reply, yes I did. I even pass the table name directly victoria and getting same error back
    – Mona Coder
    Jul 4, 2018 at 21:55

1 Answer 1

1

The tutorial you're trying to follow is from FOSS4G conference in 2007, and pgRouting has changed a lot since then.

You need to update your pgRouting functions to the current version. But more easy would be to start with the pgRouting workshop: https://workshop.pgrouting.org/

2
  • Thanks for comment but the latest workshops are not using any PHP model!
    – Mona Coder
    Jul 5, 2018 at 14:56
  • Yes, but they use the current SQL queries. It shouldn't be too difficult to change apply the new SQL syntax to PHP.
    – dkastl
    Jul 7, 2018 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.