Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hru-delin-dev
hru-delin
Commits
7240850c
Unverified
Commit
7240850c
authored
Apr 23, 2020
by
Julien Veyssier
Browse files
make get_polygon_bounds clearer
Signed-off-by:
Julien Veyssier
<
eneiluj@posteo.net
>
parent
90205146
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/hrudelin_1_init.py
View file @
7240850c
...
...
@@ -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
(
xm
ax
_slect
,
xm
ax
)
ymin_slect
=
max
(
ym
in
_slect
,
ym
in
)
ymax_slect
=
min
(
y
max_slect
,
y
max
)
return
xmin_slect
,
ymax_slect
,
xmax_slect
,
ymin_slect
return
(
max
(
xm
in
_slect
,
xm
in
),
min
(
ym
ax
_slect
,
ym
ax
),
min
(
x
max_slect
,
x
max
)
,
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'
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment