Quantcast
Channel: PostgreSQL – Smathermather's Weblog
Viewing all articles
Browse latest Browse all 28

ST_Buffer diving under the covers part 1

$
0
0

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.



Viewing all articles
Browse latest Browse all 28

Trending Articles