Skip to content

Add function to simplify fault geometry#35

Merged
lispandfound merged 25 commits intomainfrom
simplify
Mar 27, 2025
Merged

Add function to simplify fault geometry#35
lispandfound merged 25 commits intomainfrom
simplify

Conversation

@lispandfound
Copy link
Copy Markdown
Contributor

@lispandfound lispandfound commented Mar 4, 2025

This PR introduces the function simply_fault, which intelligently removes faults with small widths by absorbing small segments into their neighbours. It picks the neighbour to absorb into by minimising the deviation from the original fault geometry. The function is hypothesis tested for the following properties:

  1. A fault simplified to a tolerance of x km contains no segments smaller than x km.
  2. If the fault containing k segments of length less than x is simplified to a containing len(faults) - k segments, unless the fault has multiple consecutive segments of length less than x. Consecutive segments make the maths more difficult.
  3. The simplified fault area is at least 80% of the original fault area.

The relatively relaxed 80% condition is chosen because simplifying faults can result in pathological outliers when you have small faults containing few segments. For example, here is an example hypothesis testing finds if the threshold is 90%

image

The black is the original fault, and the red the simplified fault. The black fault contains a very small segment with a sharp change in direction. The red fault approximates the final fault in the only way it can, by creating a fault from the start to the end. But this fault has a larger difference in area than 90%. Unfortunately there isn't a way around this, it needs to be up to the caller to ensure the simplification does not produce one of these outlier cases.

@lispandfound
Copy link
Copy Markdown
Contributor Author

lispandfound commented Mar 4, 2025

Here is an extreme example:
image
Here the red segment replaces the three smaller segments, when simplified with a tolerance of 0.4km using sources.simplify_fault(fault, 0.4). A lower tolerance will result in a higher resolution of the fault. See the same picture with a tolerance of 0.2km.
image

@lispandfound
Copy link
Copy Markdown
Contributor Author

To produce those images I wrote a new function sources_as_geojson_features which is also included in this PR because I thought it was useful.

joelridden
joelridden previously approved these changes Mar 21, 2025
Copy link
Copy Markdown
Contributor

@AndrewRidden-Harper AndrewRidden-Harper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I noticed a small typo in a comment

Co-authored-by: AndrewRidden-Harper <52001209+AndrewRidden-Harper@users.noreply.github.com>
@lispandfound lispandfound merged commit c438bf5 into main Mar 27, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants