[postgis-users] check distance between points in table
Paragon Corporation
lr at pcorp.us
Sun Oct 11 13:59:56 PDT 2009
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
-----------------
_____
Windows Live: Make it easier for your friends to see what you
<http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/so
cial-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009
> 're up to on Facebook.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091011/1207fc5b/attachment.html>
More information about the postgis-users
mailing list