Showing posts with label postgres path postgis. Show all posts
Showing posts with label postgres path postgis. Show all posts

Monday, February 19, 2007

Find shortest distance path postgis postgres linedata

You could consider using pgRouting (http://www.postlbs.org/) .

This extension to Postgres/PostGIS needs some topology and topology support for PostGIS is still in its infancy and barely documented… L



Now to implement ‘topology’ the *easy* way… ;-)

Use OpenJump! (http://openjump.org)

There’s a tool there called ‘Planar Graph’…

You can use it to get every line segment documented (start and end nodes for each line).

Add a ‘length’ field to your dataset.

OpenJump also has a tool to calculate areas and lengths… ;-)



Save your dataset from OpenJump into PostGIS.

The ‘length’ field acts as an initial cost for turning….



Then use the shortest_path() function from pgRouting and you’re on your way!



Also heard from the developers of pgRouting that support for turn restrictions is somewhere in the near future… ;-)



(OJ PeopleĆ  I’m posting this to the list as I think it’s useful ;-) )



HTH,

Pedro Doria Meunier