Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Belvire
otb
Commits
38019146
Commit
38019146
authored
15 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
BUG: RSTransform now gives priority to geographic transform over sensor model
parent
fb96a5e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Projections/otbGenericRSTransform.txx
+46
-45
46 additions, 45 deletions
Code/Projections/otbGenericRSTransform.txx
Code/Projections/otbOrthoRectificationFilter.txx
+4
-0
4 additions, 0 deletions
Code/Projections/otbOrthoRectificationFilter.txx
with
50 additions
and
45 deletions
Code/Projections/otbGenericRSTransform.txx
+
46
−
45
View file @
38019146
...
...
@@ -111,31 +111,9 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
//*****************************
try
{
if (m_InputKeywordList.GetSize() > 0)
{
typedef otb::ForwardSensorModel<double, InputSpaceDimension, InputSpaceDimension> ForwardSensorModelType;
typename ForwardSensorModelType::Pointer sensorModel = ForwardSensorModelType::New();
sensorModel->SetImageGeometry(m_InputKeywordList);
if ( !m_DEMDirectory.empty())
{
sensorModel->SetDEMDirectory(m_DEMDirectory);
}
else if (m_AverageElevation != -32768.0)
{
sensorModel->SetAverageElevation(m_AverageElevation);
}
m_InputTransform = sensorModel.GetPointer();
inputTransformIsSensor = true;
otbMsgDevMacro(<< "Input projection set to sensor model.");
}
}
catch(itk::ExceptionObject &)
{
otbMsgDevMacro(<<" Input keyword list does not describe a sensor model.");
}
if (
(m_InputTransform.IsNull()) && (
!m_InputProjectionRef.empty()
)
)//map projection
// First, try to make a geo transform
if (!m_InputProjectionRef.empty())//map projection
{
typedef otb::GenericMapProjection<otb::INVERSE, ScalarType, InputSpaceDimension, InputSpaceDimension> InverseMapProjectionType;
typename InverseMapProjectionType::Pointer mapTransform = InverseMapProjectionType::New();
...
...
@@ -146,9 +124,32 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
inputTransformIsMap = true;
otbMsgDevMacro(<< "Input projection set to map transform: " << m_InputTransform);
}
}
// If not, try to make a sensor model
if ((m_InputTransform.IsNull()) && (m_InputKeywordList.GetSize() > 0))
{
typedef otb::ForwardSensorModel<double, InputSpaceDimension, InputSpaceDimension> ForwardSensorModelType;
typename ForwardSensorModelType::Pointer sensorModel = ForwardSensorModelType::New();
sensorModel->SetImageGeometry(m_InputKeywordList);
if ( !m_DEMDirectory.empty())
{
sensorModel->SetDEMDirectory(m_DEMDirectory);
}
else if (m_AverageElevation != -32768.0)
{
sensorModel->SetAverageElevation(m_AverageElevation);
}
m_InputTransform = sensorModel.GetPointer();
inputTransformIsSensor = true;
otbMsgDevMacro(<< "Input projection set to sensor model.");
}
}
catch(itk::ExceptionObject &)
{
otbMsgDevMacro(<<" Input keyword list does not describe a sensor model.");
}
if (m_InputTransform.IsNull())//default if we didn't manage to instantiate it before
{
m_InputTransform = itk::IdentityTransform< double, NInputDimensions >::New();
...
...
@@ -182,19 +183,34 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
//*****************************
try
{
if (m_OutputKeywordList.GetSize() > 0)
// First, try to make a geo transform
if (!m_OutputProjectionRef.empty())//map projection
{
typedef otb::GenericMapProjection<otb::FORWARD, ScalarType, InputSpaceDimension, OutputSpaceDimension> ForwardMapProjectionType;
typename ForwardMapProjectionType::Pointer mapTransform = ForwardMapProjectionType::New();
mapTransform->SetWkt(m_OutputProjectionRef);
if (mapTransform->GetMapProjection() != NULL)
{
m_OutputTransform = mapTransform.GetPointer();
outputTransformIsMap = true;
otbMsgDevMacro(<< "Output projection set to map transform: " << m_OutputTransform);
}
}
// If not, try to make a sensor model
if ((m_OutputTransform.IsNull()) && (m_OutputKeywordList.GetSize() > 0))
{
typedef otb::InverseSensorModel<double, InputSpaceDimension, OutputSpaceDimension> InverseSensorModelType;
typename InverseSensorModelType::Pointer sensorModel = InverseSensorModelType::New();
sensorModel->SetImageGeometry(m_OutputKeywordList);
if ( !m_DEMDirectory.empty())
{
{
sensorModel->SetDEMDirectory(m_DEMDirectory);
}
}
else if (m_AverageElevation != -32768.0)
{
{
sensorModel->SetAverageElevation(m_AverageElevation);
}
}
m_OutputTransform = sensorModel.GetPointer();
outputTransformIsSensor = true;
otbMsgDevMacro(<< "Output projection set to sensor model");
...
...
@@ -205,21 +221,6 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions>
otbMsgDevMacro(<<" Output keyword list does not describe a sensor model.");
}
if ((m_OutputTransform.IsNull()) && ( !m_OutputProjectionRef.empty() ))//map projection
{
typedef otb::GenericMapProjection<otb::FORWARD, ScalarType, InputSpaceDimension, OutputSpaceDimension> ForwardMapProjectionType;
typename ForwardMapProjectionType::Pointer mapTransform = ForwardMapProjectionType::New();
mapTransform->SetWkt(m_OutputProjectionRef);
if (mapTransform->GetMapProjection() != NULL)
{
m_OutputTransform = mapTransform.GetPointer();
outputTransformIsMap = true;
otbMsgDevMacro(<< "Output projection set to map transform: " << m_OutputTransform);
}
}
if (m_OutputTransform.IsNull())//default if we didn't manage to instantiate it before
{
m_OutputTransform = itk::IdentityTransform< double, NOutputDimensions >::New();
...
...
This diff is collapsed.
Click to expand it.
Code/Projections/otbOrthoRectificationFilter.txx
+
4
−
0
View file @
38019146
...
...
@@ -77,6 +77,10 @@ OrthoRectificationFilter<TInputImage, TOutputImage, TMapProjection, TInterpolato
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projectionRef );
// Set an empty keyword list as the output is not in sensor geometry anymore
// ImageKeywordlist otb_kwl;
// itk::EncapsulateMetaData< ImageKeywordlist >(dict,MetaDataKey::OSSIMKeywordlistKey,otb_kwl);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment