Function mergeFormationIntervals

  • Merge into a single column, where higher levels takes precedence over lower levels:

    • Sort the intervals by ascending entry depth and ascending stratigraphy unit level
    • Start with a stack containing the first item from the sorted list and keep track of the entry depth
    • iterate to find the next item that has an entry depth lower than current depth
    • define a range limit from the current depth and the entry of the item with a lower entry depth
    • pop the stack and draw sections while adjusting the current depth and keep doing this until the current depth reaches the range limit
    • any items on the stack with an exit md greater than the limit gets pushed back on the stack
    • the current item is pushed to the stack and the iteration continues

    Parameters

    Returns FormationColumnInterval[]