Name

CG_3DUnion — Perform 3D union using postgis_sfcgal.

Übersicht

geometry CG_3DUnion(geometry geom1, geometry geom2);

geometry CG_3DUnion(geometry set g1field);

Beschreibung

Verfügbarkeit: 3.5.0

Diese Methode benötigt ein SFCGAL-Backend.

Diese Methode setzt die SQL/MM-Spezifikation um. SQL-MM IEC 13249-3: 5.1

Diese Funktion unterstützt 3d und lässt den Z-Index nicht fallen.

Diese Funktion unterstützt polyedrische Flächen.

Diese Funktion unterstützt Dreiecke und dreieckige unregelmäßige Netzoberflächen (TIN).

Aggregate variant: returns a geometry that is the 3D union of a rowset of geometries. The CG_3DUnion() function is an "aggregate" function in the terminology of PostgreSQL. That means that it operates on rows of data, in the same way the SUM() and AVG() functions do and like most aggregates, it also ignores NULL geometries.

Beispiele

Union two overlapping tetrahedral solids.

Code
WITH solids AS (
  SELECT CG_MakeSolid('POLYHEDRALSURFACE Z (
           ((0 0 0,4 0 0,0 4 0,0 0 0)),
           ((0 0 0,0 0 4,4 0 0,0 0 0)),
           ((0 0 0,0 4 0,0 0 4,0 0 0)),
           ((4 0 0,0 0 4,0 4 0,4 0 0)))'::geometry) AS geom1,
         CG_MakeSolid('POLYHEDRALSURFACE Z (
           ((2 0 0,6 0 0,2 4 0,2 0 0)),
           ((2 0 0,2 0 4,6 0 0,2 0 0)),
           ((2 0 0,2 4 0,2 0 4,2 0 0)),
           ((6 0 0,2 0 4,2 4 0,6 0 0)))'::geometry) AS geom2
)
SELECT CG_3DUnion(geom1, geom2) AS union_result
FROM solids;
Ausgabe von Rastern
POLYHEDRALSURFACE Z (((2 0 0,0 0 0,2 2 0,2 0 0)),((2 0 2,0 0 0,2 0 0,2 0 2)),((0 0 4,0 4 0,0 0 0,0 0 4)),((2 0 2,0 4 0,0 0 4,2 0 2)),((0 4 0,2 2 0,0 0 0,0 4 0)),((2 2 0,0 4 0,2 0 2,2 2 0)),((0 0 0,2 0 2,0 0 4,0 0 0)),((4 0 0,2 0 0,2 2 0,4 0 0)),((4 0 0,2 0 2,2 0 0,4 0 0)),((4 0 0,2 2 0,6 0 0,4 0 0)),((2 0 2,4 0 0,2 0 4,2 0 2)),((2 0 2,2 4 0,2 2 0,2 0 2)),((2 4 0,2 0 4,6 0 0,2 4 0)),((2 2 0,2 4 0,6 0 0,2 2 0)),((2 4 0,2 0 2,2 0 4,2 4 0)),((4 0 0,6 0 0,2 0 4,4 0 0)))
Figure
Geometry figure for visual-cg-3dunion-01