Commit c0b61093 authored by Julien Osman's avatar Julien Osman
Browse files

REFAC: Update applications so they use ImageMetadata instead of KeywordLists

parent e9e0091c
......@@ -209,7 +209,7 @@ private:
geometriesProjFilter->SetInput(inputGeomSet);
if (imageProjectionRef.empty())
{
geometriesProjFilter->SetOutputKeywordList(inputImg->GetImageKeywordlist()); // nec qd capteur
geometriesProjFilter->SetOutputImageMetadata(inputImg->GetImageMetadata());
}
geometriesProjFilter->SetOutputProjectionRef(imageProjectionRef);
geometriesProjFilter->SetOutput(outputGeomSet);
......
......@@ -375,7 +375,7 @@ private:
geometriesProjFilter->SetInput(inputGeomSet);
if (imageProjectionRef.empty())
{
geometriesProjFilter->SetOutputKeywordList(inputImg->GetImageKeywordlist()); // nec qd capteur
geometriesProjFilter->SetOutputImageMetadata(inputImg->GetImageMetadata());
}
geometriesProjFilter->SetOutputProjectionRef(imageProjectionRef);
geometriesProjFilter->SetOutput(outputGeomSet);
......
......@@ -333,17 +333,17 @@ private:
// Setting up RS Transform
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetInputKeywordList(image1->GetImageKeywordlist());
rsTransform->SetInputImageMetadata(image1->GetImageMetadata());
rsTransform->SetInputProjectionRef(image1->GetProjectionRef());
rsTransform->SetOutputKeywordList(image2->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(image2->GetImageMetadata());
rsTransform->SetOutputProjectionRef(image2->GetProjectionRef());
RSTransformType::Pointer rsTransform1ToWGS84 = RSTransformType::New();
rsTransform1ToWGS84->SetInputKeywordList(image1->GetImageKeywordlist());
rsTransform1ToWGS84->SetInputImageMetadata(image1->GetImageMetadata());
rsTransform1ToWGS84->SetInputProjectionRef(image1->GetProjectionRef());
RSTransformType::Pointer rsTransform2ToWGS84 = RSTransformType::New();
rsTransform2ToWGS84->SetInputKeywordList(image2->GetImageKeywordlist());
rsTransform2ToWGS84->SetInputImageMetadata(image2->GetImageMetadata());
rsTransform2ToWGS84->SetInputProjectionRef(image2->GetProjectionRef());
// Setting up output file
......
......@@ -291,7 +291,7 @@ private:
auto inImage = inList->GetNthElement(i);
auto rsTransformToWGS84 = RSTransformType::New();
rsTransformToWGS84->SetInputKeywordList(inImage->GetImageKeywordlist());
rsTransformToWGS84->SetInputImageMetadata(inImage->GetImageMetadata());
rsTransformToWGS84->SetInputProjectionRef(inImage->GetProjectionRef());
rsTransformToWGS84->SetOutputProjectionRef(static_cast<std::string>(otb::SpatialReference::FromWGS84().ToWkt()));
rsTransformToWGS84->InstantiateTransform();
......
......@@ -421,7 +421,7 @@ private:
{
RSTransformType::Pointer rsTransform = RSTransformType::New();
ImageType* inImage = GetParameterImage("in");
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(inImage->GetImageMetadata());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> ulp_in, lrp_in, ulp_out, lrp_out;
......@@ -480,7 +480,7 @@ private:
else // if ( GetParameterString( "mode.extent.unit" ) == "lonlat" )
{
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetInputKeywordList(input->GetImageKeywordlist());
rsTransform->SetInputImageMetadata(input->GetImageMetadata());
rsTransform->SetInputProjectionRef(input->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> ulp_in, lrp_in, ulp_out, lrp_out;
......@@ -538,7 +538,7 @@ private:
{
RSTransformType::Pointer rsTransform = RSTransformType::New();
ImageType* inImage = GetParameterImage("in");
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(inImage->GetImageMetadata());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> centerp_in, centerp_out;
......@@ -580,7 +580,7 @@ private:
else // if ( GetParameterString( "mode.radius.unitc" ) == "lon/lat" )
{
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(inImage->GetImageMetadata());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> centerp_in;
......@@ -653,7 +653,7 @@ private:
else // if ( GetParameterString("mode.radius.unitc") == "lonlat" )
{
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetInputKeywordList(input->GetImageKeywordlist());
rsTransform->SetInputImageMetadata(input->GetImageMetadata());
rsTransform->SetInputProjectionRef(input->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> centerp_in, centerp_out;
......@@ -718,7 +718,7 @@ private:
}
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetInputProjectionRef(inputProjectionRef);
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(inImage->GetImageMetadata());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> ulp_in, urp_in, llp_in, lrp_in;
......@@ -762,9 +762,9 @@ private:
RSTransformType::Pointer rsTransform = RSTransformType::New();
rsTransform->SetInputKeywordList(referencePtr->GetImageKeywordlist());
rsTransform->SetInputImageMetadata(referencePtr->GetImageMetadata());
rsTransform->SetInputProjectionRef(referencePtr->GetProjectionRef());
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(inImage->GetImageMetadata());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
......
......@@ -166,7 +166,7 @@ private:
std::string wktFromEpsg = otb::SpatialReference::FromEPSG(GetParameterInt("mode.epsg.code")).ToWkt();
inverse->SetOutputProjectionRef(wktFromEpsg);
}
inverse->SetInputKeywordList(inImage->GetImageKeywordlist());
inverse->SetInputImageMetadata(inImage->GetImageMetadata());
inverse->SetInputProjectionRef(inImage->GetProjectionRef());
inverse->InstantiateTransform();
itk::Point<float, 2> minPOut(0), maxPOut(0), minP(0), maxP(0);
......@@ -238,7 +238,7 @@ private:
std::string wktFromEpsg = otb::SpatialReference::FromEPSG(GetParameterInt("mode.epsg.code")).ToWkt();
rsTransform->SetInputProjectionRef(wktFromEpsg);
}
rsTransform->SetOutputKeywordList(inImage->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(inImage->GetImageMetadata());
rsTransform->SetOutputProjectionRef(inImage->GetProjectionRef());
rsTransform->InstantiateTransform();
itk::Point<float, 2> pixelIn(0), pixelOut(0);
......
......@@ -21,7 +21,7 @@
#include "otbWrapperApplication.h"
#include "otbWrapperApplicationFactory.h"
#include "otbForwardSensorModel.h"
#include "otbRPCForwardTransform.h"
#include "otbCoordinateToName.h"
namespace otb
......@@ -44,7 +44,7 @@ public:
itkTypeMacro(ConvertSensorToGeoPoint, otb::Application);
/** Filters typedef */
typedef otb::ForwardSensorModel<double> ModelType;
typedef otb::RPCForwardTransform<double, 2, 2> ModelType;
typedef itk::Point<double, 2> PointType;
private:
......@@ -111,7 +111,7 @@ private:
// Instantiate a ForwardSensor Model
ModelType::Pointer model = ModelType::New();
model->SetImageGeometry(inImage->GetImageKeywordlist());
model->SetMetadataModel(inImage->GetImageMetadata()[MDGeom::RPC]);
if (model->IsValidSensorModel() == false)
{
itkGenericExceptionMacro(<< "Unable to create a model");
......
......@@ -147,7 +147,7 @@ private:
m_OutputProjectionRef = outImage->GetProjectionRef(); // ~ wkt
if (m_OutputProjectionRef.empty())
{
m_GeometriesProjFilter->SetOutputKeywordList(outImage->GetImageKeywordlist()); // nec qd capteur
m_GeometriesProjFilter->SetOutputImageMetadata(outImage->GetImageMetadata());
}
}
else
......
......@@ -165,7 +165,7 @@ private:
}
rsTransform->SetOutputProjectionRef(colorPtr->GetProjectionRef());
rsTransform->SetOutputKeywordList(colorPtr->GetImageKeywordlist());
rsTransform->SetOutputImageMetadata(colorPtr->GetImageMetadata());
rsTransform->InstantiateTransform();
toMap->InstantiateTransform();
......
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