[postgis-devel] if two points intersect in 3d

Paragon Corporation lr at pcorp.us
Sun Oct 11 18:52:19 PDT 2009


Ihab,
 
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()
 
http://www.postgis.org/documentation/manual-svn/ST_Z.html
 
So
 
SELECT DISTINCT ON(try1.gid)  try1.gid, try1.the_geom
FROM try1 INNER JOIN try11 ON ( ST_Intersects(try1.the_geom, try11.the_geom)
AND ST_Z(try1.the_geom) = ST_Z(try11.the_geom) )
ORDER BY try1.gid
 
Hope that helps,
Regina

  _____  

From: eehab hamzeh [mailto:eehab40 at hotmail.com] 
Sent: Sunday, October 11, 2009 5:36 PM
To: lr at pcorp.us
Subject: if two points intersect in 3d


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
<http://postgis.refractions.net/mailman/listinfo/postgis-users> at
postgis.refractions.net
[mailto:postgis-users-bounces
<http://postgis.refractions.net/mailman/listinfo/postgis-users> at
postgis.refractions.net] On Behalf Of eehab
hamzeh
Sent: Sunday, October 11, 2009 3:44 PM
To: postgis-users
<http://postgis.refractions.net/mailman/listinfo/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
<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_5:092010
> 're not signed in. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20091011/bd05cda0/attachment.html>


More information about the postgis-devel mailing list