[postgis-users] 3D question

Dorian Bolivar dbolivar at gmail.com
Fri Sep 17 14:03:26 PDT 2004


Hi,

We're trying to use PostGIS for a 3D environment, but it's not working
as expected. We first inserted some points with X, Y and Z
coordinates, then tried to select a spatial region using BOX3D(), but
it seems that this function works only in 2D mode. We also tried some
distance() calculations, and it also worked in 2D.

We read the manual and played with the force_3d() function, but it was
useless. Some of the queries we entered (we tried these both with
points inserted with and without the force_3d() function):

Distance:

select geom from geom_test where distance(geom, 'POINT(1 1 1)') > 1.5;

Box3d:

select geom from geom_test where geom && 'BOX3D(0.25 -0.25 -0.25,0.75
0.25 0.25)'::box3d and distance(geom, 'POINT(0.5 0 0)') < 0.2;

Playing with force_3d():

select geom from geom_test where distance(geom, force_3d('POINT(1 0
1)')::geometry) > 1;


Thanks a lot,

-- 
Dorian Bolivar
dbolivar at gmail.com



More information about the postgis-users mailing list