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.

I try to using pgrouting to find route, first I'm using assign_vertex_id and when I calculate the shortest route, i didn't find the route in my pgAdmin data output, and in the messages :

"row number -1 is out of range 0..-1
Total query runtime: 15 ms.
0 rows retrieved."

the code:

SELECT * FROM shortest_path('
   SELECT gid AS id, 
          source::int4 AS source, 
          target::int4 AS target, 
          length::float8 AS cost 
   FROM jalan', 1,10, false,false);

and then i didn't use assign_vertex_id but there's an error, (i'm following step on), the code:

CREATE TABLE node AS 
   SELECT row_number()OVER (ORDER BY foo.p)::integer AS id, 
          foo.p AS the_geom
   FROM (         
      SELECT DISTINCT road_ext.startpoint AS p FROM road_ext
      UNION 
      SELECT DISTINCT road_ext.endpoint AS p FROM road_ext
   ) foo
   GROUP BY foo.p;

error: "ERROR: syntax error at or near "OVER"

i hope that someone can help me about problem, thanks (hesty.wul@gmail.com)

share|improve this question
2  
Have you looked at your network data in a GIS software like QGIS for example? You must have a valid topology, so if your network data didn't come with this you must run`assign_vertex_id` successfully. What parameters did you use there? –  dkastl Oct 12 '12 at 3:44

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.