[postgis-users] Query 3D points ignores z values....

Abd Muhsen abd_muhsen at hotmail.com
Tue Apr 3 18:18:44 PDT 2007


Hi,

I have a simple spatial table that contains 3D points. For testing purposes, 
it has only 3 records, as follows:

id | name | pnt3d
----------------------------------------------
1 |"pnt1" |"POINT(5 10 20)"
2 |"pnt2" |"POINT(8 4 10)"
3 |"pnt3" |"POINT(12 24 2)"

When I query this table, it returns the tuples that satisfy the x and y 
coordinates only. In other words, it ignores the z values, i.e. it doesn't 
test for z values at all. For example:

SELECT  id, name, asEWKT(pnt3d) FROM table3d
WHERE pnt3d && 'BOX3D(0 0 50, 100 100 100)'::box3d;

SELECT  id, name, asEWKT(pnt3d) FROM table3d
WHERE pnt3d && Makebox3d(makepoint(0,0,50), makepoint(100,100,100) )

Both of the above queries return all the three records regardless to the z 
coordinate. I was shocked of that odd behaviour since I assumed that no 
records should be returned.

Please could anybody explain this behaviour to me? I read PostGIS 
documentation manual. It doesn't mention 3D queries that much.

Thank you for your time and concern,

Abdel M.





More information about the postgis-users mailing list