OTB  10.0.0
Orfeo Toolbox
otbPlaceNameToLonLat.h
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 #ifndef otbPlaceNameToLonLat_h
21 #define otbPlaceNameToLonLat_h
22 
23 #include "otbCurlHelperInterface.h"
24 #include "OTBCartoExport.h"
25 #include <string>
26 
27 namespace otb
28 {
29 
38 class OTBCarto_EXPORT PlaceNameToLonLat : public itk::Object
39 {
40 public:
43  typedef itk::SmartPointer<Self> Pointer;
44  typedef itk::SmartPointer<const Self> ConstPointer;
45 
46  typedef itk::Object Superclass;
47 
48  itkTypeMacro(PlaceNameToLonLat, Object);
50  itkNewMacro(Self);
51 
52  itkGetMacro(Lon, double);
53  itkGetMacro(Lat, double);
54  itkGetMacro(PlaceName, std::string);
55 
56  itkSetMacro(PlaceName, std::string);
57 
58  virtual bool Evaluate();
59 
60 protected:
62  ~PlaceNameToLonLat() override
63  {
64  }
65  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
66  void RetrieveXML(const std::ostringstream& urlStream);
67  void ParseXMLYahoo();
70 
71 private:
72  PlaceNameToLonLat(const Self&) = delete;
73  void operator=(const Self&) = delete;
74 
75  double m_Lon;
76  double m_Lat;
77  std::string m_PlaceName;
78 
80  std::string m_CurlOutput;
82 };
83 
84 } // namespace otb
85 
86 #endif
itk::SmartPointer< Self > Pointer
Retrieve Longitude and Latitude coordinates from a place name.
itk::SmartPointer< Self > Pointer
void operator=(const Self &)=delete
virtual bool Evaluate()
PlaceNameToLonLat(const Self &)=delete
void RetrieveXML(const std::ostringstream &urlStream)
CurlHelperInterface::Pointer m_Curl
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::SmartPointer< const Self > ConstPointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.