Change map projections backend to use Gdal instead of OSSIM
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.
See #1506 for the big picture.
New classes in GdalAdapters
There are two new classes in the GdalAdapters module :
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
Adapter/OssimAdaptersand its test
Core/Transform: all services offfered by this class are now available in
OGRSpatialSReferenceAdapter, which is the only entry point for spatial reference related operations
otb::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
Client code update and API change
otb::GenericMapProjectionhas been updated to use
SpatialReferenceinternally. 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.
- As a side benefit,
otb::VectorImagecan be any
stringaccepted by the
setFromUserInput()method in Gdal, that is used in
SpatialReferenceconstructor. "EPSG:xxxx" will work, as well as any proj formatted definition.
- I refrained myself for further refactoring, such as :
otb::OrthoRectificationFilterwhich does not bring anything valuable on to of
otb::GenericMapProjectionwhich does not bring anything valuable with respect to
CoordinateTransformation(apart from the
itk::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.
- 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.
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