<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE>.hmmessage P {
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
FONT-FAMILY: Verdana; FONT-SIZE: 10pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial>Do a join</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial>SELECT DISTINCT ON(try1.gid) try1.gid,
try1.the_geom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial>FROM try1 INNER JOIN try11 ON ST_Intersects(try1.the_geom,
try11.the_geom)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial>ORDER BY try1.gid</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial>Will give you all the points in try1 that are in
try11.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=695185020-11102009><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV><FONT color=#0000ff face=Arial></FONT><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>eehab
hamzeh<BR><B>Sent:</B> Sunday, October 11, 2009 3:44 PM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] check
distance between points in table<BR></FONT><BR></DIV>
<DIV></DIV>Hello<BR> <BR>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.<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><BR>
<HR>
Windows Live: Make it easier for your friends to see <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_2:092009"
target=_new>what you’re up to on Facebook.</A> </BODY></HTML>