Ticket #83 (closed bug report: fixed)

Opened 3 years ago

Last modified 3 years ago

error in executing shortest_path_astar2_as_geometry_internal_id_directed

Reported by: alucionet Owned by: anton
Priority: minor Milestone:
Component: A* Version: 1.0.0b
Keywords: Cc:

Description

Hi,

I've been trying to run the Shortest Path algo from the "Kanagawa" sample on my own server, but the result is as follows:

Warning: Error: msDrawMap(): Failed to draw layer named 'path'. in /usr/local/apache2/htdocs/routingj/phtmls/sp.backup.phtml on line 77

Warning: Error: msPOSTGISLayerWhichShapes(): Error executing POSTGIS SQL statement (in FETCH ALL): DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from (select gid, the_geom from shortest_path_astar2_as_geometry_internal_id('kanagawa', 76309, 124369, 139.038158611, 35.0904878914, 139.490447778, 35.4605426641)) as g WHERE the_geom && setSRID('BOX3D(139.038158611111 35.090487891414,139.490447777778 35.4605426641416)'::BOX3D, -1 ) -ERROR: operator does not exist: text boolean LINE 1: ...l( $8 ) ' , ' quote_literal( $9 ) ' , $10 '... HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. QUERY: SELECT $1 'FROM ' quote_ident( $2 ) ' where setSRID('BOX3D(' $3 ' ' $4 ',' $5 ' ' $6 ')'::BOX3D, ' $7 ') && the_geom, ' quote_literal( $8 ) ' , ' quote_literal( $9 ) ' , | in /usr/local/apache2/htdocs/routingj/phtmls/sp.backup.phtml on line 77

Fatal error: Call to a member function saveWebImage() on a non-object in /usr/local/apache2/htdocs/routingj/phtmls/sp.backup.phtml on line 78

Does anyone ever run into this problem? Anything anyone can offer to help?

Thanks, ned

Change History

Changed 3 years ago by alucionet

Additional data:

SQL error:

ERROR: operator does not exist: text boolean

LINE 1: ...l( $3 ) ' , ' quote_literal( $4 ) ' , $5 ...

HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.

QUERY: SELECT $1 'FROM ' quote_ident( $2 ) ' , ' quote_literal( $3 ) ' , ' quote_literal( $4 ) ' , $5 , $6 ), ' quote_ident( $2 ) ' where edge_id = gid ' CONTEXT: PL/pgSQL function "shortest_path_astar_as_geometry_internal_id_directed" line 20 at assignment PL/pgSQL function "shortest_path_astar_as_geometry_internal_id" line 9 at for over execute statement

In statement: SELECT * from shortest_path_astar_as_geometry_internal_id('SELECT id,the_geom FROM kanagawa', 76309, 124369);

Changed 3 years ago by anton

  • owner changed from somebody to anton
  • priority changed from major to minor
  • status changed from new to assigned

Please try to execute:

SELECT * from shortest_path_astar_as_geometry_internal_id('kanagawa', 76309, 124369);

instead of

SELECT * from shortest_path_astar_as_geometry_internal_id('SELECT id,the_geom FROM kanagawa', 76309, 124369);

Changed 3 years ago by alucionet

Same result when I just used 'kanagawa'.

I've managed to make it work temporarily by changing the code in shortest_path_astar2_as_geometry_internal_id_directed.

In the original code:

query := query 'FROM '

quote_ident(geom_table) ' where setSRID('BOX3D('ll_x' '

ll_y','ur_x' 'ur_y')'::BOX3D, ' srid

') && the_geom, ' quote_literal(sourceid) ' , '

quote_literal(targetid) ' , dir, rc ),'

quote_ident(geom_table) ' where edge_id = gid ';

My temporary solution:

query := query 'FROM '

quote_ident(geom_table) ' where setSRID('BOX3D('ll_x' '

ll_y','ur_x' 'ur_y')'::BOX3D, ' srid

') && the_geom, ' quote_literal(sourceid) ' , '

quote_literal(targetid) ' , false, false ),'

quote_ident(geom_table) ' where edge_id = gid ';

Difference is in the syntax for "dir" and "rc". I forced it to use "false" and it works (i'm sure "true" would also work). I am a newbie in postgis. I am not sure how the quote and double pipe system works but I suspect that the original code is only missing a couple of single quote in the original code.

any ideas?

Thanks

Changed 3 years ago by anton

  • status changed from assigned to closed
  • resolution set to fixed

OK, it seams like it started with PostgreSQL 8.2.5

Since this version it is not allowed to concatenate boolean and text.

Fixed with #47

Changed 3 years ago by alucionet

Sorry, I can't find ticket #47. Did you happen to mis-type it?

Thanks, I really appreciate all your help.

Changed 3 years ago by anton

Yeah, sorry. I meant [47].

Note: See TracTickets for help on using tickets.