From ebe725ce290032d6528ea183229e5f0951fb0047 Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Mon, 27 Feb 2023 10:06:16 -0500 Subject: [PATCH] grass.pygrass: restore removed function and mark it as deprecated (#2859) --- python/grass/pygrass/modules/grid/patch.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/python/grass/pygrass/modules/grid/patch.py b/python/grass/pygrass/modules/grid/patch.py index 36d4fe175ba..bb97d019d30 100644 --- a/python/grass/pygrass/modules/grid/patch.py +++ b/python/grass/pygrass/modules/grid/patch.py @@ -18,6 +18,23 @@ from grass.pygrass.modules import Module +def get_start_end_index(bbox_list): + """Convert a Bounding Box to a list of the index of + column start, end, row start and end + :param bbox_list: a list of BBox object to convert + :type bbox_list: list of BBox object + + .. deprecated:: 8.3 + """ + ss_list = [] + reg = Region() + for bbox in bbox_list: + r_start, c_start = coor2pixel((bbox.west, bbox.north), reg) + r_end, c_end = coor2pixel((bbox.east, bbox.south), reg) + ss_list.append((int(r_start), int(r_end), int(c_start), int(c_end))) + return ss_list + + def rpatch_row(rast, rasts, bboxes): """Patch a row of bound boxes.