cartagen.open_polygon#
- open_polygon(polygon, size, quad_segs=1)#
Open a polygon using erosion and dilation.
This algorithm relies on the successive erosion and dilation of a polygon to get rid of thin sections.
- Parameters:
polygon (
PolygonorMultiPolygon) – The polygon to close.size (
float) – The size of the erosion and dilation.quad_segs (
int) – The number of linear segments in a quarter circle when performing the buffer. If above 1, the result may have round corners unsuitable for buildings.
- Returns:
See also
close_polygonClose a polygon using dilation and erosion.
Examples
>>> polygon = Polygon([(0, 0), (0, 4), (4, 4), (4, 0), (0, 0)]) >>> open_polygon(polygon, 1) <POLYGON ((0 1, 1 4, 4 3, 3 0, 0 1))>