OTB  6.7.0
Orfeo Toolbox
otbGeometriesProjectionFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbGeometriesProjectionFilter_hxx
22 #define otbGeometriesProjectionFilter_hxx
23 
24 /*===========================================================================*/
25 /*===============================[ Includes ]================================*/
26 /*===========================================================================*/
28 
29 
30 /*===========================================================================*/
31 /*====================[ ReprojectTransformationFunctor ]=====================*/
32 /*===========================================================================*/
33 
34 template <typename TGeometry>
35 inline
38 {
39  boost::interprocess::unique_ptr<TGeometry, ogr::internal::GeometryDeleter>
40  out(in ? static_cast <TGeometry*>(in->clone()) : nullptr); // OGR clone doesn't use covariant return ...
41  if (out)
43  ogr::UniqueGeometryPtr res(out.release());
44  return otb::move(res);
45 }
46 
47 template <typename TGeometry>
48 inline
49 void
51 {
52  if (inout)
53  m_Reprojector.do_transform(*inout);
54 }
55 
56 inline
58 {
59  m_Transform = transform;
60 }
61 
62 
63 /*===========================================================================*/
64 /*======================[ GeometriesProjectionFilter ]=======================*/
65 /*===========================================================================*/
66 
67 inline
69 {
70  m_InputImageReference.SetSpacing(spacing);
71 }
72 
73 inline
75 {
76  m_OutputImageReference.SetSpacing(spacing);
77 }
78 
79 inline
81 {
82  m_InputImageReference.SetOrigin(origin);
83 }
84 
85 inline
87 {
88  m_OutputImageReference.SetOrigin(origin);
89 }
90 
91 
92 inline
94 {
95  this->m_InputKeywordList = kwl;
96  this->Modified();
97 }
98 
99 inline
101 {
102  this->m_OutputKeywordList = kwl;
103  this->Modified();
104 }
105 
106 #endif
void SetInputKeywordList(const ImageKeywordlist &kwl)
Storage and conversion for OSSIM metadata.
void SetOutputSpacing(ImageReference::SpacingType const &spacing)
void SetOutputKeywordList(const ImageKeywordlist &kwl)
boost::interprocess::unique_ptr< OGRGeometry, internal::GeometryDeleter > UniqueGeometryPtr
void SetInputOrigin(ImageReference::OriginType const &origin)
void SetOutputOrigin(ImageReference::OriginType const &origin)
ogr::UniqueGeometryPtr operator()(TGeometry const *in) const
void SetOnePointTransformation(InternalTransformPointerType transform)
void SetInputSpacing(ImageReference::SpacingType const &spacing)