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

ebcorder at rockwellcollins.com ebcorder at rockwellcollins.com
Fri Feb 3 12:11:08 PST 2006


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
> geom_test=# select addgeometrycolumn('polygon3d','shape',-1,'POLYGON',3);
>
> 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




More information about the postgis-users mailing list