gemgis.vector.create_unified_buffer
gemgis.vector.create_unified_buffer#
- gemgis.vector.create_unified_buffer(geom_object: Union[geopandas.geodataframe.GeoDataFrame, List[shapely.geometry.base.BaseGeometry]], distance: Union[numpy.ndarray, List[Union[int, float]], float, int]) shapely.geometry.multipolygon.MultiPolygon #
Creating a unified buffer around Shapely LineStrings or Points
- Parameters
geom_object (Union[gpd.geodataframe.GeoDataFrame, List[shapely.geometry.base.BaseGeometry]]) – GeoDataFrame or List of Shapely objects
distance (Union[np.ndarray, List[Union[float, int]], Union[float, int]]) – Distance of the buffer around the geometry object, e.g.
distance=10
- Returns
polygon – Polygon representing the buffered area around a geometry object
- Return type
shapely.geometry.multipolygon.MultiPolygon
New in version 1.0.x.
Example
>>> # Loading Libraries and creating Point >>> import gemgis as gg >>> from shapely.geometry import Point >>> point1 = Point(0,0) >>> point1.wkt 'POINT (0 0)'
>>> # Creating Point >>> point2 = Point(20,20) >>> point2.wkt 'POINT (20 20)'
>>> # Creating list of points >>> point_list = [point1, point2]
>>> # Creating unified buffer >>> unified_buffer = gg.vector.create_unified_buffer(geom_object=point_list, distance=10) >>> unified_buffer 'MULTIPOLYGON (((10 0, 9.95184726672197 -0.980171403295605, 9.807852804032306 -1.950903220161281, 9.56940335732209 -2.902846772544621, 9.23879532511287 -3.826834323650894,...)))'
See also
create_buffer
Creating a buffer around a Shapely LineString or Point