[R-sig-Geo] simplify a polygon window

Rolf Turner r.turner at auckland.ac.nz
Fri Oct 5 00:42:28 CEST 2012


On 05/10/12 01:26, sara martino wrote:
> Hi,
>
> I am working with a point pattern whose window is a spatial polygon which describe the cost of Norway.
>
> I need to get a smoother version of such polygon which wraps the original one.
> I have tried to use the function
>
>> simplify.owin(my.owin,80000)
> but this does not work since some parts of the original polygon will lay outside the simplified one.
>
> Does anyone know how to do that?
> thanks a lot
This seems to me to be a hard problem; it is one with which I have struggled
off and on over the years with minimal success.  The simplify.owin() 
function
is a fairly blunt instrument with which to attack the problem. There 
exists a
somewhat sexier algorithm:

     Douglas, D. H. and Peucker, T. K., 1973. Algorithms for the Reduction
     of the Number of Points Required to Represent a Digitised Line
     or its Caricature, The Canadian Cartographer, 10(2): 112-122.

This is relatively easy to implement but for complicated boundaries it often
introduces self-intersections, which is no good at all.

A paper by Shin-Ting Wu and Mercedes Gonzales Marquez (2003) describes
a clever way of getting around the self-intersection.  They wrote C++ code
to implement their algorithm and kindly gave me permission to use their 
code and
incorporate it into an R function.  Sad to say I never got around to 
doing this.  Your
inquiry has reawakened my interest in this problem and I may shift it 
off the back-burner.
However it is very likely to take me quite a while to get the necessary 
work done,
even if the Wu-Marquez code is still available (which it may not be).  I 
am currently
making enquiries.

Overall there doesn't seem much that I can suggest to help you with your 
immediate
problem.  Sorry 'bout that.

     cheers,

         Rolf Turner

P. S. The complete citation for the Wu-Gonzales paper (in BibTeX form) is:
> @article{WuMarquez2003,
> author = {Shin-Ting Wu and Mercedes Roc\'{i}o Gonzales M\'{a}rquez},
> title = {A Non-Self-Intersection Douglas-Peucker Algorithm},
> journal ={Computer Graphics and Image Processing, Brazilian Symposium on},
> volume = {0},
> issn = {1530-1834},
> year = {2003},
> pages = {60},
> doi = {http://doi.ieeecomputersociety.org/10.1109/SIBGRA.2003.1240992},
> publisher = {IEEE Computer Society},
> address = {Los Alamitos, CA, USA},
> }
>



More information about the R-sig-Geo mailing list