I have a multipolygon shapefile that i want to rotate. I can do the rotation but the problem is that the roatation changes the inner vertices. This creates overlap of polygon which i dont want.
This is what i have tried.
import geopandas as gpd
input_poly_path = "poly3.shp"
gdf = gpd.read_file(input_poly_path)
explode = gdf.explode(ignore_index=True)
ex = explode.rotate(-90, origin="centroid")
g = gpd.GeoDataFrame(columns=['geometry'], geometry='geometry')
g["geometry"] = ex
https://drive.google.com/drive/folders/1HJpnNL-iXU_rReQzVcDGuyWZ8IjciKP8?usp=drive_link Link to the polygon


IIUC, you need to pass the
centroidof theunary_unionas the origin of the rotation :NB: There is no need to
explodethe geometry, because you do not have MultiPolygons.Used input (
gdf) :