Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions opendm/dem/ground_rectification/bounds/types.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def corners(self):
return self._corners

class BoxBounds(object):

def __init__(self, x_min, x_max, y_min, y_max):
self._corners = (x_min, x_max, y_min, y_max)

Expand Down Expand Up @@ -76,9 +77,11 @@ def divide_by_point(self, point):
"""Divide the box into four boxes, marked by the point. It is assumed that the point is inside the box"""
[x_point, y_point] = point
(x_min, x_max, y_min, y_max) = self._corners
x_point_eps = x_point + EPSILON
y_point_eps = y_point + EPSILON
return [
BoxBounds(x_min, x_point, y_min, y_point),
BoxBounds(x_point + EPSILON, x_max, y_min, y_point),
BoxBounds(x_min, x_point, y_point + EPSILON, y_max),
BoxBounds(x_point + EPSILON, x_max, y_point + EPSILON, y_max)
BoxBounds(x_point_eps, x_max, y_min, y_point),
BoxBounds(x_min, x_point, y_point_eps, y_max),
BoxBounds(x_point_eps, x_max, y_point_eps, y_max)
]