I have a geopandas dataframe that has several rows with overlapping polygon geometries along with an index (unique and sequential). I want to merge the overlapping polygon geometries into a multi-polygon and keep the corresponding minimum index of the individual overlapping polygons.
For example: The geodataframe is as follows:
Lets say the polygon geometries with index 10233, 10235, 10238 overlap. I want a single row for this with these geometries merged in a multi-polygon (instead of 3 separate geometries) and the corresponding index should be the minimum index of the 3 rows that is 10233. I would like to do this for the entire geodataframe
I tried using the dissolve function from geopandas:
gdf = gdf.dissolve(by = 'index').reset_index()
This does not do anything since 'index' is unique. I also tried:
gdf = gdf.dissolve().reset_index()
However, this combines all geometries into single row of multi-polygons

