I am trying to get work the next function but i don't know if it is incomplete because the query SELECT * FROM pgr_nearest_node1('jaen',-3.75,37.779);
does not provide any results.
Here is the function:(from pgr_fromAtoB):
CREATE OR REPLACE FUNCTION pgr_nearest_node1(IN tbl character varying, IN x1 double precision, IN y1 double precision, OUT id integer, OUT geom geometry)
RETURNS SETOF record AS
$BODY$
DECLARE
rec record;
BEGIN
-- Find nearest node
EXECUTE 'SELECT id::integer, the_geom FROM jaen_vertices_pgr
ORDER BY the_geom <-> ST_GeometryFromText(''POINT('
|| x1 || ' ' || y1 || ')'',4326) LIMIT 3' INTO rec;
-- Return record
id := rec.id;
geom := rec.the_geom;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE STRICT;