Commit b4593aad authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed issue #95 (DEM_Creator: passing only 2 UTM coordinates causes No-Data...

Fixed issue #95 (DEM_Creator: passing only 2 UTM coordinates causes No-Data triangles at left and right side of DEM).
parent ddb9a05f
Pipeline #3267 passed with stage
in 18 minutes and 33 seconds
......@@ -26,7 +26,9 @@ from scipy.interpolate import interp1d
from geoarray import GeoArray
from py_tools_ds.geo.coord_calc import corner_coord_to_minmax
from py_tools_ds.geo.vector.geometry import boxObj
from py_tools_ds.geo.coord_trafo import transform_any_prj
from py_tools_ds.geo.projection import isProjectedOrGeographic
from py_tools_ds.numeric.vector import find_nearest
from ..options.config import GMS_config as CFG
......@@ -585,13 +587,18 @@ class DEM_Creator(object):
def from_extent(self, cornerCoords_tgt, prj, tgt_xgsd, tgt_ygsd):
"""Returns a GeoArray of a DEM according to the given target coordinates
:param cornerCoords_tgt: list of target coordinates [[X,Y], [X,Y], ...]]
:param cornerCoords_tgt: list of target coordinates [[X,Y], [X,Y], ...]] (at least 2 coordinates)
:param prj: WKT string of the projection belonging cornerCoords_tgt
:param tgt_xgsd: output X GSD
:param tgt_ygsd: output Y GSD
:return: DEM GeoArray
"""
# generate at least 4 coordinates in case less coords have been given in order to avoid nodata triangles in DEM
if len(cornerCoords_tgt) < 4 and isProjectedOrGeographic(prj) == 'projected':
co_yx = [(y, x) for x, y in cornerCoords_tgt]
cornerCoords_tgt = boxObj(boxMapYX=co_yx).boxMapXY
# handle coordinate infos
tgt_corner_coord_lonlat = self._get_corner_coords_lonlat(cornerCoords_tgt, prj)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment