ST_Buffer diving under the covers part 1

This will be a quick post. I just looked at how ST_Buffer is written in the PostGIS codebase, and I thought this was interesting. When you use ST_Buffer and specify geometry, buffer distance, and an integer value, this gets converted in the overloaded function into a quad_segs version.


CREATE OR REPLACE FUNCTION ST_Buffer(geometry,float8,integer)

RETURNS geometry

AS $$ SELECT _ST_Buffer($1, $2,

CAST('quad_segs='||CAST($3 AS text) as cstring))

$$

LANGUAGE 'sql' IMMUTABLE STRICT;

P.S. I would have written more, but Sherlock just started.

2 thoughts on “ST_Buffer diving under the covers part 1

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s