[R-sig-Geo] summary of polygon buffer thread

Peter Adler peter.adler at usu.edu
Thu Sep 6 16:46:01 CEST 2007


Here is a summary of the responses to my question about buffering 
polygons. Thanks to everyone for quick and creative replies.

------------------------------

I've been doing this in postgis. Once you get used to it, its not too
difficult. Load data with shp2pgsql (or use rgdal + RODBC or similar
if you want to stay in R) and then create a new table to hold the
results. After that you can do "insert into restab select
buffer(the_geom, dist) from sourcetab" (that's from memory, so check
the postgis docs).
-Tim Keitt
------------------------------
There may be other alternatives, but
this is one of the functionalities in an external software (terralib) that
the aRT package tries to make usage.

The aRT web page has one example:
www.leg.ufpr.br/aRT


Paulo Justiniano Ribeiro Jr
------------------------------
Vector export and import in the spgrass6 package and v.buffer in GRASS
works too. Using QGIS under Windows, it is pretty painless, starting Rgui
in the GRASS shell; if the geometries are very complex, it takes some
time. readVECT6() on the output geometries does need a fix (in the next
release 0.4-2), because the imported data frame only has a single column
and the data frame dimension gets dropped. The attached image is from a
detailed bit of the North Carolina coast from the data sets supporting the
forthcoming third edition of the GRASS book.

Roger Bivand
------------------------------

I'm a novice when it comes to R but since GDAL and OGR have been
interfaced to R, there should/might be possibility to access the GEOS
functions through OGR (PostGIS also uses GEOS, which is a C++ port of
the Java Topology Suite) if GEOS was linked to OGR when it was built.

This page http://www.gdal.org/ogr/classOGRGeometry.html lists the GEOS
methods, which include Buffer.

Cheers,

Ari Jolma

[I found the following link which gives an example of a related approach:
http://wiki.intamap.org/index.php/PostGIS]
------------------------------

In the spatstat package the function 'dilate.owin' will compute the
morphological dilation (the region of space consisting of all locations
that are less than or equal to d units distant from the original polygon).
The result is not a polygon; it is represented in spatstat as a binary
image.

spatstat will also rescale and translate polygons, etc

spatstat does not have code to construct a *polygonal* buffer (a polygon
with a margin of *at least* distance d from the original polygon) and I
suspect that it's not well defined if the original polygon is not convex.

Adrian Baddeley


-- 
Peter Adler
Dept. of Wildland Resources and the Ecology Center
5230 Old Main
Utah State University
Logan, UT 84322
tel: (435) 797-1021  email: peter.adler at usu.edu
http://www.cnr.usu.edu/faculty/adler/




More information about the R-sig-Geo mailing list