We are currently investigating PostGIS as an option to look up three-dimensional blocks which contain a point (and later also lines). At this point in time I cannot see any functionality that operates on the volume of a three dimensional shape, all functions PostGIS offers seem to operate on the surface.
Here are a number of functions we tried:
SELECT ST_Contains(p , mpoly), ST_Contains(p , ph), ST_Contains(p , box), ST_3DIntersects(p , mpoly), ST_3DIntersects(p , ph), ST_3DIntersects(p , box), ST_3DDWithin(p , mpoly, 0), ST_3DDWithin(p , ph, 0), ST_3DDWithin(p , box, 0)FROM (SELECT 'POINT Z (0.5 0.5 0.5)'::geometry AS p, 'MULTIPOLYGON Z ( ((0 0 0, 0 1 0, 1 1 0, 0 1 0, 0 0 0)), ((0 0 1, 0 1 1, 1 1 1, 0 1 1, 0 0 1)), ((0 0 0, 0 0 1, 0 1 1, 0 0 1, 0 0 0)), ((1 0 0, 1 0 1, 1 1 1, 1 0 1, 1 0 0)), ((0 0 0, 0 0 1, 1 0 1, 1 0 0, 0 0 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)) )'::geometry AS mpoly, 'POLYHEDRALSURFACE ( ((0 0 0, 0 1 0, 1 1 0, 0 1 0, 0 0 0)), ((0 0 1, 0 1 1, 1 1 1, 0 1 1, 0 0 1)), ((0 0 0, 0 0 1, 0 1 1, 0 0 1, 0 0 0)), ((1 0 0, 1 0 1, 1 1 1, 1 0 1, 1 0 0)), ((0 0 0, 0 0 1, 1 0 1, 1 0 0, 0 0 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)) )'::geometry AS ph, ST_3DMakeBox('POINT Z (0 0 0)'::geometry, 'POINT Z (1 1 1)'::geometry) AS box ) AS foo;All of these return false. Given that we are using polygons and polyhedral surfaces this seems correct, but is there a way to have PostGIS apply volumetric calculations?
أكثر...
Here are a number of functions we tried:
SELECT ST_Contains(p , mpoly), ST_Contains(p , ph), ST_Contains(p , box), ST_3DIntersects(p , mpoly), ST_3DIntersects(p , ph), ST_3DIntersects(p , box), ST_3DDWithin(p , mpoly, 0), ST_3DDWithin(p , ph, 0), ST_3DDWithin(p , box, 0)FROM (SELECT 'POINT Z (0.5 0.5 0.5)'::geometry AS p, 'MULTIPOLYGON Z ( ((0 0 0, 0 1 0, 1 1 0, 0 1 0, 0 0 0)), ((0 0 1, 0 1 1, 1 1 1, 0 1 1, 0 0 1)), ((0 0 0, 0 0 1, 0 1 1, 0 0 1, 0 0 0)), ((1 0 0, 1 0 1, 1 1 1, 1 0 1, 1 0 0)), ((0 0 0, 0 0 1, 1 0 1, 1 0 0, 0 0 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)) )'::geometry AS mpoly, 'POLYHEDRALSURFACE ( ((0 0 0, 0 1 0, 1 1 0, 0 1 0, 0 0 0)), ((0 0 1, 0 1 1, 1 1 1, 0 1 1, 0 0 1)), ((0 0 0, 0 0 1, 0 1 1, 0 0 1, 0 0 0)), ((1 0 0, 1 0 1, 1 1 1, 1 0 1, 1 0 0)), ((0 0 0, 0 0 1, 1 0 1, 1 0 0, 0 0 0)), ((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)) )'::geometry AS ph, ST_3DMakeBox('POINT Z (0 0 0)'::geometry, 'POINT Z (1 1 1)'::geometry) AS box ) AS foo;All of these return false. Given that we are using polygons and polyhedral surfaces this seems correct, but is there a way to have PostGIS apply volumetric calculations?
أكثر...