fractopo.tval.proximal_traces module
Determine traces that could be integrated together.
determine_proximal_traces takes an input of GeoSeries or GeoDataFrame of LineString geometries and returns a GeoDataFrame with a new column Merge which has values of True or False depending on if nearby proximal traces were found.
- fractopo.tval.proximal_traces.determine_proximal_traces(traces, buffer_value, azimuth_tolerance)
Determine proximal traces.
Takes an input of GeoSeries or GeoDataFrame of LineString geometries and returns a GeoDataFrame with a new column Merge which has values of True or False depending on if nearby proximal traces were found.
E.g.
>>> lines = [ ... LineString([(0, 0), (0, 3)]), ... LineString([(1, 0), (1, 3)]), ... LineString([(5, 0), (5, 3)]), ... LineString([(0, 0), (-3, -3)]), ... ] >>> traces = gpd.GeoDataFrame({"geometry": lines}) >>> buffer_value = 1.1 >>> azimuth_tolerance = 10 >>> determine_proximal_traces(traces, buffer_value, azimuth_tolerance) geometry Merge 0 LINESTRING (0 0, 0 3) True 1 LINESTRING (1 0, 1 3) True :rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~geopandas.geodataframe.GeoDataFrame\``
2 LINESTRING (5 0, 5 3) False 3 LINESTRING (0 0, -3 -3) False
- fractopo.tval.proximal_traces.is_similar_azimuth(trace, other, tolerance)
Determine if azimuths of trace and other are close.
Checks both the start – end -azimuth and regression-based azimuth.
E.g.
>>> trace = LineString([(0, 0), (0, 3)]) >>> other = LineString([(0, 0), (0, 4)]) >>> is_similar_azimuth(trace, other, 1) True
>>> trace = LineString([(0, 0), (1, 1)]) >>> other = LineString([(0, 0), (0, 4)]) >>> is_similar_azimuth(trace, other, 40) False >>> is_similar_azimuth(trace, other, 50) True >>> is_similar_azimuth(trace, other, 45) False
- fractopo.tval.proximal_traces.is_within_buffer_distance(trace, other, buffer_value)
Determine if trace and other are within buffer distance.
Threshold distance is buffer_value (both are buffered with half of buffer_value) of each other.
E.g.
>>> trace = LineString([(0, 0), (0, 3)]) >>> other = LineString([(0, 0), (0, 3)]) >>> is_within_buffer_distance(trace, other, 0.1) True
>>> line = LineString([(0, 0), (0, 3)]) >>> other = LineString([(3, 0), (3, 3)]) >>> is_within_buffer_distance(trace, other, 2) False >>> is_within_buffer_distance(trace, other, 4) True