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. Here's what I'm doing: 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 dimensios 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,Y axis, not caring about the Z axis.
What I'm doing wrong, please?
أكثر...
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 dimensios 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,Y axis, not caring about the Z axis.
What I'm doing wrong, please?
أكثر...