Unverified Commit 7240850c authored by Julien Veyssier's avatar Julien Veyssier
Browse files

make get_polygon_bounds clearer

Signed-off-by: default avatarJulien Veyssier <eneiluj@posteo.net>
parent 90205146
......@@ -73,12 +73,12 @@ def get_polygon_bounds(shape, xmin_slect, ymax_slect, xmax_slect, ymin_slect):
ds = ogr.Open(shape)
layer = ds.GetLayer()
xmin, xmax, ymin, ymax = layer.GetExtent()
xmin_slect = max(xmin_slect, xmin)
xmax_slect = min(xmax_slect, xmax)
ymin_slect = max(ymin_slect, ymin)
ymax_slect = min(ymax_slect, ymax)
return xmin_slect, ymax_slect, xmax_slect, ymin_slect
return (
max(xmin_slect, xmin),
min(ymax_slect, ymax),
min(xmax_slect, xmax),
max(ymin_slect, ymin)
def get_coords(parms, xmin_slect, ymax_slect, xmax_slect, ymin_slect):
xmin_slect = max(xmin_slect, float(parms.get('surface', 'west')))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment