ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
gps.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <vector>
12 
13 #include "util/alignment.h"
14 #include "util/types.h"
15 
16 namespace colmap {
17 
18 // Transform ellipsoidal GPS coordinates to Cartesian GPS coordinate
19 // representation and vice versa.
20 class GPSTransform {
21 public:
22  enum ELLIPSOID { GRS80, WGS84 };
23 
24  explicit GPSTransform(const int ellipsoid = GRS80);
25 
26  std::vector<Eigen::Vector3d> EllToXYZ(
27  const std::vector<Eigen::Vector3d>& ell) const;
28 
29  std::vector<Eigen::Vector3d> XYZToEll(
30  const std::vector<Eigen::Vector3d>& xyz) const;
31 
32 private:
33  // Semimajor axis.
34  double a_;
35  // Semiminor axis.
36  double b_;
37  // Flattening.
38  double f_;
39  // Numerical eccentricity.
40  double e2_;
41 };
42 
43 } // namespace colmap
GPSTransform(const int ellipsoid=GRS80)
Definition: gps.cc:38
std::vector< Eigen::Vector3d > EllToXYZ(const std::vector< Eigen::Vector3d > &ell) const
Definition: gps.cc:57
std::vector< Eigen::Vector3d > XYZToEll(const std::vector< Eigen::Vector3d > &xyz) const
Definition: gps.cc:82