PostGIS 3.6 SFCGAL Cheatsheet

New in this release 1 Enhanced in this release 2   Requires SFCGAL 1.5 or higher cg1.5 Aggregate agg    Window function W   2.5/3D support 3d   SQL-MMmm  
SFCGAL Management Functions
postgis_sfcgal_version ()    Returns the version of SFCGAL in use
postgis_sfcgal_full_version ()    Returns the full version of SFCGAL in use including CGAL and Boost versions

SFCGAL Accessors and Setters
CG_ForceLHR  3d (geom)    Force LHR orientation
CG_IsPlanar  3d (geom)    Check if a surface is or not planar
CG_IsSolid  3d (geom1)    Test if the geometry is a solid. No validity check is performed.
CG_MakeSolid  3d (geom1)    Cast the geometry into a solid. No check is performed. To obtain a valid solid, the input geometry must be a closed Polyhedral Surface or a closed TIN.
CG_Orientation  3d (geom)    Determine surface orientation
CG_Area (geom)    Calculates the area of a geometry
CG_3DArea  mm  3d (geom1)    Computes area of 3D surface geometries. Will return 0 for solids.
CG_Volume  mm  3d (geom1)    Computes the volume of a 3D solid. If applied to surface (even closed) geometries will return 0.
ST_ForceLHR  3d (geom)    Force LHR orientation
ST_IsPlanar  3d (geom)    Check if a surface is or not planar
ST_IsSolid  3d (geom1)    Test if the geometry is a solid. No validity check is performed.
ST_MakeSolid  3d (geom1)    Cast the geometry into a solid. No check is performed. To obtain a valid solid, the input geometry must be a closed Polyhedral Surface or a closed TIN.
ST_Orientation  3d (geom)    Determine surface orientation
ST_3DArea  mm  3d (geom1)    Computes area of 3D surface geometries. Will return 0 for solids.
ST_Volume  mm  3d (geom1)    Computes the volume of a 3D solid. If applied to surface (even closed) geometries will return 0.

SFCGAL Processing and Relationship Functions
CG_Intersection (geomA, geomB)    Computes the intersection of two geometries
CG_Intersects (geomA, geomB)    Tests if two geometries intersect (they have at least one point in common)
CG_3DIntersects (geomA, geomB)    Tests if two 3D geometries intersect
CG_Difference (geomA, geomB)    Computes the geometric difference between two geometries
ST_3DDifference  mm  3d (geom1, geom2)    Perform 3D difference
CG_3DDifference  mm  3d (geom1, geom2)    Perform 3D difference
CG_Distance (geomA, geomB)    Computes the minimum distance between two geometries
CG_3DDistance (geomA, geomB)    Computes the minimum 3D distance between two geometries
ST_3DConvexHull  3d (geom1)    Computes the 3D convex hull of a geometry.
CG_3DConvexHull  3d (geom1)    Computes the 3D convex hull of a geometry.
ST_3DIntersection  mm  3d (geom1, geom2)    Perform 3D intersection
CG_3DIntersection  mm  3d (geom1, geom2)    Perform 3D intersection
CG_Union (geomA, geomB)    Computes the union of two geometries
ST_3DUnion  mm  3d    Perform 3D union.
  1. geom1, geom2
  2. g1field agg
CG_3DUnion  mm  3d    Perform 3D union using postgis_sfcgal.
  1. geom1, geom2
  2. g1field agg
ST_AlphaShape (geom, alpha, allow_holes = false)    Computes an Alpha-shape enclosing a geometry
CG_AlphaShape (geom, alpha, allow_holes = false)    Computes an Alpha-shape enclosing a geometry
CG_ApproxConvexPartition  cg1.5 (geom)    Computes approximal convex partition of the polygon geometry
ST_ApproximateMedialAxis  3d (geom)    Compute the approximate medial axis of an areal geometry.
CG_ApproximateMedialAxis  3d (geom)    Compute the approximate medial axis of an areal geometry.
ST_ConstrainedDelaunayTriangles  3d (g1)    Return a constrained Delaunay triangulation around the given input geometry.
CG_ConstrainedDelaunayTriangles  3d (g1)    Return a constrained Delaunay triangulation around the given input geometry.
ST_Extrude  3d (geom, x, y, z)    Extrude a surface to a related volume
CG_Extrude  3d (geom, x, y, z)    Extrude a surface to a related volume
CG_ExtrudeStraightSkeleton  cg1.5 (geom, roof_height, body_height = 0)    Straight Skeleton Extrusion
CG_GreeneApproxConvexPartition  cg1.5 (geom)    Computes approximal convex partition of the polygon geometry
ST_MinkowskiSum (geom1, geom2)    Performs Minkowski sum
CG_MinkowskiSum (geom1, geom2)    Performs Minkowski sum
ST_OptimalAlphaShape (geom, allow_holes = false, nb_components = 1)    Computes an Alpha-shape enclosing a geometry using an "optimal" alpha value.
CG_OptimalAlphaShape (geom, allow_holes = false, nb_components = 1)    Computes an Alpha-shape enclosing a geometry using an "optimal" alpha value.
CG_OptimalConvexPartition  cg1.5 (geom)    Computes an optimal convex partition of the polygon geometry
CG_StraightSkeleton  3d (geom, use_distance_as_m = false)    Compute a straight skeleton from a geometry
ST_StraightSkeleton  3d (geom)    Compute a straight skeleton from a geometry
ST_Tesselate  3d (geom)    Perform surface Tessellation of a polygon or polyhedralsurface and returns as a TIN or collection of TINS
CG_Tesselate  3d (geom)    Perform surface Tessellation of a polygon or polyhedralsurface and returns as a TIN or collection of TINS
CG_Triangulate (geom)    Triangulates a polygonal geometry
CG_Visibility  cg1.5  3d    Compute a visibility polygon from a point or a segment in a polygon geometry
  1. polygon, point
  2. polygon, pointA, pointB
CG_YMonotonePartition  cg1.5 (geom)    Computes y-monotone partition of the polygon geometry
CG_StraightSkeletonPartition  1 (geom, auto_orientation)    Computes the straight skeleton partition of a polygon.
CG_Buffer3D  1  3d (geom, radius, segments, buffer_type)    Computes a 3D buffer around a geometry.
CG_Rotate  1 (geom, angle)    Rotates a geometry by a given angle around the origin (0,0).
CG_Rotate2D  1 (geom, angle, cx, cy)    Rotates a geometry by a given angle around a specified point in 2D.
CG_Rotate3D  1  3d (geom, angle, ax, ay, az)    Rotates a geometry in 3D space around an axis vector.
CG_RotateX  1  3d (geom, angle)    Rotates a geometry around the X-axis by a given angle.
CG_RotateY  1  3d (geom, angle)    Rotates a geometry around the Y-axis by a given angle.
CG_RotateZ  1  3d (geom, angle)    Rotates a geometry around the Z-axis by a given angle.
CG_Scale  1 (geom, factor)    Scales a geometry uniformly in all dimensions by a given factor.
CG_Scale3D  1  3d (geom, factorX, factorY, factorZ)    Scales a geometry by separate factors along X, Y, and Z axes.
CG_Scale3DAroundCenter  1  3d (geom, factorX, factorY, factorZ, centerX, centerY, centerZ)    Scales a geometry in 3D space around a specified center point.
CG_Translate2D  1 (geom, deltaX, deltaY)    Translates (moves) a geometry by given offsets in 2D space.
CG_Translate3D  1  3d (geom, deltaX, deltaY, deltaZ)    Translates (moves) a geometry by given offsets in 3D space.