So, for those of you who haven’t seen it, SFCGAL, “a C++ wrapper library around CGAL with the aim of supporting ISO 19107:2013 and OGC Simple Features Access 1.2 for 3D operations” is now an optional include in PostGIS (I believe beginning with 2.1, forgive me if I’m wrong).  This was a quiet outcome of the Boston Code Sprint, after Paul Ramsey declared exact rational number representation would not make its way into PostGIS.

Gandalf the Grey declaring to the Balrog in the Mines of Moria
You shall not pass!

(I promise, that’s the only animated gif I’ll ever do, hat tip James Fee who did it for years before it was cool).

What does this mean for a typical PostGIS user? Well, so far it adds a nice suite of new 2D and 3D functions:

ST_Extrude — Extrude a surface to a related volume
ST_StraightSkeleton — Compute a straight skeleton from a geometry
ST_IsPlanar — Check if a surface is or not planar
ST_Orientation — Determine surface orientation
ST_ForceLHR — Force LHR orientation
ST_MinkowskiSum — Perform Minkowski sum
ST_Tesselate — Perform surface Tesselation
ST_Extrude is fun– this is a function for doing things like this:
Simulated extruded building footprints.
Extruded footprints from (ahem) City Engine. Ssssh. Don’t tell.

ST_StraightSkeleton does in one step the first phase of what I’ve been going on about for a couple years re: Voronoi diagrams (and bypasses Voronoi altogether):

Approximation of straight skeleton/ skeletonization of stream polygon
Skeleton of stream

Plus more! I’ve just started exploring.

BTW, in advance of there being an SFCGAL install guide for PostGIS, a good source for info on install can be gleaned from the PostGIS Developers listserve.

2 thoughts on “PostGIS with SFCGAL

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.