[pgrouting-users] different SRIDs error

Anton Patrushev anton at orkney.co.jp
Wed Jul 22 21:01:40 EDT 2009


Hi Laura,

For me ST_buffer('POINT('||CAST($1 AS text)||' '||CAST($2 AS text)||')
', CAST($3 AS float)) looks suspicious.
Should it be ST_buffer(GeomFromText('POINT('||CAST($1 AS text)||'
'||CAST($2 AS text)||') ', 23030), CAST($3 AS float)) instead?

I think it is better to ask PostGIS guys in their mailing list.

Anton.

On Wed, Jul 22, 2009 at 9:54 PM, Laura Criscuolo<lauracris at hotmail.it> wrote:
> 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 chi vuoi tu.
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.postlbs.org
> http://lists.postlbs.org/mailman/listinfo/pgrouting-users
>
>




More information about the Pgrouting-users mailing list