gemgis.vector.remove_interfaces_within_fault_buffers
gemgis.vector.remove_interfaces_within_fault_buffers#
- gemgis.vector.remove_interfaces_within_fault_buffers(fault_gdf: geopandas.geodataframe.GeoDataFrame, interfaces_gdf: geopandas.geodataframe.GeoDataFrame, distance: Union[int, float] = None, remove_empty_geometries: bool = True, extract_coordinates: bool = True) Tuple[geopandas.geodataframe.GeoDataFrame, geopandas.geodataframe.GeoDataFrame] #
Function to create a buffer around a GeoDataFrame containing fault data and removing interface points that are located within this buffer
- Parameters
fault_gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the fault data
interfaces_gdf (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the interface point data
distance (float, int) – Distance of the buffer around the geometry object, e.g.
distance=10
remove_empty_geometries (bool) – Variable to remove empty geometries, Options include:
True
orFalse
defaultTrue
extract_coordinates (bool) – Variable to extract X and Y coordinates from resulting Shapely Objects, Options include:
True
orFalse
defaultTrue
- Returns
gdf_out (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the vertices located outside the fault buffer
gdf_in (gpd.geodataframe.GeoDataFrame) – GeoDataFrame containing the vertices located inside the fault buffer
New in version 1.0.x.
Example
>>> # Loading Libraries >>> import gemgis as gg >>> import geopandas as gpd >>> from shapely.geometry import Point, LineString
>>> # Creating first Point >>> point1 = Point(0, 0) >>> point1.wkt 'POINT (0 0)'
>>> # Creating second Point >>> point2 = Point(5, 0) >>> point2.wkt 'POINT (5 0)'
>>> # Creating GeoDataFrame from Points >>> fault_gdf = gpd.GeoDataFrame(geometry=[point1, point2])
>>> # Creating first LineString >>> linestring1 = LineString([(0, 0), (10, 10), (20, 20)]) >>> linestring1.wkt 'LINESTRING (0 0, 10 10, 20 20)'
>>> # Creating second LineString >>> linestring2 = LineString([(10, 0), (20, 10), (30, 20)]) >>> linestring2.wkt 'LINESTRING (0 0, 10 10, 20 20)'
>>> # Creating GeoDataFrame from LineStrings >>> buffer_objects_gdf = gpd.GeoDataFrame(geometry=[linestring1, linestring2])
>>> # Removing interfaces within fault buffers >>> result_out, result_in = gg.vector.remove_interfaces_within_fault_buffers(fault_gdf=fault_gdf, interfaces_gdf=buffer_objects_gdf, distance=10)
>>> # Inspecting the Base Geometries that remain outside >>> result_out geometry X Y 0 POINT (7.07107 7.07107) 7.07 7.07 1 POINT (10.00000 10.00000) 10.00 10.00 2 POINT (20.00000 20.00000) 20.00 20.00 3 POINT (10.00000 0.00000) 10.00 0.00 4 POINT (20.00000 10.00000) 20.00 10.00 5 POINT (30.00000 20.00000) 30.00 20.00
>>> # Inspecting the Base Geometries that remain inside >>> result_in geometry X Y 0 POINT (0.00000 0.00000) 0.00 0.00 1 POINT (7.07107 7.07107) 7.07 7.07
See also
remove_object_within_buffer
Removing one object from one buffered object
remove_objects_within_buffer
Removing several objects from one buffered object