tsp (#20) - PgRouting? 1.0.0a cannont find GAUL (#101) - Message List

PgRouting? 1.0.0a cannont find GAUL

Dear forum, my aim is to use a bit older pgRouting-Version to use the function "shortest_path_astar2_as_geometry_internal_id" to visualize a route with MapServer. At the end I wan`t - for a moment - throw out all the other functions and data, just to understand better the way pgRouting works (Mainly the connection between C/C++ and plpgsql - I find it really difficult in the moment).

I work on Debian Etch. The problem is, if I do "configure" I get:

configure: checking for CGAL ... find: /usr/share/CGAL: No such file or directory find: /usr/make: No such file or directory configure: checking for GAUL ... configure: error: ** /usr/include/gaul or /usr/lib64/libgaul.a can not be found **

What I don`t understand. I have installed the debian etch -packages of CGAL and I have installed GAUL with ./configure --prefix=/usr/include/gaul.

What can be the reason for that??

  • Message #386

    I have got it, it was:

    ./configure --with-gaul=/usr/include/gaul

    But I wonder: For what are CGAL und GAUL used? Does pgRouting works with the algorithms of these libraries? I thought the algorithms are written separately?

    Thank you again, Kai

    • Message #387

      GAUL is used for the Traveling Salesperson implementation, CGAL is used for calculating the Driving Distance polygon.

      May I ask, why your aim is to use a bit older version of pgRouting? In general newer version are more stable and include bug fixes. So you might even want to try the SVN trunk version or at least the 1.0 release.

      • Message #392

        Hi Daniel, thank you again. Well, in the moment I find it so difficult to get the start, there are so many questions. But I think, nevertheless, I will start with a newer version (though an older version would have less code).

        The biggest question I have is: How can I visualize a route for example like shortest_path_astar in MapServer:

        SELECT * FROM shortest_path_astar('SELECT gid AS id, source::int4,

        target::int4, length::double precision AS cost, x1, y1, x2, y2

        FROM dourol',3, 7, false, false);

        ...gives me vertex_id, edge_id and cost. But how can I get to "the_geom" that I need to visualize it in MapServer???

        • Message #398

          To the question how to visualize the routes:

          In MapServer it works like: DATA "the_geom from (SELECT gid, the_geom FROM astar_sp_delta('fridastreets', 5846, 4504, 3000)) as foo using unique gid using srid=-1"

          Of course its possible to write an own function with Pg/pgsql. I did like:

          CREATE OR REPLACE function give_me_geom(varchar,int,int) RETURNS SETOF GEOMS AS $$ DECLARE table_name ALIAS FOR $1; source_id ALIAS FOR $2; target_id ALIAS FOR $3; id int; edge_id int; query text; pg_query record; r record; geom geoms;

          BEGIN id:=0; edge_id:=0;

          query := 'SELECT * FROM '

          'shortest_path_astar(SELECT gid as id, source::integer, ' 'target::integer, length::double precision as cost, ' 'x1::double precision, y1::double precision, x2::double ' 'precision, y2::double precision '

          'FROM '

          quote_ident(table_name),'source_id','target_id',false,false)';

          FOR pg_query IN EXECUTE query LOOP

          edge_id:=pg_query.edge_id;

          FOR r IN EXECUTE 'SELECT gid,the_geom FROM '

          quote_ident(table_name) ' WHERE gid ='edge_id LOOP

          geom.gid := r.gid;

          geom.the_geom := r.the_geom;

          id := id+1;

          geom.id := id;

          RETURN NEXT geom;

          END LOOP;

          END LOOP;

          RETURN;

          END; $$ LANGUAGE 'plpgsql';

          .....and then DATA "the_geom from (SELECT gid, the_geom FROM give_me_geom('fridastreets', 5846, 4504) as foo using unique gid using srid=-1"