[pgrouting-users] pgrouting with mapserver

I have copied the example from the default example given by pgrouting in its documentation. Actually, there is no such column as ‘source’ or ‘target’. I was under the impression that these are generic terms to be supplied to the query. Do they have to be columns? If that’s true, the query will have to have a table that has a ‘fromnode’ and ‘tonode’. I’m not quite sure. This is my first attempt at pgrouting. I’m still trying to understand its working. Please guide me with the basics a bit as the documentation for pgrouting isn’t particularly very good. Thanks!

I’m attaching a copy of the dBase file for the shapefile I’m trying to operate on… Please have a look. I just need to route from one point to another. There’s no source and target column though.

Edges1_line.dbf (395 KB)

Hi,

Yes, you need a source and target attribute because they provide the network topology information for the routing algorithm.
I recommend you to read the pgRouting workshop chapters starting from this one: http://workshop.pgrouting.org/chapters/topology.html

The name of the attribute (column) can have a different name in your table, but then you need to use “fromnode AS source” and “tonode AS target” alias, because the shortest path function requires the attribute names.
You can also create a table VIEW that contains the attribute names as they are required by the shortest path function.

Daniel

On Tue, Jun 12, 2012 at 2:17 PM, Annu Anurag <i.skidoosh@gmail.com> wrote:

I have copied the example from the default example given by pgrouting in its documentation. Actually, there is no such column as ‘source’ or ‘target’. I was under the impression that these are generic terms to be supplied to the query. Do they have to be columns? If that’s true, the query will have to have a table that has a ‘fromnode’ and ‘tonode’. I’m not quite sure. This is my first attempt at pgrouting. I’m still trying to understand its working. Please guide me with the basics a bit as the documentation for pgrouting isn’t particularly very good. Thanks!

I’m attaching a copy of the dBase file for the shapefile I’m trying to operate on… Please have a look. I just need to route from one point to another. There’s no source and target column though.


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