I have a polygon layer containing titles which are grouped by a property ID (i.e. there may be one or more title polygon per property)
I need to generate an internal buffer of those unioned titles/of the property but can't quite get it working- with the code below, the internal buffer is generated but for all titles individually (i.e. there are buffers on the internal divisions)
How can I apply a union to the 'titles' before the difference?
Alternatively, is there a better way of generating an internal buffer of unioned/merged polygons grouped by an attribute?
SELECT
row_number() OVER () AS fid,
g.geom::geometry(Polygon,2193) AS geom,
g.forest_id
FROM (
SELECT
(ST_Dump(
ST_Union(
ST_Difference(
titles.geom,
ST_Buffer(titles.geom, - 10::double precision)
)
)
)).geom AS geom,
titles.forest_id
FROM public.titles
GROUP BY titles.forest_id) g;