21 #ifndef otbTileMapTransform_hxx
22 #define otbTileMapTransform_hxx
31 template <TransformDirection TTransformDirection,
class TScalarType,
unsigned int NInputDimensions,
unsigned int NOutputDimensions>
36 template <TransformDirection TTransformDirection,
class TScalarType,
unsigned int NInputDimensions,
unsigned int NOutputDimensions>
41 template <TransformDirection TTransformDirection,
class TScalarType,
unsigned int NInputDimensions,
unsigned int NOutputDimensions>
49 outputPoint[0] =
static_cast<double>(point[0]) / (1 << m_Depth) / 256 * 360.0 - 180.0;
50 double y =
static_cast<double>(point[1]) / (1 << m_Depth) / 256;
51 double ex = exp(4 *
CONST_PI * (y - 0.5));
52 outputPoint[1] = -180.0 /
CONST_PI * asin((ex - 1) / (ex + 1));
57 double x = (180.0 + point[0]) / 360.0;
58 double y = -point[1] *
CONST_PI / 180;
59 y = 0.5 * log((1 + sin(y)) / (1 - sin(y)));
63 outputPoint[0] = floor(x * pow(2.,
static_cast<double>(m_Depth)) * 256);
64 outputPoint[1] = floor(y * pow(2.,
static_cast<double>(m_Depth)) * 256);
69 template <TransformDirection TTransformDirection,
class TScalarType,
unsigned int NInputDimensions,
unsigned int NOutputDimensions>
74 template <TransformDirection TTransformDirection,
class TScalarType,
unsigned int NInputDimensions,
unsigned int NOutputDimensions>
77 this->SetDepth(level);
80 template <TransformDirection TTransformDirection,
class TScalarType,
unsigned int NInputDimensions,
unsigned int NOutputDimensions>
83 return this->GetDepth();