import geopandas as gpdsg = gpd.read_file('shapefile1.shp')sd = gpd.read_file('shapefile2.shp')kw = sg[sg['region_name'] == 'region1']tg = sd[sd['region_name'] == 'region2']
region1 and region2 are as below:
mr = kw.geometry.reset_index(drop=True).union(tg.geometry.reset_index(drop=True))mr.plot()
I can get the image from mr as below:
But, see the boundary of the region
mr.boundary.plot()
I can see the residual lines as the image above.
How remove these residual lines?
I'v tried to remove them using simplify(tolerance=0.01) and buffer(0) functions.But I failed.
I just expect to get outlines of the first image with empty inside.