OTB  10.0.0
Orfeo Toolbox
otbGeometriesProjectionFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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>
36 {
37  boost::interprocess::unique_ptr<TGeometry, ogr::internal::GeometryDeleter> out(in ? static_cast<TGeometry*>(in->clone())
38  : nullptr); // OGR clone doesn't use covariant return ...
39  if (out)
41  ogr::UniqueGeometryPtr res(out.release());
42  return res;
43 }
44 
45 template <typename TGeometry>
47 {
48  if (inout)
49  m_Reprojector.do_transform(*inout);
50 }
51 
53 {
54  m_Transform = transform;
55 }
56 
57 
58 /*===========================================================================*/
59 /*======================[ GeometriesProjectionFilter ]=======================*/
60 /*===========================================================================*/
61 
62 inline void otb::GeometriesProjectionFilter::SetInputSpacing(ImageReference::SpacingType const& spacing)
63 {
64  m_InputImageReference.SetSpacing(spacing);
65 }
66 
67 inline void otb::GeometriesProjectionFilter::SetOutputSpacing(ImageReference::SpacingType const& spacing)
68 {
69  m_OutputImageReference.SetSpacing(spacing);
70 }
71 
72 inline void otb::GeometriesProjectionFilter::SetInputOrigin(ImageReference::OriginType const& origin)
73 {
74  m_InputImageReference.SetOrigin(origin);
75 }
76 
77 inline void otb::GeometriesProjectionFilter::SetOutputOrigin(ImageReference::OriginType const& origin)
78 {
79  m_OutputImageReference.SetOrigin(origin);
80 }
81 
82 #endif
void SetInputOrigin(ImageReference::OriginType const &origin)
void SetOutputSpacing(ImageReference::SpacingType const &spacing)
void SetOutputOrigin(ImageReference::OriginType const &origin)
void SetInputSpacing(ImageReference::SpacingType const &spacing)
boost::interprocess::unique_ptr< OGRGeometry, internal::GeometryDeleter > UniqueGeometryPtr
ogr::UniqueGeometryPtr operator()(TGeometry const *in) const
void SetOnePointTransformation(InternalTransformPointerType transform)