[pgrouting-users] Regarding pgrouting and postgis for shortest path

Stephen Woodbridge woodbri at swoodbridge.com
Thu Jan 16 10:21:50 PST 2014


On 1/16/2014 12:46 PM, Raghavan Krishnasamylakshmanaperumal wrote:
> Recently I started using PostGIS for my academic project which is a
> route recommendation system. I have stored the data in the following format.
> /
> /
> /gid=>integer, activity=>varchar(20), geom geometry(Point,4326)/
>
> geometry points are longitude and latitude information, for example if
> you record your Running activity using a gps device, each point record
> (longitude & latitude) is stored in the geom column.

The shortest distance between two points is a straight line unless you 
want to constrain the problem to the shortest distance along some road 
or path network.

If it is constrained to a networks of paths then you have to have the 
data for that network available.

In the case of pgRouting, you have to load the network data and prepare 
it for routing, then you can use you points as the start and end points 
of a route and ask pgRouting to fins the shortest path between them 
along the network.

> I need to find the shortest path(using Dijkistra's) between any two geom
> points from this data set and I am trying to automate this using some
> programming language like Java.

With Java you can connect to the database and issue simple queries to 
pgRouting to get your results. If you are looking for a Java library to 
solve Dijkstra problems then this is not pgRouting. Also if you are 
using a Java library you will still need to load the network of paths 
that you want to solve you queries against.

Hope this helps,
   -Steve

> Please can you suggest me how to make use of pgrouting and postgis data
> to figure out the shortest path. Is there any library available to
> automate this using Java. I am totally stuck on my project and finally
> came to know about this mailing list.
>
>
> --
> Thanks and Regards,
> Raghavan KL
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>



More information about the Pgrouting-users mailing list