Change map projections backend to use Gdal instead of OSSIM
Summary
This Merge Request changes the map projection backend to use Gdal instead of OSSIM. It removes a lot of useless classes on the way, leading to a more compact code and reducing responsibilty spread.
Rationale
See #1506 (closed) for the big picture.
Implementation Details
New classes in GdalAdapters
There are two new classes in the GdalAdapters module :
- 
SpatialReference: wrapsOGRSpatialReferenceGdal class - 
CoordinateTransformation: wrapsOGRCoordinateTransformationGdal class 
Both classes follow the RAII principle : if the constructor succeeds, it returns a ready to use, almost immutable valid object. Internal instance is handled by std::unique_ptr. They are completely tested with a single test covering all methods, without any input or output (though the code of this test could be lighter if we were using a c++ unit test framework).
Example of use (from tests):
    SpatialReference wgs84sr = SpatialReference::FromWGS84();
    SpatialReference sr = SpatialReference::FromDescription("EPSG:32631");
    SpatialReference srFromEPSG = SpatialReference::FromEPSG(32631);
    SpatialReference srFromUTM = SpatialReference::FromUTM(31,SpatialReference::hemisphere::north);
    SpatialReference inSR = SpatialReference::FromDescription("EPSG:4326");
    SpatialReference outSR = SpatialReference::FromDescription("EPSG:32631");
    CoordinateTransformation transformation(inSR,outSR);
Removed classes and files
- 
otb::MapProjectionAdapterinAdapter/OssimAdaptersand its test - 
otb::GeoInformationConversioninCore/Transform: all services offfered by this class are now available inOGRSpatialSReferenceAdapter, which is the only entry point for spatial reference related operations - 
otb::*MapProjectionappart fromotb::GenericMapProjectionand their tests:otb::GenericMapProjectionalready covers all possible map projections. We do not need dedicated classes for each projection, and we surely do not need to define ourselves what the parameters for this or that projection should be! - head file 
otbMapProjections.h 
Client code update and API change
- 
otb::GenericMapProjectionhas been updated to useCoordinateTransformationandSpatialReferenceinternally. The API of the class has been modified to prevent abstraction leak and remove the ability to modify the spatial reference parameters, as it is something that we should not do in OTB. If someone wants a different spatial references, she can provide a new wkt! Appart from code removal, this is the only API change. - 
All client code of removed classes have been updated.
 
Additional notes
- As a side benefit, 
m_ProjectionRefinotb::Imageandotb::VectorImagecan be anystringaccepted by thesetFromUserInput()method in Gdal, that is used inSpatialReferenceconstructor. "EPSG:xxxx" will work, as well as any proj formatted definition. - I refrained myself for further refactoring, such as :
- Removing 
otb::OrthoRectificationFilterwhich does not bring anything valuable on to ofotb::GenericRSResampleImageFilter - Refactor 
otb::GenericMapProjectionwhich does not bring anything valuable with respect toCoordinateTransformation(apart from theitk::Transformpolymorphism). At least it could be rewritten as a non-template class. - Remove the 
*TileMap*classes which frankly are pure legacy code without any viable purpose. 
 - Removing 
 - There is small fork of a few line of OSSIM code regarding the UTM zone lookup in 
SpatialReferenceclass. Not sure how to deal with it properly. - One remaining task is the clean-up of baselines for all removed tests.
 
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