Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.
insert into dijsktra_results(geom) select ST_UNION(the_geom) from dijkstra_sp('roads_layer',
            (select source_id from roads_layer where gid=9975)::integer,
            (select target_id from roads_layer where gid=2967)::integer);

This query to perform the routing operations. "dijsktra_results" is a newely created table for routing operations with gid and geom columns of 2D(MultiLineString). This is the error I am getting

ERROR:  column "the_geom" does not exist
LINE 1: SELECT gid,the_geom FROM shortest_path('SELECT gid as id, so...
                   ^
QUERY:  SELECT gid,the_geom FROM shortest_path('SELECT gid as id, source::integer, target::integer, length::double precision as cost FROM roads_layer', '1' , '20142' , false, false), roads_layer where edge_id = gid 
CONTEXT:  PL/pgSQL function "dijkstra_sp" line 13 at FOR over EXECUTE statement

********** Error **********

ERROR: column "the_geom" does not exist
SQL state: 42703
Context: PL/pgSQL function "dijkstra_sp" line 13 at FOR over EXECUTE statement

Can anyone resolve this problem or guide for an extent am I gone wrong anywhere.Till now everything worked fine.I calculated vertex_id,edge_id,length.... And how this, dijkstra_sp() function works and calculates the shortest path.

share|improve this question
    
Hi, I think it would be best to split your questions. One for help resolving this error and another for the djikstra_sp() explanation. That way, it would be easier for people to vote on the answers and to answer your question, too. –  R.K. Nov 26 '12 at 8:57
    
Thanks a lot for editing,I am new to this site –  SriRamaChandra.G Nov 26 '12 at 9:01
    
You're welcome :) –  R.K. Nov 26 '12 at 9:02

1 Answer 1

up vote 1 down vote accepted

I added table alias sp and r

SELECT r.gid, r.the_geom FROM shortest_path('SELECT gid as id, source::integer, target::integer, length::double precision as cost FROM roads_layer', '1' , '20142' , false, false) as sp , roads_layer as r WHERE sp.edge_id = r.gid

so r.the_geom dosent exists, is it possible that your geometry colum name is geog/geom and not the_geom ?

share|improve this answer
    
thanks a lot.It helped me somewhat. –  SriRamaChandra.G Nov 28 '12 at 10:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.