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?
postgis-pg94-binaries-2.2.0devw64gcc48.zip
from winnie.postgis.net/download/windows/pg94/buildbot which seems to have sfcgal support. At least I could install the extension and set the backend without error. But the query above still returns all false. – Peter Becker May 19 '15 at 23:36ST_3DIntersection
runs into trac.osgeo.org/postgis/ticket/3072 – Peter Becker May 19 '15 at 23:48