[postgis-users] 3D question

Paul Ramsey pramsey at refractions.net
Fri Sep 17 14:46:23 PDT 2004


PostGIS is 2.5d -- we store Z coordinates, but little of the 
functionality is 3d-aware.  There are a few lenght_* functions that 
explicitly use the 3rd coordinate.  Making the index 3d aware is 
possible. Making most of hte other functions 3d aware is quite a pile of 
work due to the maths and heuristics involved.

Dorian Bolivar wrote:

> 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,
> 




More information about the postgis-users mailing list