Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

   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
      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 (

share|improve this question
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 runassign_vertex_id successfully. What parameters did you use there? – dkastl Oct 12 '12 at 3:44

Your Answer


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

Browse other questions tagged or ask your own question.