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);
Hi,
I guess you will use generate_series in your next post.
Pierre
Good idea. Then I can write this as a function.