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
1af867c4
Commit
1af867c4
authored
Dec 24, 2021
by
Jordi Inglada
Browse files
STYLE: rio.transform.Affine -> rio.Affine
parent
3844a355
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sensorsio/srtm.py
View file @
1af867c4
...
...
@@ -66,7 +66,7 @@ def srtm_tiles_from_mgrs_tile(tile: str) -> List[SRTMTileId]:
return
srtm_tiles_from_bbox
(
mgrs_bbox
(
tile
))
def
mgrs_transform
(
tile
:
str
):
def
mgrs_transform
(
tile
:
str
)
->
rio
.
Affine
:
ul
,
ur
,
ll
,
lr
,
_
=
mgrs_polygon
(
tile
).
exterior
.
coords
transformer
=
Transformer
.
from_crs
(
'+proj=latlong'
,
crs_for_mgrs_tile
(
tile
))
...
...
@@ -87,7 +87,7 @@ class DEM:
slope
:
np
.
ndarray
aspect
:
np
.
ndarray
crs
:
Optional
[
str
]
transform
:
Optional
[
rio
.
transform
.
Affine
]
transform
:
Optional
[
rio
.
Affine
]
def
as_stack
(
self
):
return
np
.
stack
([
self
.
elevation
,
self
.
slope
,
self
.
aspect
],
axis
=
0
)
...
...
@@ -134,9 +134,8 @@ of the SRTM tiles.
srtm_tiles
=
srtm_tiles_from_bbox
(
bbox
)
return
self
.
get_dem_from_tiles
(
srtm_tiles
)
def
__build_hgt
(
self
,
tiles
:
List
[
SRTMTileId
]
)
->
Tuple
[
np
.
ndarray
,
rio
.
transform
.
Affine
]:
def
__build_hgt
(
self
,
tiles
:
List
[
SRTMTileId
])
->
Tuple
[
np
.
ndarray
,
rio
.
Affine
]:
file_names
=
[
f
"
{
self
.
base_dir
}
/
{
srtm_id_to_name
(
t
)
}
.hgt"
for
t
in
tiles
]
...
...
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