Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gts2
gts2_client
Commits
a6060200
Commit
a6060200
authored
Jan 06, 2021
by
tsanona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections to pass tests
parent
9fd7973d
Pipeline
#17632
passed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
gts2_client/gts2_client.py
gts2_client/gts2_client.py
+6
-3
No files found.
gts2_client/gts2_client.py
View file @
a6060200
...
@@ -804,6 +804,11 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
...
@@ -804,6 +804,11 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
if
onlytime
and
out_mode
not
in
[
"json"
,
"python"
]:
if
onlytime
and
out_mode
not
in
[
"json"
,
"python"
]:
raise
AssertionError
(
"Invalid output mode. If onlytime==True, choose either 'python' or 'json'"
)
raise
AssertionError
(
"Invalid output mode. If onlytime==True, choose either 'python' or 'json'"
)
if
compress
:
tif_opts
=
"COMPRESS={}_PREDICTOR={}"
.
format
(
*
compress
.
split
(
"-"
)).
split
(
"_"
)
else
:
tif_opts
=
None
valid_out_modes
=
[
"json"
,
"nc"
,
"single"
,
"stack"
,
"python"
,
"rgb"
]
valid_out_modes
=
[
"json"
,
"nc"
,
"single"
,
"stack"
,
"python"
,
"rgb"
]
try
:
try
:
assert
out_mode
in
valid_out_modes
assert
out_mode
in
valid_out_modes
...
@@ -862,8 +867,6 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
...
@@ -862,8 +867,6 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
elif
out_mode
==
"single"
or
out_mode
==
"stack"
:
elif
out_mode
==
"single"
or
out_mode
==
"stack"
:
logger
.
info
(
"Converting data to %s tif-files ..."
%
out_mode
,
)
logger
.
info
(
"Converting data to %s tif-files ..."
%
out_mode
,
)
if
compress
:
tif_opts
=
"COMPRESS={}_PREDICTOR={}"
.
format
(
*
compress
.
split
(
"-"
)).
split
(
"_"
)
tif_list
=
json_to_tiff
(
out_mode
,
api_result
,
only_tile
,
outpath
,
out_prefix
,
wl
,
level
,
stack_resolution
,
tif_list
=
json_to_tiff
(
out_mode
,
api_result
,
only_tile
,
outpath
,
out_prefix
,
wl
,
level
,
stack_resolution
,
bands
,
tif_opts
=
tif_opts
,
logger
=
logger
)
bands
,
tif_opts
=
tif_opts
,
logger
=
logger
)
if
merge_tifs
is
True
:
if
merge_tifs
is
True
:
...
@@ -874,7 +877,7 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
...
@@ -874,7 +877,7 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
with
tempfile
.
TemporaryDirectory
(
dir
=
outpath
)
as
tmp_dir
:
with
tempfile
.
TemporaryDirectory
(
dir
=
outpath
)
as
tmp_dir
:
tif_list
=
json_to_tiff
(
"stack"
,
api_result
,
only_tile
,
tmp_dir
,
out_prefix
,
wl
,
level
,
stack_resolution
,
tif_list
=
json_to_tiff
(
"stack"
,
api_result
,
only_tile
,
tmp_dir
,
out_prefix
,
wl
,
level
,
stack_resolution
,
bands
,
logger
=
logger
)
bands
,
tif_opts
=
tif_opts
,
logger
=
logger
)
if
merge_tifs
is
True
:
if
merge_tifs
is
True
:
merge_tiles
(
tif_list
,
out_mode
=
"stack"
,
target_tile
=
merge_tile
)
merge_tiles
(
tif_list
,
out_mode
=
"stack"
,
target_tile
=
merge_tile
)
...
...
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