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

Abd Muhsen abd_muhsen at hotmail.com
Wed Apr 4 11:03:10 PDT 2007


Hi there,

Can anybody help me with this please?!! I cann't understand why the 
following query doesn't return correct result:

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

It is supposed to return all the 3D points within a cube. However, what is 
returned from this query is all the points which are inside the 2D box (0 0, 
100 100), which is not right... am I missing something or what? Please help.

Cheers,

Abdel m.




>From: "Abd Muhsen" <abd_muhsen at hotmail.com>
>Reply-To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
>To: postgis-users at postgis.refractions.net
>Subject: [postgis-users] Query 3D points ignores z values....
>Date: Wed, 04 Apr 2007 03:19:00 +0200
>
>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.
>
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list