<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE>.hmmessage P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-SIZE: 10pt; FONT-FAMILY: Tahoma
}
</STYLE>

<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>Ihab,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>If your cylinder is perpendicular to the x-y plane, then I think 
you may be able to think of your cylinder as</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>the 2-d buffer integrated along the z-axis from say the 
base to base + radius of interest (lets call the radius = 
10)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>So then your query I think can be simplified to 
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>if your point of interest (which is the center of the base of the 
cylinder) is ST_MakePoint(1,2,3) and radius 10  (in this example my 
cylinder is 3 units above ground)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>SELECT pt.gid, pt.the_geom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008><FONT face=Arial 
color=#0000ff>FROM  ST_DWithin(pt.the_geom, 
ST_MakePoint(1,2,3),10)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=966031411-19092008></SPAN><SPAN 
class=966031411-19092008></SPAN><FONT face=Arial><FONT color=#0000ff>A<SPAN 
class=966031411-19092008>ND ST_Z(pt.the_geom) Between 3 and 
13</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN 
class=966031411-19092008></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN 
class=966031411-19092008></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN class=966031411-19092008>If your 
cylinder is partly below ground, then your 3 and 13 change to say -8 and 2 
or whatever.  So basically between zofinterest + 0  and zofinterest + 
10</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN 
class=966031411-19092008></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN class=966031411-19092008>Now if 
your cylinder is not perpendicular to x-y plane, then I think you may still be 
able to use something similar to the above trick,</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN class=966031411-19092008>but you 
would need to redefine your axis relative to the azimuth of your cylinder which 
I haven't given much thought to at all.</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN 
class=966031411-19092008></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN class=966031411-19092008>Hope 
that helps,</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><SPAN 
class=966031411-19092008>Regina</SPAN></FONT></FONT></DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> eehab hamzeh [mailto:eehab40@hotmail.com] 
<BR><B>Sent:</B> Thursday, September 18, 2008 2:57 PM<BR><B>To:</B> Obe, 
Regina<BR><B>Subject:</B> RE: [postgis-users] make the buffer in 
3d<BR></FONT><BR></DIV>
<DIV></DIV><BR><BR>Hello Regina,<BR> <BR>Thanks you for your answer. I need 
to have a cylinder in the result (visualize the cylinder). the cylinder will be 
resulted from the buffer of point, the z value of the buffer will be same as the 
buffer radius (or a value entered from the user)<BR> <BR>then i need 
the to select any feature that are within the cylinder. 
<BR> <BR>thanks <BR> <BR>Ihab <BR> <BR><BR><BR> <BR>
<HR id=stopSpelling>
<BR>> Date: Thu, 18 Sep 2008 10:50:03 -0700<BR>> From: 
kneufeld@refractions.net<BR>> To: eehab40@hotmail.com<BR>> Subject: Re: 
[postgis-users] make the buffer in 3d<BR>> <BR>> Regina answered this 
question this morning.<BR>> 
http://postgis.refractions.net/pipermail/postgis-users/2008-September/021232.html<BR>> 
<BR>> Essentially, just test if your points lie within some 3D distance of 
<BR>> eachother.<BR>> <BR>> Did you try her logic?<BR>> <BR>> I 
was mistaken in my previous message to you, as distance3D is not yet <BR>> 
implemented, but length3D is. This is what her query does ... but it <BR>> 
only works between two points. If you want to test 3D polygons, you're <BR>> 
stuck with testing those against a 3D cube (which I showed you how to do 
<BR>> on the list).<BR>> <BR>> Sorry, I'm not much more help.<BR>> 
Kevin<BR>> <BR>> <BR>> eehab hamzeh wrote:<BR>> > Kevin,<BR>> 
> <BR>> > Thanks, i will try to use sphere , what are the function for 
sphere in <BR>> > the postgis<BR>> > <BR>> > thanks<BR>> 
> <BR>> > ihab<BR>> > <BR>> > <BR>> > 
------------------------------------------------------------------------<BR>> 
> <BR>> > > Date: Thu, 18 Sep 2008 10:12:52 -0700<BR>> > > 
From: kneufeld@refractions.net<BR>> > > To: eehab40@hotmail.com<BR>> 
> > Subject: Re: [postgis-users] make the buffer in 3d<BR>> > 
><BR>> > > There is no native JTS/GEOS geometry type "cylinder". So, 
unless you<BR>> > > are a guru in programming in GEOS and C, I would 
recommend you don't<BR>> > > even consider trying to compute the 
intersection of a 3d polygon or line<BR>> > > with a new cylinder 
object of your making.<BR>> > ><BR>> > > If you just wanted to 
test if a point lies within an abstract cylinder<BR>> > > object, you 
might be able to do this PL/pgSQL. A great resource is the<BR>> > > 
PostgreSQL website<BR>> > > 
(http://www.postgresql.org/docs/8.3/static/plpgsql.html). You could<BR>> > 
> create a function that accepts a source point, a radius, a height, and 
a<BR>> > > candidate point. Then perhaps, using some math, determine if 
your<BR>> > > candidate point is within the radius of the source point 
and within some<BR>> > > ; height of source point.<BR>> > 
><BR>> > > ie.<BR>> > > CREATE FUNCTION 
CylinderContainsPoint(center_pt geometry, radius double<BR>> > > 
precision, height double precision, candidate_pt geometry)<BR>> > > 
RETURNS boolean AS $$<BR>> > > DECLARE<BR>> > > ....<BR>> 
> > BEGIN<BR>> > > ...<BR>> > > RETURN ...;<BR>> > 
> END;<BR>> > > $$ LANGUAGE plpgsql;<BR>> > ><BR>> > 
><BR>> > > You're sure you need a cylinder, not a sphere? A sphere 
can be tested<BR>> > > on distance == 0 instead of testing for 
intersection, producing the same<BR>> > > results - this is easy to do 
with functions already in PostGIS.<BR>> > ><BR>> > > Have 
fun!<BR>> > > -- Kevin<BR>> > ><BR>> > ><BR>> > 
> eehab hamzeh wrote:<BR>> > > > Thanks for your replay,<BR>> 
> > ><BR>> > > > what i need is to find all the object (3d 
polygon, line with z <BR>> > value or<BR>> > > > points) that 
are intersect that cylinder that resulted from the buffer.<BR>> > > 
><BR>> > > > can you please give me the steps that i need to 
follow... Is there is<BR>> > > > any source to learn PL SQL?<BR>> 
> > > How i can insert cylinder in postgis?<BR>> > > > 
Thanks<BR>> > > > ihab<BR>> > > ><BR>> > > 
><BR>> > <BR>> > <BR>> > 
------------------------------------------------------------------------<BR>> 
> Explore the seven wonders of the world Learn more! <BR>> > 
<http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE><BR><BR><BR>
<HR>
Get news, entertainment and everything you care about at Live.com. <A 
href="http://www.live.com/getstarted.aspx " target=_new>Check it out!</A> 
</BODY></HTML>

<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>