Skip to content
Snippets Groups Projects
Commit be5e2e0c authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH: use the geoid file when dem is set

parent 4cb4224a
No related branches found
No related tags found
No related merge requests found
......@@ -152,16 +152,18 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
if (!m_DEMDirectory.empty())
{
sensorModel->SetDEMDirectory(m_DEMDirectory);
// Set Geoid file only if used is used
if (!m_GeoidFile.empty())
{
sensorModel->SetGeoidFile(m_GeoidFile);
}
}
else if (m_AverageElevation != -32768.0)
{
sensorModel->SetAverageElevation(m_AverageElevation);
}
if (!m_GeoidFile.empty())
{
sensorModel->SetGeoidFile(m_GeoidFile);
}
m_InputTransform = sensorModel.GetPointer();
inputTransformIsSensor = true;
otbMsgDevMacro(<< "Input projection set to sensor model.");
......@@ -226,17 +228,17 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
if (!m_DEMDirectory.empty())
{
sensorModel->SetDEMDirectory(m_DEMDirectory);
// set the geoid file if any only when dem is used
if (!m_GeoidFile.empty())
{
sensorModel->SetGeoidFile(m_GeoidFile);
}
}
else if (m_AverageElevation != -32768.0)
{
sensorModel->SetAverageElevation(m_AverageElevation);
}
if (!m_GeoidFile.empty())
{
sensorModel->SetGeoidFile(m_GeoidFile);
}
m_OutputTransform = sensorModel.GetPointer();
outputTransformIsSensor = true;
otbMsgDevMacro(<< "Output projection set to sensor model");
......
......@@ -76,6 +76,9 @@ public:
itkSetStringMacro(GeoidFile);
itkGetStringMacro(GeoidFile);
itkSetMacro(AverageElevation, double);
itkGetMacro(AverageElevation, double);
void SetInputVectorData(InputVectorDataPointer input)
{
this->SetInput(input);
......@@ -123,6 +126,7 @@ private:
std::string m_DEMDirectory;
std::string m_GeoidFile;
double m_AverageElevation;
ImagePointerType m_InputImage;
......
......@@ -183,12 +183,14 @@ VectorDataIntoImageProjectionFilter<TInputVectorData, TInputImage>
if (!m_DEMDirectory.empty())
{
m_VdExtractFilter->SetDEMDirectory(m_DEMDirectory);
}
// Set the geoid file if dem is available
if (!m_GeoidFile.empty())
{
m_VdExtractFilter->SetGeoidFile(m_GeoidFile);
{
m_VdExtractFilter->SetGeoidFile(m_GeoidFile);
}
}
// Reproject VectorData in image projection
m_VdProjFilter->SetInputProjectionRef(this->GetInput()->GetProjectionRef());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment