Skip to content

Fix output image from orthorectification having no projection

Cédric Traizet requested to merge fix_orthorectification_projection into develop

Summary

After !707 (merged), the projection is written as a string in the ImageMetadata object attribute of otb::Image (and otb::VectorImage). This metadata is copied from source to destination in pipelines. However when a new image is created with another projection, the projection should be manually written (it was already the case with the old metadata framework, with another API). This is the case in the GenericRSTransformFilter, used in Orthorectifiaction.

This MR set the projection in the output of GenericRSTransformFilter.

Implementation Details

Tests

The GenericRSResampleImageFilter test has been updated to verify that the projection of the output image is correct. This is done by comparing a otb::SpatialReference initialized from the output projection string of the output to the otb::SpatialReference corresponding to the required UTM and hemisphere zone (input of the test). The comparison invokes the IsSame method of OGRSpatialReference on the two projections

This test is used with different inputs :

prTvOrthoRectification_qb-1_DEMGTIFF 
prTvOrthoRectification_qb-1_noDEM 
prTvOrthoRectification_qb-1_DEMSRTM
prTvOrthoRectification_rapideye-1_DEMGTIFF 
prTvOrthoRectification_sentinel1_noDEM
prTvOrthoRectification_rapideye-1_DEMSRTM 
prTvOrthoRectification_pleiades-1_noDEM 
prTvOrthoRectification_rapideye-1_noDEM 
prTvOrthoRectification_wv2-1_noDEM
prTvOrthoRectification_wv2-1_DEMGTIFF 
prTvOrthoRectification_sentinel1_DEMSRTM
prTvOrthoRectification_sentinel1_DEMGTIFF
prTvOrthoRectification_wv2-1_DEMSRTM 
prTvOrthoRectification_pleiades-1_DEMGTIFF 
prTvOrthoRectification_pleiades-1_DEMSRTM 
prTvOrthoRectification_ikonos-1_DEMSRTM 
prTvOrthoRectification_ikonos-1_DEMGTIFF
prTvOrthoRectification_spot6-1_noDEM
prTvOrthoRectification_ikonos-1_noDEM 
prTvOrthoRectification_spot6-1_DEMGTIFF 
prTvOrthoRectification_spot6-1_DEMSRTM 

Additional notes

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports