I have some experience with PostgreSQL, but not with PostGIS, and for the life of me I can't make my bounding box take the Z axis into account.
I have a points table with XYZ columns. I add another one:
ALTER TABLE foo ADD COLUMN the_geom Geometry(PointZ,4326);
Then I populate the_geom column with my XYZ coordinates:
UPDATE foo SET the_geom = ST_SetSRID(ST_MakePoint (x,y,z), 4326)
I confirmed my 3 dimensions with:
SELECT f_geometry_column As col_name, type, srid, coord_dimension As ndims FROM geometry_columns
And finally, I can query my data against the bounding box with:
SELECT * FROM foo WHERE the_geom && ST_3DMakeBox( ST_MakePoint(0,0,0), ST_MakePoint(6600, 15500, 0) )
Which should return no rows since in the bounding box the Z axis is 0 and all my Z data is greater than zero, but the query only filters the X and Y axes, not caring about the Z axis.
What am I'm doing wrong, please?