[postgis-users] check distance between points in table

eehab hamzeh eehab40 at hotmail.com
Sun Oct 11 12:44:07 PDT 2009


Hello

 

I have two tables one its name try1 and the second are try11 i need to check if any point in try1 and any point in try11 are the same.

i wrote the following fucntion .... But i cant recive resutls

 

any directions 

 

-- Function: dis3d(geometry)

-- DROP FUNCTION dis3d(geometry);

CREATE OR REPLACE FUNCTION dis3d(point geometry)
  RETURNS boolean AS
$BODY$

DECLARE

r try1%rowtype;

BEGIN
for r in select r.the_geom from try1 loop
  -- TODO: use && and index 

perform the_geom FROM try1 WHERE 
 ST_Length3d(ST_MakeLine(the_geom, point)) = 0;
  
  IF  FOUND THEN
   insert into result(the_geom) select r.the_geom;
  ELSE
   EXIT;
  END IF;
 END LOOP;
 RETURN true;
END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE STRICT
  COST 100;
ALTER FUNCTION dis3d(geometry) OWNER TO postgres;

<---------

select dis3d(the_geom) from try11 

 

-----------------

 		 	   		  
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091011/0d68b5ac/attachment.html>


More information about the postgis-users mailing list