PostGIS CGAL functions

SFCGAL (https://oslandia.gitlab.io/SFCGAL/) is a C++ wrapper library around the geometry library CGAL (https://www.cgal.org/) that provides advanced 2D and 3D spatial functions.

About the CGAL Logo

In PostGIS the SFCGAL extension has to be created in order to call the CGAL functions:

postgres=# create extension postgis_sfcgal; 

When the extension is not created and you are using a function from CGAL (for example st_Extrude) the following vague error will occur:

postgres=# select ST_Extrude(ST_Buffer(ST_GeomFromText('POINT(100 90)'),50, 'quad_segs=2'),0,0,30);

SQL Error [42883]: ERROR: function st_extrude(geometry, integer, integer, integer) does not exist
   Hint: No function matches the given name and argument types. You might need to add explicit type casts.
   Position: 8

In https://postgis.net/docs/reference.html#reference_sfcgal there is a list of SFCGAL functions:

postgis_sfcgal_version
ST_Extrude
ST_StraightSkeleton
ST_ApproximateMedialAxis
ST_IsPlanar
ST_Orientation
ST_ForceLHR
ST_MinkowskiSum
ST_ConstrainedDelaunayTriangles
ST_3DIntersection
ST_3DDifference
ST_3DUnion
ST_3DArea
ST_Tesselate
ST_Volume
ST_MakeSolid
ST_IsSolid

Leave a comment