[R-sig-Geo] thinning a SpatialPolygonsDataFrame

Roger Bivand Roger.Bivand at nhh.no
Wed Nov 18 15:43:50 CET 2009


On Wed, 18 Nov 2009, Pinaud David wrote:

> Hi Michael,
> maybe you should try the function dp() in the package shapefiles that is an 
> implementation of the Douglas-Peucker polyLine simplification algorithm.

Note that its help page does warn that it is not topology-preserving, that 
is that lines are generalised, but that coincident lines (boundaries of 
neighbouring polygons) may be generalised differently. GEOS offers a 
topology-preserving line generalisation facility, which ought to take 
longer but do better than dp(), because it will not lead to visual 
artefacts (overlapping polygons, interpolygon slivers, etc.).

Roger

> HTH
> David
>
> Michael Friendly a écrit :
>> The Guerry package contains two maps of france (gfrance, gfrance85) which 
>> are quite detailed and large in size (~900K).
>> In writing a vignette for the package, there are quite a few figures that 
>> use the map multiple times in a layout, and
>> consequently result in huge file sizes for the .PDF files created.  For 
>> these purposes, the map need not be nearly
>> so detailed.
>> 
>> I'm wondering if there is a facility to "thin" the map by drawing it at a 
>> lower density of lines in the polygon regions.
>> When I was working with SAS, there was a GREDUCE procedure that did this 
>> nicely.
>> 
>> thanks,
>> -Michael
>> 
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list