[postgis-users] Query 3D points ignores z values....
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Wed Apr 4 11:23:48 PDT 2007
On Wed, 2007-04-04 at 20:03 +0200, Abd Muhsen wrote:
> 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.
Hi Abdel,
The PostGIS indexable operators (like &&) which operate on the bounding
boxes are currently only 2D only. I believe that someone mentioned that
the OGC operators (from GEOS) are 2.5D, so you may be able to get the
result you want by including an additional OGC operator with an AND
clause to provide the additional filtering you need, e.g.
SELECT id, name, asEWKT(pnt3d) FROM table3d WHERE pnt3d && 'BOX3D(0 0
50, 100 100 100)'::box3d AND intersects(pnt3d, envelope('BOX3D(0 0 50,
100 100 100)'));
Kind regards,
Mark.
More information about the postgis-users
mailing list