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
b526e53a
Commit
b526e53a
authored
13 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding an optionnal geoid file, and the possibility to use height above ellispoid
parent
239e32b0
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/IO/otbDEMToImageGenerator.h
+11
-0
11 additions, 0 deletions
Code/IO/otbDEMToImageGenerator.h
Code/IO/otbDEMToImageGenerator.txx
+37
-2
37 additions, 2 deletions
Code/IO/otbDEMToImageGenerator.txx
with
48 additions
and
2 deletions
Code/IO/otbDEMToImageGenerator.h
+
11
−
0
View file @
b526e53a
...
...
@@ -102,12 +102,22 @@ public:
itkSetObjectMacro
(
Transform
,
GenericRSTransformType
);
itkGetConstObjectMacro
(
Transform
,
GenericRSTransformType
);
/** Set/Get the above ellipsoid flag. If false, height is given
above MSL */
itkSetMacro
(
AboveEllipsoid
,
bool
);
itkGetMacro
(
AboveEllipsoid
,
bool
);
itkBooleanMacro
(
AboveEllipsoid
);
void
InstanciateTransform
();
/** Set the DEM directory. */
virtual
void
SetDEMDirectoryPath
(
const
char
*
DEMDirectory
);
virtual
void
SetDEMDirectoryPath
(
const
std
::
string
&
DEMDirectory
);
/** Set the DEM directory. */
virtual
void
SetGeoidFile
(
const
char
*
path
);
virtual
void
SetGeoidFile
(
const
std
::
string
&
path
);
/**
* Set/Get input & output projections.
* Set/Get input & output keywordlist
...
...
@@ -187,6 +197,7 @@ protected:
SpacingType
m_OutputSpacing
;
SizeType
m_OutputSize
;
PixelType
m_DefaultUnknownValue
;
bool
m_AboveEllipsoid
;
private
:
DEMToImageGenerator
(
const
Self
&
);
//purposely not implemented
...
...
This diff is collapsed.
Click to expand it.
Code/IO/otbDEMToImageGenerator.txx
+
37
−
2
View file @
b526e53a
...
...
@@ -36,6 +36,7 @@ DEMToImageGenerator<TDEMImage>
m_OutputSize[1] = 1;
m_OutputOrigin[0] = 0;
m_OutputOrigin[1] = 0;
m_AboveEllipsoid = false;
// Value defined in the norm for points SRTM doesn't have information.
m_DefaultUnknownValue = static_cast<PixelType>(-32768);
...
...
@@ -59,6 +60,22 @@ SetDEMDirectoryPath(const std::string& DEMDirectory)
this->SetDEMDirectoryPath(DEMDirectory.c_str());
}
template<class TDEMImage>
void
DEMToImageGenerator<TDEMImage>::
SetGeoidFile(const char* path)
{
m_DEMHandler->OpenGeoidFile(path);
}
template<class TDEMImage>
void
DEMToImageGenerator<TDEMImage>::
SetGeoidFile(const std::string& path)
{
this->SetGeoidFile(path.c_str());
}
// GenerateOutputInformation method
template <class TDEMImage>
void DEMToImageGenerator<TDEMImage>
...
...
@@ -146,11 +163,29 @@ DEMToImageGenerator<TDEMImage>
if(m_Transform.IsNotNull())
{
geoPoint = m_Transform->TransformPoint(phyPoint);
height = m_DEMHandler->GetHeightAboveMSL(geoPoint); // Altitude calculation
if(m_AboveEllipsoid)
{
height = m_DEMHandler->GetHeightAboveEllipsoid(geoPoint); // Altitude
// calculation
}
else
{
height = m_DEMHandler->GetHeightAboveMSL(geoPoint); // Altitude
// calculation
}
}
else
{
height = m_DEMHandler->GetHeightAboveMSL(phyPoint); // Altitude calculation
if(m_AboveEllipsoid)
{
height = m_DEMHandler->GetHeightAboveEllipsoid(phyPoint); // Altitude
// calculation
}
else
{
height = m_DEMHandler->GetHeightAboveMSL(phyPoint); // Altitude
// calculation
}
}
/* otbMsgDevMacro(<< "Index : (" << currentindex[0]<< "," << currentindex[1] << ") -> PhyPoint : ("
<< phyPoint[0] << "," << phyPoint[1] << ") -> GeoPoint: ("
...
...
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