Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I updated my answer. Your question states that you want polygons that are completely contained within another polygon eliminated. Is that the case, or do you actually need to keep some polygons that are completely within another polygon?