[pgrouting-users] different SRIDs error
Laura Criscuolo
lauracris at hotmail.it
Wed Jul 22 08:54:21 EDT 2009
Hi,
I created this find_closest_vertex function:
CREATE OR REPLACE FUNCTION find_closest_vertex(“x” double precision, “y” double precision, “distance” float)
RETURNS integer AS
$BODY$
SELECT vertices_tmp.id AS vertices_id
FROM vertices_tmp
WHERE ST_Within
(GeomFromText
('POINT('||CAST($1 AS text)||' '||CAST($2 AS text)||')', 23030),
ST_buffer
('POINT('||CAST($1 AS text)||' '||CAST($2 AS text)||') ', CAST($3 AS float))
)
= 't'
ORDER BY distance
(GeomFromText
('POINT('||CAST($1 AS text)||' '||CAST($2 AS text)||')', 23030),
vertices_tmp.the_geom
ASC
LIMIT 1
$BODY$
LANGUAGE 'sql' VOLATILE
COST 100;
ALTER FUNCTION find_closest_vertex(double precision, double precision, double precision) OWNER TO postgres;
but the query:
SELECT * FROM find_closest_vertex(8.44215190, 45.8838484, 0.0001);
returns this error:
ERROR: Operation on two GEOMETRIES with different SRIDs
CONTEXT: SQL function "find_closest_vertex" statement 1
The spatial reference of the vertices_tmp table is EPGS:23030 (ED50 / UTM zone 30N) of course, and I don't know how to solve the problem..
What advice can you give me?
Thanks
Laura
_________________________________________________________________
Condividi i tuoi ricordi online con chi vuoi tu.
http://www.microsoft.com/italy/windows/windowslive/products/photos-share.aspx?tab=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20090722/4f6a4bfd/attachment.html
More information about the Pgrouting-users
mailing list