# [postgis-users] RE: HELP 3d spatial bounding box

Stephen Woodbridge woodbri at swoodbridge.com
Fri Feb 3 12:31:55 PST 2006

```Hi Elwood,

The fundamental problem here is that polygons are basically 2D planar
objects, even if they are draped over a 3D contour. While postGIS has
the ability to carry with these planar objects some additional
information like Z values and M values, all the implementation has
underlying assumptions that things are basically planar in nature.

If you need geometric/volumetric calculations in 3D then you probably
really need something that does solid modeling. Check out:

for some ideas, these may be what you need. I do not think postGIS will
even have something as simple as the 3D intersection of two plane that
results in a line, point or polygon unless they are coplanar and the Z
values are ignored.

-Steve W.

ebcorder at rockwellcollins.com wrote:
> To: strk
> Thanks for your response below.   I was afraid of that answer.  How could I
> utilize the Postgis to find overlapping 3d polygons?   I must admit I am
> not understanding the 3d in postgis.  Is the geometric/volumetric math too
> complex?
>
>
>
> There is no 3d predicates in postgis.
> --strk;
>
> On Thu, Feb 02, 2006 at 09:47:56AM -0600, ebcorder at rockwellcollins.com
> wrote:
>
>>this example.
>>I want to test for 3d relationships but I only get 2d results.   I loaded
>>3d data into the database and attempted a && (intersect in the bounding
>>box).   This is what I did:   Below the results are correct if only
>>considering 2d.
>>
>>geom_test=# create table polygon3d (id int4);
>>CREATE TABLE
>>
>>The data is formatted latitude,longitude,altitude. Each vertices is
>>separated by comma.
>>Begin;
>>insert into polygon3d (id,shape) values
>
> (1,geomfromEWKT('POLYGON((29.212389
>
>>-81.033350 10,29.211220 -81.033817 10,29.210930 -81.033338 10,29.211520
>>-81.030326 10,29.212582 -81.030461 10,29.212389 -81.033350 10))',-1));
>>insert into polygon3d (id,shape) values
>
> (2,geomfromEWKT('POLYGON((29.214342
>
>>-81.036386 30,29.210082 -81.034641 30,29.213140 -81.036927 30,29.214342
>>-81.036386 30))',-1));
>>insert into polygon3d (id,shape) values
>
> (3,geomfromEWKT('POLYGON((29.214427
>
>>-81.033325 20,29.209782 -81.031445 20,29.209739 -81.031199 20,29.210286
>>-81.029269 20,29.210383 -81.029404 20 , 29.214427 -81.033325 20))',-1));
>>commit;
>>
>>I perform a query
>>geom_test=# select id from polygon3d where shape &&
>>geomfromEWKT('POLYGON((29.214427 -81.033325 20,29.209782 -81.031445 20,
>>29.209739 -81.031199 20,29.210286 -81.029269 20,29.210383 -81.029404 20,,
>>29.214427 -81.033325 20))');
>> id
>
>
> Elwood Cordery
> Rockwell Collins
> Contract Software Engineer
> 319-295-8248
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

```