1

I'm learning PostGIS and pg_routing to help in our project planning and grant applications at my transportation agency (we wanted to move beyond the limitations of the 1/4 mile walking buffer we use so frequently!).

I have been following underdark's very helpful pg_routing tutorials but am having trouble running the shortest_path function in my own dataset:

function shortest_path(unknown, integer, bigint, boolean, boolean) does not exist
LINE 6:        SELECT * FROM shortest_path('
                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

CREATE TABLE catchment_facilities AS
SELECT
    id,
    the_geom,
    (SELECT sum(cost) FROM (
       SELECT * FROM shortest_path('
       SELECT objectid::int8 AS id,
          source::int4,
          target::int4,
          sweeptime::float8 AS cost
          FROM lionroute',
       55375,
       id,
       false,
       false)) AS foo ) AS cost
FROM lionroute_vertices_pgr;

From reading the forums I get the sense that one of my columns is not in the right format, but I can't for the life of me figure out which one ('id' is int8).

  • Thank you @dkastl you were right. The function I was looking for was pgr_dijkstra. I also needed to declare one of my columns as an integer for the function to work – ChrisHamby Dec 29 '14 at 21:12
3

You're using an outdated tutorial with the new pgRouting 2.0 release, I guess.

As the error states, it cannot find the function, because the function has been renamed. I recommend you to look at the pgRouting Workshop.

The pgRouting documentation also gives brief examples for every function.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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