dijkstra (#16) - Doubts and sugestions (#128) - Message List
Hi! Congratulations for this fantastic set of routing tools!
- Doubts and suggestions:
- (1) I think there is an error on the tutorial concerning the use of assign_vertex_id() function. It uses 4 instead of 2 arguments;
- (2) How about indexes use in this function;
- (3) And last I found this error in the same method when using the default (-1) SRID value:
ERROR: new row for relation "vertices_tmp" violates check constraint "enforce_srid_the_geom" CONTEXT: SQL statement "INSERT INTO vertices_tmp (the_geom) VALUES ( $1 )" PL/pgSQL function "point_to_id" line 13 at SQL statement PL/pgSQL function "assign_vertex_id_new" line 23 at assignment NOTICE: CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column "vertices_tmp.id" CONTEXT: SQL statement "CREATE TABLE vertices_tmp ( id serial )" PL/pgSQL function "assign_vertex_id_new" line 13 at SQL statement
Which I fixed conserving the same SRID as the input theme:
CREATE OR REPLACE FUNCTION "public"."assign_vertexes" (geom_table varchar, tolerance double precision, srid integer) RETURNS "pg_catalog"."void" AS $body$ DECLARE
points record; source_id int; target_id int;
BEGIN
BEGIN
DROP TABLE vertices_tmp;
EXCEPTION
WHEN UNDEFINED_TABLE THEN
END;
CREATE TABLE vertices_tmp (id SERIAL);
EXECUTE 'SELECT addGeometryColumn(vertices_tmp, the_geom, '
quote_literal(srid) ', POINT, 2) '; . . .
Best regards ::kamo
kamo04/17/08 13:07:49 (3 years ago)
Message #460Thank you!
Yes, the documentation is a little bit outdated, sorry. It is funny, but assign_vertex_id is the function with biggest number of contributions grom the community. Your improvement also makes sense, so I will add it to the function.
anton04/17/08 15:57:57 (3 years ago)
Powered by Trac 0.11.5rc1
By Edgewall Software.pgRouting is a project of PostLBS
http://www.postlbs.org/