I'm using the function gUnaryUnion to merge polygons in R. In one particuliar case this doesn't work correctly - some of the old polygon contours are still visible:

enter image description here

Can anybody help ?

1 Answer 1


I suspect your borders don't exactly match up. Either clean your source data or do a little trick I showed on a similar question on StackOverflow - add a little buffer round your polygons, enough to make sure things overlap.


The exact size of the buffer should be small enough to make sure misaligned edges overlap but not so big as to distort the real boundaries.

  • The buffer trick worked perfectly ! Thanks a lot, John Jul 17, 2013 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.