<!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.7600.16588"></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial>Paul,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial> > </FONT></SPAN>Finally and just to clarify, you say
that the Z check is not performed in the ST_Within and ST_DWithin cases.
Thus my result set only contains points within the X <SPAN
class=720031622-16062010><FONT color=#0000ff
face=Arial> </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial>> </FONT></SPAN>and Y plane boundaries of the Box3D
where some of them could be outside in the Z plane!!! If this is correct can you
suggest a solution in PostGIS SQL terms or will <FONT face=Arial><FONT
color=#0000ff><SPAN class=720031622-16062010> </SPAN></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><SPAN
class=720031622-16062010></SPAN></FONT></FONT><FONT face=Arial><FONT
color=#0000ff><SPAN
class=720031622-16062010> > </SPAN></FONT></FONT>postprocessing the
results in a seperate manner be required? Will 3D awaremess of situations
like this be included in future PostGIS versions.<BR> <BR><SPAN
class=720031622-16062010><FONT color=#0000ff face=Arial> <FONT
color=#000000 face=Verdana>> </FONT> </FONT></SPAN>Anyway thanks
again,<BR> <BR><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial> Regarding future versions. I think the other Paul (Paul
Ramsey) is working on changing the index structure for PostGIS 2.0 to handle 3D
geometries, so that would help there since the bounding box &&
short-circuit would be z aware. The ST_DWithin there is probably hope
there too since that is a native PostGIS function. ST_Within is a GEOS
function and I think GEOS is a long ways away from being more 3D aware, unless
someone is willing to fund that effort.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial> I'll let Paul, Mat, or Strk or Olivier respond to the
GEOS/PostGIS 3D relationship support future since they are more
familiar with that area.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT color=#0000ff
face=Arial>Regarding a work around, I think you can use the ST_ZMin and ST_ZMax
functions and since you are doing pretty much bounding box checks, that should
be sufficient.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT face=Arial><A
href="http://www.postgis.org/documentation/manual-1.5/ST_ZMax.html">http://www.postgis.org/documentation/manual-1.5/ST_ZMax.html</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT face=Arial>So your
query would look something like</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT face=Arial>SELECT *
FROM table1 INNER JOIN (SELECT table2.the_geom FROM table2 WHERE id<BR>= 356) AS
t2<BR> ON ST_DWithin(table1.the_geom,
t2.the_geom, 5) </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT face=Arial>WHERE
ST_ZMin(table1.the_geom) >= ST_Zmin(t2.the_geom)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010> <FONT
face=Arial>AND ST_ZMax(table1.the_geom) <=
ST_ZMax(t2.the_geom);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT face=Arial><A
href="http://www.postgis.us">http://www.postgis.us</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010><FONT
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=720031622-16062010></SPAN><FONT
face=Arial></FONT><BR><BR> </DIV>
<DIV dir=ltr align=left>
<HR>
</DIV>
<DIV dir=ltr align=left>Hotmail: Trusted email with Microsoft’s powerful SPAM
protection. <A href="https://signup.live.com/signup.aspx?id=60969"
target=_new>Sign up now.</A> </DIV></BODY></HTML>