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
03034438
Unverified
Commit
03034438
authored
Apr 21, 2020
by
Julien Veyssier
Browse files
step4 checked ok, adjust progress
Signed-off-by:
Julien Veyssier
<
eneiluj@posteo.net
>
parent
edcb8eda
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/hrudelin_parms_J2000.py
View file @
03034438
...
...
@@ -506,7 +506,7 @@ def main(parms_file, nbProc, generator=False):
if
not
generator
:
iterable3
=
tqdm
(
total
=
6
,
total
=
8
,
initial
=
0
,
desc
=
'Creating hru.par and hru.shp %s'
%
(
pad
(
''
,
5
)),
unit
=
'phase'
,
...
...
@@ -600,6 +600,11 @@ def main(parms_file, nbProc, generator=False):
header_unit
+=
'
\t
'
+
ranges
[
'elevation'
][
2
]
sql
+=
',elevation'
if
not
generator
:
iterable3
.
update
(
1
)
else
:
yield
83
if
parms
.
get
(
'layer_overlay'
,
'slope'
)
==
'x'
:
slope_mult
=
'slope_mult'
slope_labeled
=
'slope_labeled'
...
...
@@ -628,6 +633,11 @@ def main(parms_file, nbProc, generator=False):
header_unit
+=
'
\t
'
+
ranges
[
'slope'
][
2
]
sql
+=
',slope'
if
not
generator
:
iterable3
.
update
(
1
)
else
:
yield
85
if
(
parms
.
get
(
'layer_overlay'
,
'aspect'
))
==
'x'
:
grass
.
run_command
(
'r.statistics'
,
base
=
'hrus'
,
cover
=
'aspect_rcl'
,
method
=
'mode'
,
output
=
'aspect_md'
,
overwrite
=
'True'
)
grass
.
run_command
(
'r.mapcalc'
,
expression
=
'aspect_mj=if((aspect_rcl==@aspect_md),aspect,null())'
,
overwrite
=
'True'
)
...
...
@@ -647,7 +657,7 @@ def main(parms_file, nbProc, generator=False):
if
not
generator
:
iterable3
.
update
(
1
)
else
:
yield
85
yield
90
grass
.
run_command
(
'db.execute'
,
sql
=
'ALTER TABLE hrus_c_pnt ADD x DOUBLE PRECISION'
)
grass
.
run_command
(
'db.execute'
,
sql
=
'ALTER TABLE hrus_c_pnt ADD y DOUBLE PRECISION'
)
...
...
@@ -718,7 +728,7 @@ def main(parms_file, nbProc, generator=False):
if
not
generator
:
iterable3
.
update
(
1
)
else
:
yield
9
0
yield
9
5
grass
.
run_command
(
'db.execute'
,
sql
=
'ALTER TABLE hrus_c_pnt ADD to_poly INTEGER'
)
grass
.
run_command
(
'db.execute'
,
sql
=
'ALTER TABLE hrus_c_pnt ADD to_reach INTEGER'
)
...
...
@@ -754,7 +764,7 @@ def main(parms_file, nbProc, generator=False):
if
not
generator
:
iterable3
.
update
(
1
)
else
:
yield
9
5
yield
9
8
# Save files
grass
.
run_command
(
'v.db.connect'
,
flags
=
'o'
,
table
=
'hrus_c_pnt'
,
map
=
'hrus_v_cat2'
,
key
=
'cat'
,
overwrite
=
'True'
)
...
...
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