<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>.hmmessage P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-SIZE: 10pt; FONT-FAMILY: Verdana
}
</STYLE>

<META content="MSHTML 6.00.6001.18294" name=GENERATOR></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009>Ihab,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009>You don't need to use Makeline to determine they are 
the same.  In fact I thin that may crash.  Just use ST_Intersects 
and ST_Z()</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009><A 
href="http://www.postgis.org/documentation/manual-svn/ST_Z.html">http://www.postgis.org/documentation/manual-svn/ST_Z.html</A></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009>So</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff><SPAN 
class=850454701-12102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT><SPAN class=850454701-12102009>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT face=Arial 
color=#0000ff>SELECT DISTINCT ON(try1.gid)  try1.gid, 
try1.the_geom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT face=Arial><FONT 
color=#0000ff>FROM try1 INNER JOIN try11 ON <SPAN 
class=850454701-12102009>( </SPAN>ST_Intersects(try1.the_geom, 
try11.the_geom)<SPAN class=850454701-12102009> AND ST_Z(try1.the_geom) = 
ST_Z(try11.the_geom) )</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT face=Arial><FONT 
color=#0000ff>ORDER BY try1.gid</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT face=Arial 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><SPAN 
class=850454701-12102009><FONT face=Arial color=#0000ff>Hope that 
helps,</FONT></SPAN></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><SPAN 
class=850454701-12102009><FONT face=Arial 
color=#0000ff>Regina</FONT></SPAN></SPAN></DIV></SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> eehab hamzeh [mailto:eehab40@hotmail.com] 
<BR><B>Sent:</B> Sunday, October 11, 2009 5:36 PM<BR><B>To:</B> 
lr@pcorp.us<BR><B>Subject:</B> if two points intersect in 
3d<BR></FONT><BR></DIV>
<DIV></DIV>Thanks for your replay, <BR> <BR>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.<BR> <BR>can you please help me to 
develop the query below to give me the result<BR> <BR> <BR>SELECT a,b 
from try1 as a, try11 as b WHERE  ST_Length3d(ST_MakeLine(a.the_geom, 
b.the_geom)) = 0;<BR><BR> <BR>Kind regards<BR>ihab<BR> <BR>Do a  
join<BR><BR>SELECT DISTINCT ON(try1.gid)  try1.gid, try1.the_geom<BR>FROM 
try1 INNER JOIN try11 ON ST_Intersects(try1.the_geom, try11.the_geom)<BR>ORDER 
BY try1.gid<BR><BR>Will give you all the points in try1 that are in 
try11.<BR><BR><BR><BR><BR>  _____  <BR><BR>From: <A 
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">postgis-users-bounces 
at postgis.refractions.net</A><BR>[mailto:<A 
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">postgis-users-bounces 
at postgis.refractions.net</A>] On Behalf Of eehab<BR>hamzeh<BR>Sent: Sunday, 
October 11, 2009 3:44 PM<BR>To: <A 
href="http://postgis.refractions.net/mailman/listinfo/postgis-users">postgis-users 
at postgis.refractions.net</A><BR>Subject: [postgis-users] check distance 
between points in table<BR><BR><BR>Hello<BR><BR>I have two tables one its name 
try1 and the second are try11 i need to check<BR>if any point in try1 and any 
point in try11 are the same.<BR>i wrote the following fucntion .... But i cant 
recive resutls<BR><BR>any directions <BR><BR>-- Function: dis3d(geometry)<BR>-- 
DROP FUNCTION dis3d(geometry);<BR>CREATE OR REPLACE FUNCTION dis3d(point 
geometry)<BR>  RETURNS boolean AS<BR>$BODY$<BR>DECLARE<BR>r 
try1%rowtype;<BR>BEGIN<BR>for r in select r.the_geom from try1 loop<BR>  -- 
TODO: use && and index <BR>perform the_geom FROM try1 WHERE 
<BR>ST_Length3d(ST_MakeLine(the_geom, point)) = 0;<BR>  <BR>  IF  
FOUND THEN<BR>   insert into result(the_geom) select 
r.the_geom;<BR>  ELSE<BR>   EXIT;<BR>  END IF;<BR>END 
LOOP;<BR>RETURN true;<BR>END;<BR>$BODY$<BR>  LANGUAGE 'plpgsql' VOLATILE 
STRICT<BR>  COST 100;<BR>ALTER FUNCTION dis3d(geometry) OWNER TO 
postgres;<BR><---------<BR>select dis3d(the_geom) from 
try11 <BR><BR><BR><BR>
<HR>
Keep your friends updated— <A 
href="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" 
target=_new>even when you’re not signed in.</A> </BODY></HTML>