[pgrouting-dev] change geometry column name

I am using dijkstra_sp function on my table names roads
my table has the geometry column named geometry

When I execute this sql
SELECT the_geom FROM dijkstra_sp(‘roads’);

I am getting this error

ERROR: column “geometry” does not exist
Position: 47

but if I change my table roads geometry column to the_geom it works.

Is there anyway to do routing on table which has different geometry column other than the_geom

Rashad

On 1/14/2011 8:04 AM, Mohammed Rashad wrote:

I am using dijkstra_sp function on my table names roads
my table has the geometry column named geometry

When I execute this sql
SELECT the_geom FROM dijkstra_sp('roads');

I am getting this error
ERROR: column "geometry" does not exist
   Position: 47

but if I change my table roads geometry column to the_geom it works.

Is there anyway to do routing on table which has different geometry
column other than the_geom

Look at the plpgsql wrapper functions. You can probably just copy the one you need to something like my_dijkstra_sp and make changes as appropriate to your needs. I have done this many times. If you column name changes a lot, you could pass in the name of your geometry column and have the wrapper script change the queries to use that, like my_dijkstra_sp('roads', 'geometry').

-Steve