[postgis-users] FW: if two points intersect in 3d

eehab hamzeh eehab40 at hotmail.com
Sun Oct 11 14:42:36 PDT 2009






Thanks for your replay, 
 
I need to check the intersection using lengith3d since the points are in 3D space. so i need to know exactly if they are really intersect.
 
can you please help me to develop the query below to give me the result
 
 
SELECT a,b from try1 as a, try11 as b WHERE  ST_Length3d(ST_MakeLine(a.the_geom, b.the_geom)) = 0;

 
Kind regards
ihab
 
Do a  join

SELECT DISTINCT ON(try1.gid)  try1.gid, try1.the_geom
FROM try1 INNER JOIN try11 ON ST_Intersects(try1.the_geom, try11.the_geom)
ORDER BY try1.gid

Will give you all the points in try1 that are in try11.




  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of eehab
hamzeh
Sent: Sunday, October 11, 2009 3:44 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] check distance between points in table


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 





Keep your friends updated— even when you’re not signed in. 		 	   		  
_________________________________________________________________
Keep your friends updated—even when you’re not signed in.
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_5:092010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091011/f115b577/attachment.html>


More information about the postgis-users mailing list