tinerator.boundary
orderPointsClockwise
orderPointsClockwise(points:numpy.ndarray, opt:str='polar', clockwise:bool=True)
Given a 2D array of points, this function reorders points clockwise. Available methods are: 'angle', to sort by angle, 'polar', to sort by polar coordinates, and 'nearest_neighbor', to sort by nearest neighbor.
Arguments
- points (np.ndarray): Array of unsorted points
- opt (str): Sorting method
- clockwise (bool): order points clockwise or counterclockwise
Returns
Sorted points
imageErosionBoundary
imageErosionBoundary(A, nil_value, distance, cell_size=None, xll_corner=0, yll_corner=0)
Blazing fast way to create an accurate DEM boundary. Currently, there is no way to seperate nodes with a delta-x. As such, this function is not called anywhere within this package. Once that is implemented, this function will depreciate squareTraceBoundary().
Arguments
- A (np.ndarray): matrix to perform boundary analysis on
- nil_value (float): value characterizing undefined array values
- distance (float): spacing between boundary nodes
Returns
boundary nodes
rectangularBoundary
rectangularBoundary(bbox:list, spacing:float)
Generates a rectangular boundary with evenly spaced points.
bbox should be a list of values in the following format:
min(x), max(x), min(y), max(y)
Arguments
- bbox (list
) : bounding box coordinates - spacing (float): spacing between adjacent nodes
Returns
Array of interpolated bounding box values
squareTraceBoundary
squareTraceBoundary(A, NDV, dist=10.0)
Uses a square-tracing algorithm to quickly find a set of points composing the boundary at the interface of data and "empty" (noDataValue) cells in a DEM matrix.
The optional parameter 'dist' denotes the seperation the points should have between each other. A smaller value will result in more points being created.
For more information, visit this page.
Arguments
- A (np.ndarray): matrix to perform boundary analysis on
- NDV (float): value characterizing undefined array values
- dist (float): spacing between boundary nodes
Returns
Boundary nodes