Multi-Ring Buffers in PostGIS– Prep for Landuse Analysis

If we want to understand the factors affecting the quality of an ecological resource, adjacency is important. Adjacent land use and the fossil fuel inputs relative to keeping a land use in its current use seem to have strong correlation with, e.g. wetland quality.  I’ll have a deeper post on this with some citations, but this relatively simple process of analysis is called Landscape Development Index (LDI).  For now, just some PostGIS code with pretty little wetland buffer pictures… .  More complete code forthcoming… .

CREATE TABLE public.wetland_bufftest4
	AS

	SELECT wet.gid AS gid_wet, ST_Difference(
		ST_Union(ST_Buffer(wet.the_geom, 100)),
		ST_Union(ST_Buffer(wet.the_geom, 0))
		)
	AS the_geom
	FROM public.wetland wet
	GROUP BY wet.gid

	UNION ALL

	SELECT wet.gid AS gid_wet, ST_Difference(
		ST_Union(ST_Buffer(wet.the_geom, 250)),
		ST_Union(ST_Buffer(wet.the_geom, 100))
		)
	AS the_geom
	FROM public.wetland wet
	GROUP BY wet.gid

	UNION ALL

	SELECT wet.gid AS gid_wet, ST_Difference(
		ST_Union(ST_Buffer(wet.the_geom, 500)),
		ST_Union(ST_Buffer(wet.the_geom, 250))
		)
	AS the_geom
	FROM public.wetland wet
	GROUP BY wet.gid

	UNION ALL

	SELECT wet.gid AS gid_wet, ST_Difference(
		ST_Union(ST_Buffer(wet.the_geom, 1000)),
		ST_Union(ST_Buffer(wet.the_geom, 500))
		)
	AS the_geom
	FROM public.wetland wet
	GROUP BY wet.gid
;

ALTER TABLE public.wetland_bufftest4 ADD COLUMN gid serial;
ALTER TABLE public.wetland_bufftest4 ADD PRIMARY KEY (gid);

2 thoughts on “Multi-Ring Buffers in PostGIS– Prep for Landuse Analysis

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.