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