Orthorectification fails if L1B data are pseudo-projected/rotated
If the sensor geometry input data contain a map info with a rotation, the orthorectification fails:
2022/03/16 20:50:59: Starting orthorectification...
2022/03/16 20:50:59: Computed common target extent of orthorectified image (xmin, ymin, xmax, ymax in EPSG 32632): (620070.0, 5226540.0, 655080.0, 5262900.0)
2022/03/16 21:10:23: Orthorectifying VNIR data using 'nearest' resampling algorithm...
2022/03/16 21:11:46: Orthorectifying SWIR data using 'nearest' resampling algorithm...
2022/03/16 21:26:54: Merging VNIR and SWIR data...
2022/03/16 21:26:55: Orthorectifying 'mask_landwater' attribute...
FAILED
tests/test_orthorectification.py:110 (Test_Orthorectifier_DLR.test_run_transformation)
self = <tests.test_orthorectification.Test_Orthorectifier_DLR testMethod=test_run_transformation>
def test_run_transformation(self):
OR = Orthorectifier(config=self.config)
> L2_obj = OR.run_transformation(self.L1_obj)
test_orthorectification.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../enpt/processors/orthorectification/orthorectification.py:142: in run_transformation
attr_ortho = GeoArray(*GT_2D.to_map_geometry(attr, **kw_trafo), nodata=attr.nodata)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <enpt.processors.spatial_transform.spatial_transform.Geometry_Transformer object at 0x7f88f58d52b0>
path_or_geoarray_sensorgeo = <geoarray.baseclasses.GeoArray object at 0x7f88f75ed670>
tgt_prj = 32632, tgt_extent = (620070.0, 5226540.0, 655080.0, 5262900.0)
tgt_res = None, tgt_coordgrid = (array([ 0, 30]), array([ 0, 30]))
area_definition = None
def to_map_geometry(self,
path_or_geoarray_sensorgeo: Union[str, GeoArray, np.ndarray],
tgt_prj: Union[str, int] = None,
tgt_extent: Tuple[float, float, float, float] = None,
tgt_res: Tuple[float, float] = None,
tgt_coordgrid: Tuple[Tuple, Tuple] = None,
area_definition: AreaDefinition = None):
data_sensorgeo = GeoArray(path_or_geoarray_sensorgeo)
if data_sensorgeo.is_map_geo:
> raise RuntimeError('The dataset to be transformed into map geometry already represents map geometry.')
E RuntimeError: The dataset to be transformed into map geometry already represents map geometry.
../enpt/processors/spatial_transform/spatial_transform.py:87: RuntimeError