Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

PostGIS with SFCGAL

Posted by smathermather on December 4, 2013

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 Responses to “PostGIS with SFCGAL”

  1. mapbaker said

    Definitely post a screen shot from ST_Extrude!

  2. 🙂 Working on it.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: