If all your data is in the database, then you can so queries within your shortest path query.

Look at this workshop example:

SELECT * FROM shortest_path(’

SELECT gid as id,

source::integer,

target::integer,

length::double precision as cost

FROM ways’,

5700, 6733, false, false);

http://workshop.pgrouting.org/chapters/shortest_path.html#core

You can replace start and end point with a query, which is in my example from the same table. But you can modify such a select however you like:

SELECT * FROM shortest_path(’

SELECT gid as id,

source::integer,

target::integer,

length::double precision as cost

FROM ways’,

(SELECT min(source)::int FROM ways), (SELECT max(source)::int FROM ways), false, false);

Does this help?

Daniel

On Wed, Oct 12, 2011 at 4:21 PM, dy32 mutQ <dmutq@yahoo.com> wrote:

hello all,

I have a question, how can I get the shortest path with dijkstra algorithm on a map but additionally have another layer or points of interest files from the map.

I set up pgrouting from http://www.utdallas.edu/~ama054000/rt_tutorial.html

for example: I have two layers, hotel (points) and road (polylines)

From hotel A (start point) to hotel B (end point) I can get road 2,3,4

there is any way to integrate these two files (point and line) into one so that for the calculations. In other words, how can I connect two tables, road and hotel to get dijkstra result?

Thanks for your answers

Pgrouting-users mailing list

Pgrouting-users@lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/pgrouting-users

–

Georepublic UG & Georepublic Japan

eMail: daniel.kastl@georepublic.de

Web: http://georepublic.de