<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;"><pre>Hello Kevin<br>below is your replay to a question i post before 12 days. i kindly asked you to look to <br>what it again since my building are not 3D boxes they are not squares or rectangles, they are polygons has z values<br> i need to find the lines that intersect these extruded polygons in 3D.<br> <br>Thanks <br>ihab <br><br><br>Indexes in PostGIS are still only 2D. Hopefully 3D indexes will be <br>added sometime in the future, but in the meantime, you can perform your <br>3D query using the cube module.<br> <br><a href="http://www.postgresql.org/docs/8.3/static/cube.html" target="_blank">http://www.postgresql.org/docs/8.3/static/cube.html</a><br> <br>-- Sample 3D box table<br>CREATE TABLE boxes (box box3d);<br>INSERT INTO boxes SELECT 'BOX3D(0 0 0,2 2 2)'::box3d;<br>INSERT INTO boxes SELECT 'BOX3D(0 4 0,2 6 2)'::box3d;<br> <br> <br>-- Sample 3D index<br>CREATE INDEX boxes_box_cube_idx ON boxes USING GIST (<br> cube(<br> cube(<br> cube(ST_XMin(box), ST_XMax(box)),<br> ST_YMin(box),<br> ST_YMax(box)<br> ),<br> ST_ZMin(box),<br> ST_ZMax(box)<br> )<br>);<br> <br> <br>-- Sample 3D intersect query<br>SELECT box<br>FROM boxes<br>WHERE '(-1,1,1),(3,1,1)'::cube &&<br> cube(<br> cube(<br> cube(ST_XMin(box), ST_XMax(box)),<br> ST_YMin(box),<br> ST_YMax(box)<br> ),<br> ST_ZMin(box),<br> ST_ZMax(box)<br> );<br> <br> <br>-- Yields<br> box<br>--------------------<br> BOX3D(0 0 0,2 2 2)<br>(1 row)<br> <br> <br> <br>Cheers,<br>Kevin<br> <br>eehab hamzeh wrote:<br>> Hello,<br>> <br>> <br>> I try to use the && operator to select the boxes that intersect one line <br>> in 3d .. i need help to develop the Sql statement,<br>> <br>> Select AsText(line_geom) as geom from line where line_geom && <br>> geomFromText(Select astext(the_geom) from boxex)',-1);<br>> <br>> attached is a graph shows how the query result should looks i need just <br>> the red box to be seleced since the line intersect only the red box and <br>> not the another box which is lower than the line height.<br>> <br>> Thanks<br>> <br>> </pre></div><br /><hr />Connect to the next generation of MSN Messenger <a href='http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline' target='_new'>Get it now! </a></body>
</html>