[postgis-users] Calculate driving distance in postgis

strk at refractions.net strk at refractions.net
Fri Feb 3 02:03:21 PST 2006


On Thu, Feb 02, 2006 at 09:58:39AM +0100, Arnaud Lesauvage wrote:
> K Kuo a écrit :
> >I have a database which convert from tiger/line data. I have found that I 
> >can use distance_spheroid function to calculate distance between two 
> >points, which supposes to be the shortest distance instead of driving 
> >distance, am I correct? What I am thinking about is that I have to query 
> >out all nodes alone the route, calculate distances for each segment then 
> >add them up. I don't think this is a good approach. Any suggestion?
> 
> Hi !
> 
> I have successfully installed and used pgdijkstra, which is a 
> PostgreSQL implementation of the Dijkstra algorithm (widely used 
> for shortest path calculations).
> http://www.cartoweb.org/contribs.html
> It is very easy to install and fairly easy to use.
> This module includes special PostGIS functions that can return the 
> shortest path between two nodes as a PostGIS geometry (a 
> LINESTRING, I believe).
> You would just need to get the Length() of this geometry to have 
> the exact driving distance between the nodes.

It would be interesting to port the cartoweb code to use 
the postgis topology model. Not something I'll be doing in the
short term, but a suggestion for whoever wants to contribute :)

--strk;



More information about the postgis-users mailing list