geoutils.Vector.buffer_without_overlap#
- Vector.buffer_without_overlap(buffer_size, metric=True, plot=False)[source]#
Buffer the vector geometries without overlapping each other.
The algorithm is based upon this tutorial: https://statnmap.com/2020-07-31-buffer-area-for-nearest-neighbour/. The buffered polygons are created using Voronoi polygons in order to delineate the “area of influence” of each geometry. The buffer is slightly inaccurate where two geometries touch, due to the nature of the Voronoi polygons, hence one geometry “steps” slightly on the neighbor buffer in some cases. The algorithm may also yield unexpected results on very simple geometries.
Note: A similar functionality is provided by momepy (http://docs.momepy.org) and is probably more robust. It could be implemented in GeoPandas in the future: geopandas/geopandas#2015.
- Parameters:
- Return type:
- Returns:
A Vector containing the buffered geometries.
- Examples:
On glacier outlines. >>> outlines = gu.Vector(gu.examples.get_path(‘everest_rgi_outlines’)) >>> outlines = gu.Vector(outlines.ds.to_crs(‘EPSG:32645’)) >>> buffer = outlines.buffer_without_overlap(500) >>> ax = buffer.ds.plot() # doctest: +SKIP >>> outlines.ds.plot(ax=ax, ec=’k’, fc=’none’) # doctest: +SKIP >>> plt.plot() # doctest: +SKIP