[postgis-users] Path finding

Luis Mota luis.mota at iscte.pt
Sun Jun 30 12:58:51 PDT 2002


Hi everyone.

I have to deal with a path finding problem.  The underlying data is 
stored in postgis. It is a collection of LineStrings.

Since I have a AI backgound, I based the search on a classic A* search 
algorithm, that is able to find the optimal path (even if this is not 
vital to me). I programmed the algoritjm in Java and I access the DB 
each time I have to know the lines that start at a given point.

This process is computationally very demanding... Because of this, the 
algorithm takes a very long time to find any kind of path.

I think that the problem is that I am permanently querying the DB 
through JDBC.... This must take a lot of time, I suppose.

Now I've been thinking that the best way to do this would be to make a 
search algorithm directly in the DB. This way, the only thing I would 
have to return through odbc would be the final answer and not thousands 
of LineStrings.

Before moving forward to this, I would like to know if someone has any 
experience/thoughts/hints about this. Maybe someone has already 
implemented such a function...

Anyway, I'd like to know if you think that this is possible at all, or 
what would be the easier way to tackle this problem...

Bye for now, Luís Mota





More information about the postgis-users mailing list