Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julien Michel
sensorsio
Commits
e58b90d1
Commit
e58b90d1
authored
May 19, 2022
by
Julien Michel
Browse files
BUG: Avoid trying to read SRTM files that do not exist
parent
ee65853f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sensorsio/srtm.py
View file @
e58b90d1
...
...
@@ -5,6 +5,7 @@
from
dataclasses
import
dataclass
from
typing
import
Dict
,
List
,
Optional
,
Tuple
import
os
import
numpy
as
np
import
rasterio
as
rio
import
xarray
as
xr
...
...
@@ -136,6 +137,8 @@ class SRTM:
def
__build_hgt
(
self
,
tiles
:
List
[
SRTMTileId
])
->
Tuple
[
np
.
ndarray
,
rio
.
Affine
]:
file_names
=
[
f
"
{
self
.
base_dir
}
/
{
t
.
name
()
}
.hgt"
for
t
in
tiles
]
# Screen unavailable tiles
file_names
=
[
f
for
f
in
file_names
if
os
.
path
.
isfile
(
f
)]
return
merge
(
file_names
)
# type: ignore
def
read_as_numpy
(
...
...
Write
Preview
Supports
Markdown
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