Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Multi-Ring Buffers in PostGIS– Prep for Landuse Analysis

Posted by smathermather on June 16, 2011

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 Responses to “Multi-Ring Buffers in PostGIS– Prep for Landuse Analysis”

  1. Pierre said

    Hi,

    I guess you will use generate_series in your next post.

    Pierre

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: