Is it possible to express a 4D range query in Postgis? I would like to know what 4d points lie within a hypercube. This is my table:

    CREATE TABLE myTable
      point geometry,
      attrib double precision,
      CONSTRAINT ge_idx PRIMARY KEY (point)

This is how I inserted the data points:

    insert into myTable (point) values (ST_MakePoint(-71.10, 42.31, 12.43, 54.3));

Use the &&& operator for a hypercube query. Since like its brother && it is a bounding box query, you just need to create a query geometry that spans the desired cube: a linestring is the easiest to make:

FROM myTable
WHERE point &&& 'LINESTRING(50 50 50 50, 100 100 100 100)';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.