added support for automatic removal of duplicate polygons