Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
7396492a
Commit
7396492a
authored
Feb 29, 2008
by
Emmanuel Christophe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work in progress
parent
ae0cf050
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
265 additions
and
0 deletions
+265
-0
Code/Projections/otbNetworkedQuadTreeTransform.h
Code/Projections/otbNetworkedQuadTreeTransform.h
+129
-0
Code/Projections/otbNetworkedQuadTreeTransform.txx
Code/Projections/otbNetworkedQuadTreeTransform.txx
+136
-0
No files found.
Code/Projections/otbNetworkedQuadTreeTransform.h
0 → 100644
View file @
7396492a
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbNetworkedQuadTreeTransform_h
#define __otbNetworkedQuadTreeTransform_h
#include <iostream>
#include <sstream>
#include <stdio.h>
// #include "projection/ossimNetworkedQuadTreeTransform.h"
#include "itkTransform.h"
#include "itkExceptionObject.h"
#include "itkMacro.h"
#include "base/ossimGpt.h"
#include "base/ossimDpt.h"
#include "projection/ossimProjection.h"
#include "base/ossimEllipsoid.h"
#include "base/ossimEllipsoidFactory.h"
#include "base/ossimString.h"
#include "ossim/projection/ossimNetworkedQuadTreeModel.h"
#include "otbMapProjection.h"
namespace
otb
{
/** \class otbNetworkedQuadTreeTransform
* \brief to do
**/
template
<
InverseOrForwardTransformationEnum
transform
,
class
TScalarType
=
double
,
unsigned
int
NInputDimensions
=
2
,
unsigned
int
NOutputDimensions
=
2
>
class
ITK_EXPORT
NetworkedQuadTreeTransform
:
public
itk
::
Transform
<
TScalarType
,
// Data type for scalars
NInputDimensions
,
// Number of dimensions in the input space
NOutputDimensions
>
// Number of dimensions in the output space
{
public
:
/** Standard class typedefs. */
typedef
itk
::
Transform
<
TScalarType
,
NInputDimensions
,
NOutputDimensions
>
Superclass
;
typedef
NetworkedQuadTreeTransform
Self
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
typename
Superclass
::
ScalarType
ScalarType
;
typedef
ossimNetworkedQuadTreeModel
OssimNetworkedQuadTreeTransformType
;
typedef
itk
::
Point
<
ScalarType
,
NInputDimensions
>
InputPointType
;
typedef
itk
::
Point
<
ScalarType
,
NOutputDimensions
>
OutputPointType
;
/** Method for creation through the object factory. */
itkNewMacro
(
Self
);
/** Run-time type information (and related methods). */
itkTypeMacro
(
NetworkedQuadTreeTransform
,
Transform
);
typedef
InverseOrForwardTransformationEnum
DirectionOfMappingEnumType
;
itkStaticConstMacro
(
DirectionOfMapping
,
DirectionOfMappingEnumType
,
transform
);
itkStaticConstMacro
(
InputSpaceDimension
,
unsigned
int
,
NInputDimensions
);
itkStaticConstMacro
(
OutputSpaceDimension
,
unsigned
int
,
NOutputDimensions
);
itkStaticConstMacro
(
SpaceDimension
,
unsigned
int
,
NInputDimensions
);
itkStaticConstMacro
(
ParametersDimension
,
unsigned
int
,
NInputDimensions
*
(
NInputDimensions
+
1
));
void
SetLevel
(
unsigned
char
level
);
// virtual void SetEllipsoid ();
// void SetEllipsoid (const ossimEllipsoid &ellipsoid);
// void SetEllipsoid(std::string code);
// void SetEllipsoid(const double &major_axis, const double &minor_axis);
OutputPointType
TransformPoint
(
const
InputPointType
&
point
)
const
;
virtual
InputPointType
Origin
();
// virtual double GetFalseNorthing() const;
// virtual double GetFalseEasting() const;
// virtual double GetStandardParallel1() const;
// virtual double GetStandardParallel2() const;
// virtual std::string GetProjectionName() const;
// virtual bool IsGeographic() const;
// virtual double GetA() const;
// virtual double GetB() const;
// virtual double GetF() const;
// virtual OutputPointType GetMetersPerPixel() const;
// virtual OutputPointType GetDecimalDegreesPerPixel() const;
// virtual void SetAB(double a, double b);
// virtual void SetOrigin(const InputPointType &origin);
// virtual void SetMetersPerPixel(const OutputPointType &point);
// virtual void SetDecimalDegreesPerPixel(const OutputPointType &point);
// virtual void ComputeDegreesPerPixel(const InputPointType &ground, const OutputPointType &metersPerPixel, double &deltaLat, double &deltaLon);
// virtual void ComputeMetersPerPixel(const InputPointType ¢er, double deltaDegreesPerPixelLat, double deltaDegreesPerPixelLon, OutputPointType &metersPerPixel);
// virtual void ComputeMetersPerPixel(double deltaDegreesPerPixelLat, double deltaDegreesPerPixelLon, OutputPointType &metersPerPixel);
// //virtual void SetMatrix(double rotation, const OutputPointType &scale, const OutputPointType &translation);
// void SetFalseEasting(double falseEasting);
virtual
void
PrintMap
()
const
;
protected:
NetworkedQuadTreeTransform
();
virtual
~
NetworkedQuadTreeTransform
();
OssimNetworkedQuadTreeTransformType
*
m_NetworkedQuadTreeTransform
;
private
:
NetworkedQuadTreeTransform
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
};
}
// namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbNetworkedQuadTreeTransform.txx"
#endif
#endif
Code/Projections/otbNetworkedQuadTreeTransform.txx
0 → 100644
View file @
7396492a
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbNetworkedQuadTreeTransform_txx
#define __otbNetworkedQuadTreeTransform_txx
#include "otbNetworkedQuadTreeTransform.h"
#include "otbMacro.h"
namespace otb
{
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::NetworkedQuadTreeTransform() : Superclass(SpaceDimension,ParametersDimension)
{
m_NetworkedQuadTreeTransform = new OssimNetworkedQuadTreeTransformType();
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::~NetworkedQuadTreeTransform()
{
delete m_NetworkedQuadTreeTransform;
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
typename NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::TransformPoint(const InputPointType & point) const
{
OutputPointType outputPoint;
switch(DirectionOfMapping)
{
case INVERSE:
{
otbMsgDevMacro(<< "Cartographic coordinates: (" << point[0] << "," << point[1] << ")");
//from "itk::point" to "ossim::ossimDpt"
ossimDpt ossimDPoint(point[0], point[1]);
//map projection
ossimGpt ossimGPoint;
// ossimGPoint=m_NetworkedQuadTreeTransform->inverse(ossimDPoint);
m_NetworkedQuadTreeTransform->lineSampleToWorld(ossimDPoint, ossimGPoint);
// otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_NetworkedQuadTreeTransform->print(std::cout));
outputPoint[0]=ossimGPoint.lon;
outputPoint[1]=ossimGPoint.lat;
otbMsgDevMacro(<< "Geographic coordinates (long/lat) : (" << outputPoint[0] << "," << outputPoint[1] << ")");
break;
}
case FORWARD:
{
otbMsgDevMacro(<< "Geographic coordinates (long/lat) : (" << point[1] << "," << point[0] << ")");
//from "itk::point" to "ossim::ossimGpt"
ossimGpt ossimGPoint(point[1], point[0]);
//map projection
ossimDpt ossimDPoint;
// ossimDPoint=m_NetworkedQuadTreeTransform->forward(ossimGPoint);
m_NetworkedQuadTreeTransform->worldToLineSample(ossimGPoint, ossimDPoint);
// otbGenericMsgDebugMacro(<< "Forward : ========================= " << std::endl << m_NetworkedQuadTreeTransform->print(std::cout));
outputPoint[0]=ossimDPoint.x;
outputPoint[1]=ossimDPoint.y;
otbMsgDevMacro(<< "Cartographic coordinates: (" << outputPoint[0] << "," << outputPoint[1] << ")");
break;
}
default:
{
itkExceptionMacro(<<"Model is INVERSE or FORWARD only !!");
break;
}
}
return outputPoint;
}
///\return The geographic point corresponding to (0,0)
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
typename NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>::InputPointType
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::Origin()
{
ossimGpt ossimOrigin=m_NetworkedQuadTreeTransform->origin();
InputPointType otbOrigin;
otbOrigin[0]= ossimOrigin.lat;
otbOrigin[1]= ossimOrigin.lon;
return otbOrigin;
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void
NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::PrintMap() const
{
std::cout << m_NetworkedQuadTreeTransform->print(std::cout);
}
template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
void NetworkedQuadTreeTransform<Transform, TScalarType, NInputDimensions, NOutputDimensions>
::SetLevel(unsigned char level)
{
m_NetworkedQuadTreeTransform->setDepth(level);
}
} // namespace otb
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment