Given a dataframe, is it possible to find polygons that lie within another polygon in the same dataframe and remove them based on a condition?
For example, consider the following dataframe
geometry category
0 POLYGON ((332294.432 2794730.319, 332294.032 2... A
1 POLYGON ((332193.232 2794730.719, 332192.832 2... B
2 POLYGON ((332271.632 2794731.519, 332271.232 2... C
3 POLYGON ((332271.632 2794731.519, 332271.232 2... C
Suppose polygon 3 lies within polygon 2. Since they are both of category C, I would like to remove polygon 3. If they were of different categories, I would not do a removal.
Is there a way to do this within geopandas?
