<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19328"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=906331810-30102012><FONT size=2>Maybe ST_X, 
ST_Y and ST_Z ?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=906331810-30102012><FONT 
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=906331810-30102012><FONT 
size=2>Hugues.</FONT></SPAN></DIV>
<DIV> </DIV><BR>
<DIV dir=ltr lang=fr class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>De :</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>De la part de</B> Ed 
Linde<BR><B>Envoyé :</B> mardi 30 octobre 2012 11:14<BR><B>À :</B> 
PostGIS Users Discussion<BR><B>Objet :</B> Re: [postgis-users] Problem with 
3D polygon intersection test<BR></FONT><BR></DIV>
<DIV></DIV>Hi Nicolas,<BR>Not quite sure what to make of the output from 
ST_DumpPoints, how do I transform it to just raw x,y,z 
coordinates?<BR><BR> select st_astext(geomtext) from small_tris where 
id=0;<BR>                       
st_astext                       
<BR>-------------------------------------------------------<BR> POLYGON Z 
((10 10 805,20 10 809,10 20 814,10 10 805))<BR>(1 row)<BR><BR>bounds=#  
select id, st_dumpPoints( geomtext ) from small_tris where id=0;<BR> id 
|                            
st_dumppoints                             
<BR>----+----------------------------------------------------------------------<BR>  
0 | 
("{1,1}",0101000080000000000000244000000000000024400000000000288940)<BR>  0 
| ("{1,2}",0101000080000000000000344000000000000024400000000000488940)<BR>  
0 | 
("{1,3}",0101000080000000000000244000000000000034400000000000708940)<BR>  0 
| ("{1,4}",0101000080000000000000244000000000000024400000000000288940)<BR>(4 
rows)<BR><BR><BR>Thanks,Ed<BR><BR><BR>
<DIV class=gmail_quote>On Tue, Oct 30, 2012 at 11:05 AM, Ed Linde <SPAN 
dir=ltr><<A href="mailto:edolinde@gmail.com" 
target=_blank>edolinde@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
class=gmail_quote>Ok thanks!
  <DIV class=HOEnZb>
  <DIV class=h5><BR><BR>
  <DIV class=gmail_quote>On Tue, Oct 30, 2012 at 11:04 AM, Nicolas Ribot <SPAN 
  dir=ltr><<A href="mailto:nicolas.ribot@gmail.com" 
  target=_blank>nicolas.ribot@gmail.com</A>></SPAN> wrote:<BR>
  <BLOCKQUOTE 
  style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
  class=gmail_quote>st_dumpRings will return the rings (closed linestrings) 
    composing the polygon (exterior first, then interiors)
    <DIV>and st_dumpPoints will return all the points forming the rings, in the 
    right order.</DIV><SPAN><FONT color=#888888>
    <DIV><BR></DIV></FONT></SPAN>
    <DIV><SPAN><FONT color=#888888>Nicolas</FONT></SPAN>
    <DIV>
    <DIV><BR><BR>
    <DIV class=gmail_quote>On 30 October 2012 10:56, Ed Linde <SPAN 
    dir=ltr><<A href="mailto:edolinde@gmail.com" 
    target=_blank>edolinde@gmail.com</A>></SPAN> wrote:<BR>
    <BLOCKQUOTE 
    style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
    class=gmail_quote>Ok, for a polygon, is there a good postgis function that 
      can return the edges to me in the <BR>right sequence? Or at least the 
      points that constitute the polygon in the right order, so I 
      can<BR>generate the edges in a script?<BR><BR>Thanks,<BR>Ed
      <DIV>
      <DIV><BR><BR>
      <DIV class=gmail_quote>On Tue, Oct 30, 2012 at 10:46 AM, Ed Linde <SPAN 
      dir=ltr><<A href="mailto:edolinde@gmail.com" 
      target=_blank>edolinde@gmail.com</A>></SPAN> wrote:<BR>
      <BLOCKQUOTE 
      style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
      class=gmail_quote>Ah drat! Ok then I have to basically do edge 
        intersection tests by myself. 
        <DIV>Ah well. bad news! :(
        <DIV>
        <DIV><BR><BR>
        <DIV class=gmail_quote>On Tue, Oct 30, 2012 at 10:44 AM, Nicolas Ribot 
        <SPAN dir=ltr><<A href="mailto:nicolas.ribot@gmail.com" 
        target=_blank>nicolas.ribot@gmail.com</A>></SPAN> wrote:<BR>
        <BLOCKQUOTE 
        style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
        class=gmail_quote>Hi,
          <DIV><BR></DIV>
          <DIV>st_intersection is only suitable for 2D operations. Third 
          dimension is not taken into account.</DIV>
          <DIV><BR></DIV>
          <DIV>Nicolas </DIV>
          <DIV><BR>
          <DIV class=gmail_quote>
          <DIV>
          <DIV>On 30 October 2012 09:44, Ed Linde <SPAN dir=ltr><<A 
          href="mailto:edolinde@gmail.com" 
          target=_blank>edolinde@gmail.com</A>></SPAN> wrote:<BR></DIV></DIV>
          <BLOCKQUOTE 
          style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
          class=gmail_quote>
            <DIV>
            <DIV>Hi All,<BR>Is there a simpler test I can do? I am quite sure 
            that I am probably not using the right <BR>function in my SQL, or 
            not doing the intersection test correctly. Is there any simpler 
            <BR>way to test this 3D intersection? Am waiting on the postgis 
            gurus to come along and<BR>give me some ideas, coz I am at my wits 
            ends on this one! :) The polygons look good<BR>to me when I 
            visualize them, but don't get how all triangles are found as 
            intersecting?<BR>Anyway will wait.<BR><BR>Cheers,<BR>Ed<BR><BR>
            <DIV class=gmail_quote>On Tue, Oct 30, 2012 at 9:00 AM, Ed Linde 
            <SPAN dir=ltr><<A href="mailto:edolinde@gmail.com" 
            target=_blank>edolinde@gmail.com</A>></SPAN> wrote:<BR>
            <BLOCKQUOTE 
            style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
            class=gmail_quote>Hi All,<BR>I am having some troubles getting the 
              <B>ST_Intersect</B> function to work with 3D polygons. <BR>I have 
              a table to hold triangles as polygons in 
              <B>"small_tris"</B><BR>Another table for holding the polygonal 
              faces of a 3D voronoi diagram in <B>"vfaces"</B><BR>So now I am 
              trying to do an intersection between the triangles and the voronoi 
              faces<BR>to get the triangles that intersect with the faces. And 
              it seems that *ALL* triangles <BR>are intersecting. I have 
              attached a PDF where I have plotted the triangles and the 
              <BR>voronoi cells. so the box around in red and blue with a major 
              face going through is <BR>the voronoi diagram. The Voronoi 
              partition in 3D is shown at the bottom too for clarity<BR>Can 
              someone please help and let me know what am I doing wrong 
              here?<BR>Is the select assuming something? So the polygons are 
              flat and the intersections <BR>should just be lines or points. I 
              am under some pressure to get this to work, so if<BR>anyone needs 
              more information to help, the please let me know! :)  
              <BR><BR>Cheers,<BR>Ed<BR><BR><B>-- TABLE SCHEMAS</B><BR>bounds=# 
              \d vfaces;<BR>      Table 
              "public.vfaces"<BR>  Column  |   
              Type   | Modifiers 
              <BR>----------+----------+-----------<BR> gen_id   
              | integer  | <BR> geomtext | geometry | <BR><BR>bounds=# 
              \d small_tris;<BR>    Table 
              "public.small_tris"<BR>  Column  |   
              Type   | Modifiers 
              <BR>----------+----------+-----------<BR> id       
              | integer  | not 
              null<BR> v0       | 
              integer  | <BR> v1       | 
              integer  | <BR> v2       | 
              integer  | <BR> geomtext | geometry | 
              <BR>Indexes:<BR>    "small_tris_pkey" PRIMARY KEY, 
              btree (id)<BR>    "small_idx" gist 
              (geomtext)<BR><BR><BR><B><BR>-- TABLE CONTENT</B><BR>bounds=# 
              select id, st_astext( geomtext ) from small_tris;<BR> id 
              |                       
              st_astext                       
              <BR>----+-------------------------------------------------------<BR>  
              0 | POLYGON Z ((10 10 805,20 10 809,10 20 814,10 10 
              805))<BR>  1 | POLYGON Z ((10 20 814,20 10 809,20 20 819,10 
              20 814))<BR>  2 | POLYGON Z ((20 20 819,30 10 809,30 20 
              812,20 20 819))<BR>  3 | POLYGON Z ((30 10 809,20 20 819,20 
              10 809,30 10 809))<BR>  4 | POLYGON Z ((30 20 812,30 10 
              809,40 10 826,30 20 812))<BR>  5 | POLYGON Z ((20 20 819,30 
              20 812,20 30 827,20 20 819))<BR>  6 | POLYGON Z ((10 20 
              814,20 20 819,20 30 827,10 20 814))<BR>  7 | POLYGON Z ((10 
              40 805,10 30 814,20 30 827,10 40 805))<BR>  8 | POLYGON Z 
              ((10 50 804,10 40 805,20 40 807,10 50 804))<BR>  9 | POLYGON 
              Z ((20 30 827,20 40 807,10 40 805,20 30 827))<BR> 10 | 
              POLYGON Z ((30 30 817,20 40 807,20 30 827,30 30 817))<BR> 11 
              | POLYGON Z ((30 40 816,20 50 809,20 40 807,30 40 
              816))<BR> 12 | POLYGON Z ((20 40 807,20 50 809,10 50 804,20 
              40 807))<BR> 13 | POLYGON Z ((10 30 814,10 20 814,20 30 
              827,10 30 814))<BR> 14 | POLYGON Z ((30 30 817,20 30 827,30 
              20 812,30 30 817))<BR> 15 | POLYGON Z ((30 20 812,40 20 
              823,30 30 817,30 20 812))<BR> 16 | POLYGON Z ((40 20 823,30 
              20 812,40 10 826,40 20 823))<BR> 17 | POLYGON Z ((40 20 
              823,40 10 826,50 10 803,40 20 823))<BR> 18 | POLYGON Z ((30 
              30 817,40 20 823,40 30 814,30 30 817))<BR> 19 | POLYGON Z 
              ((40 20 823,50 20 808,40 30 814,40 20 823))<BR> 20 | POLYGON 
              Z ((50 20 808,40 20 823,50 10 803,50 20 808))<BR> 21 | 
              POLYGON Z ((40 30 814,50 20 808,50 30 816,40 30 814))<BR> 22 
              | POLYGON Z ((30 30 817,40 30 814,40 40 800,30 30 
              817))<BR> 23 | POLYGON Z ((30 40 816,40 40 800,30 50 813,30 
              40 816))<BR> 24 | POLYGON Z ((30 40 816,30 30 817,40 40 
              800,30 40 816))<BR> 25 | POLYGON Z ((30 50 813,40 40 800,40 
              50 817,30 50 813))<BR> 26 | POLYGON Z ((30 40 816,30 50 
              813,20 50 809,30 40 816))<BR> 27 | POLYGON Z ((50 40 821,40 
              50 817,40 40 800,50 40 821))<BR> 28 | POLYGON Z ((50 50 
              809,40 50 817,50 40 821,50 50 809))<BR> 29 | POLYGON Z ((50 
              40 821,40 40 800,50 30 816,50 40 821))<BR> 30 | POLYGON Z 
              ((40 30 814,50 30 816,40 40 800,40 30 814))<BR> 31 | POLYGON 
              Z ((30 30 817,30 40 816,20 40 807,30 30 817))<BR>(32 
              rows)<BR><BR> select st_astext(geomtext) from 
              vfaces;<BR>                                           
              st_astext                                           
              <BR>-----------------------------------------------------------------------------------------------<BR> POLYGON 
              Z ((51 17.8 799,9 38.8 799,9 51 819.33333333333,19.4 51 828,51 
              35.2 828,51 17.8 799))<BR> POLYGON Z ((51 17.8 799,9 38.8 
              799,9 51 799,51 51 799,51 17.8 799))<BR> POLYGON Z ((51 35.2 
              828,19.4 51 828,51 51 828,51 35.2 828))<BR> POLYGON Z ((9 9 
              799,9 38.8 799,51 17.8 799,51 9 799,9 9 799))<BR> POLYGON Z 
              ((51 17.8 799,9 38.8 799,9 51 819.33333333333,19.4 51 828,51 35.2 
              828,51 17.8 799))<BR> POLYGON Z ((9 9 828,9 51 828,19.4 51 
              828,51 35.2 828,51 9 828,9 9 828))<BR>(6 rows)<BR><BR><B 
              style="COLOR: rgb(51,102,255)">select distinct <A 
              href="http://a.id" target=_blank>a.id</A><BR>from small_tris a, 
              vfaces b<BR>where st_intersects (a.geomtext, b.geomtext)<BR>order 
              by <A href="http://a.id" target=_blank>a.id</A>;</B><BR> id 
              <BR>----<BR>  0<BR>  1<BR>  2<BR>  3<BR>  
              4<BR>  5<BR>  6<BR>  7<BR>  8<BR>  
              9<BR> 10<BR> 11<BR> 12<BR> 13<BR> 14<BR> 15<BR> 16<BR> 17<BR> 18<BR> 19<BR> 20<BR> 21<BR> 22<BR> 23<BR> 24<BR> 25<BR> 26<BR> 27<BR> 28<BR> 29<BR> 30<BR> 31<BR>(32 
              rows)<BR><BR><IMG alt="" 
            src=""><BR></BLOCKQUOTE></DIV><BR><BR></DIV></DIV>_______________________________________________<BR>postgis-users 
            mailing list<BR><A 
            href="mailto:postgis-users@postgis.refractions.net" 
            target=_blank>postgis-users@postgis.refractions.net</A><BR><A 
            href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
            target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV><BR>_______________________________________________<BR>postgis-users 
          mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" 
          target=_blank>postgis-users@postgis.refractions.net</A><BR><A 
          href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
          target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV><BR>_______________________________________________<BR>postgis-users 
      mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" 
      target=_blank>postgis-users@postgis.refractions.net</A><BR><A 
      href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
      target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV><BR>_______________________________________________<BR>postgis-users 
    mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" 
    target=_blank>postgis-users@postgis.refractions.net</A><BR><A 
    href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
    target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>