How to perform a Buffer in PostGIS

Rate this post

This video and associated code shows how to perform a Buffer in PostGIS.

ALTER TABLE fiumi
ADD COLUMN buffer
GEOMETRY(MultiPolygon,3003,2);

UPDATE fiumi
SET buffer=ST_Multi(ST_Buffer(geom,100));

CREATE TABLE buffer_union AS SELECT
ST_Union(buffer)::GEOMETRY(MultiPolygon,3003),
ROUND((ST_Area(ST_Union(buffer))/1000)::numeric,2)
FROM fiumi;

ALTER TABLE fiumi
DROP COLUMN buffer;

Check Also

Tracking record history in PostGIS using triggers

Tracking record history in PostGIS using triggers

Rate this post This tutorial is about tracking history in your PostGIS tables while updating ...