| AlbersEqualArea.hpp | | AlbersEqualArea.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file AlbersEqualArea.hpp | | * \file AlbersEqualArea.hpp | |
| * \brief Header for GeographicLib::AlbersEqualArea class | | * \brief Header for GeographicLib::AlbersEqualArea class | |
| * | | * | |
| * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | | * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_ALBERSEQUALAREA_HPP) | | #if !defined(GEOGRAPHICLIB_ALBERSEQUALAREA_HPP) | |
| #define GEOGRAPHICLIB_ALBERSEQUALAREA_HPP \ | | #define GEOGRAPHICLIB_ALBERSEQUALAREA_HPP \ | |
|
| "$Id: c9f194023273bee32876018a1f6a548e35303836 $" | | "$Id: d17f37d1bec84543dc3753e882d8e95f1c1d5a1b $" | |
| | | | |
| #include <algorithm> | | #include <algorithm> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Albers Equal Area Conic Projection | | * \brief Albers Equal Area Conic Projection | |
| * | | * | |
| * Implementation taken from the report, | | * Implementation taken from the report, | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| * meridian convergence, \e gamma, and azimuthal scale, \e k. A small sq
uare | | * meridian convergence, \e gamma, and azimuthal scale, \e k. A small sq
uare | |
| * aligned with the cardinal directions is projected to a rectangle with | | * aligned with the cardinal directions is projected to a rectangle with | |
| * dimensions \e k (in the E-W direction) and 1/\e k (in the N-S directio
n). | | * dimensions \e k (in the E-W direction) and 1/\e k (in the N-S directio
n). | |
| * The E-W sides of the rectangle are oriented \e gamma degrees | | * The E-W sides of the rectangle are oriented \e gamma degrees | |
| * counter-clockwise from the \e x axis. There is no provision in this c
lass | | * counter-clockwise from the \e x axis. There is no provision in this c
lass | |
| * for specifying a false easting or false northing or a different latitu
de | | * for specifying a false easting or false northing or a different latitu
de | |
| * of origin. | | * of origin. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-AlbersEqualArea.cpp | | * \include example-AlbersEqualArea.cpp | |
|
| | | * | |
| | | * <a href="ConicProj.1.html">ConicProj</a> is a command-line utility | |
| | | * providing access to the functionality of LambertConformalConic and | |
| | | * AlbersEqualArea. | |
| **********************************************************************/ | | **********************************************************************/ | |
| class GEOGRAPHIC_EXPORT AlbersEqualArea { | | class GEOGRAPHIC_EXPORT AlbersEqualArea { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| real _a, _f, _fm, _e2, _e, _e2m, _qZ, _qx; | | real _a, _f, _fm, _e2, _e, _e2m, _qZ, _qx; | |
| real _sign, _lat0, _k0; | | real _sign, _lat0, _k0; | |
| real _n0, _m02, _nrho0, _k2, _txi0, _scxi0, _sxi0; | | real _n0, _m02, _nrho0, _k2, _txi0, _scxi0, _sxi0; | |
| static const real eps_; | | static const real eps_; | |
| static const real epsx_; | | static const real epsx_; | |
| static const real epsx2_; | | static const real epsx2_; | |
| | | | |
| skipping to change at line 260 | | skipping to change at line 264 | |
| * the value used in the constructor. | | * the value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _a; } | | Math::real MajorRadius() const throw() { return _a; } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value use
d in | | * @return \e f the flattening of the ellipsoid. This is the value use
d in | |
| * the constructor. | | * the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _f; } | | Math::real Flattening() const throw() { return _f; } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() { return 1/_f; } | | Math::real InverseFlattening() const throw() { return 1/_f; } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return latitude of the origin for the projection (degrees). | | * @return latitude of the origin for the projection (degrees). | |
| * | | * | |
| * This is the latitude of minimum azimuthal scale and equals the \e st
dlat | | * This is the latitude of minimum azimuthal scale and equals the \e st
dlat | |
| * in the 1-parallel constructor and lies between \e stdlat1 and \e std
lat2 | | * in the 1-parallel constructor and lies between \e stdlat1 and \e std
lat2 | |
| * in the 2-parallel constructors. | | * in the 2-parallel constructors. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real OriginLatitude() const throw() { return _lat0; } | | Math::real OriginLatitude() const throw() { return _lat0; } | |
| | | | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| AzimuthalEquidistant.hpp | | AzimuthalEquidistant.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file AzimuthalEquidistant.hpp | | * \file AzimuthalEquidistant.hpp | |
| * \brief Header for GeographicLib::AzimuthalEquidistant class | | * \brief Header for GeographicLib::AzimuthalEquidistant class | |
| * | | * | |
| * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP) | | #if !defined(GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP) | |
| #define GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP \ | | #define GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP \ | |
|
| "$Id: 6b31d0e0568e56df40aca98af1cffc101b9819ca $" | | "$Id: 95a1d6e7a8c4613be25ec32550231601202da1e5 $" | |
| | | | |
| #include <GeographicLib/Geodesic.hpp> | | #include <GeographicLib/Geodesic.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Azimuthal Equidistant Projection. | | * \brief Azimuthal Equidistant Projection. | |
| * | | * | |
| * Azimuthal equidistant projection centered at an arbitrary position on
the | | * Azimuthal equidistant projection centered at an arbitrary position on
the | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| * \e y) and reciprocal scale \e rk in the azimuthal direction which, | | * \e y) and reciprocal scale \e rk in the azimuthal direction which, | |
| * together with the basic properties of the projection, serve to specify | | * together with the basic properties of the projection, serve to specify | |
| * completely the local affine transformation between geographic and | | * completely the local affine transformation between geographic and | |
| * projected coordinates. | | * projected coordinates. | |
| * | | * | |
| * The conversions all take place using a Geodesic object (by default | | * The conversions all take place using a Geodesic object (by default | |
| * Geodesic::WGS84). For more information on geodesics see \ref geodesic
. | | * Geodesic::WGS84). For more information on geodesics see \ref geodesic
. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-AzimuthalEquidistant.cpp | | * \include example-AzimuthalEquidistant.cpp | |
|
| | | * | |
| | | * <a href="GeodesicProj.1.html">GeodesicProj</a> is a command-line utili | |
| | | ty | |
| | | * providing access to the functionality of AzimuthalEquidistant, Gnomoni | |
| | | c, | |
| | | * and CassiniSoldner. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT AzimuthalEquidistant { | | class GEOGRAPHIC_EXPORT AzimuthalEquidistant { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| Geodesic _earth; | | Geodesic _earth; | |
| static const real eps_; | | static const real eps_; | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 132 | | skipping to change at line 136 | |
| * @return \e a the equatorial radius of the ellipsoid (meters). This
is | | * @return \e a the equatorial radius of the ellipsoid (meters). This
is | |
| * the value inherited from the Geodesic object used in the construct
or. | | * the value inherited from the Geodesic object used in the construct
or. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | | Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geodesic object used in the constructor. | | * inherited from the Geodesic object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _earth.Flattening(); } | | Math::real Flattening() const throw() { return _earth.Flattening(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return _earth.InverseFlattening(); } | | { return _earth.InverseFlattening(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP | | #endif // GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 10 lines changed or added | |
|
| CassiniSoldner.hpp | | CassiniSoldner.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file CassiniSoldner.hpp | | * \file CassiniSoldner.hpp | |
| * \brief Header for GeographicLib::CassiniSoldner class | | * \brief Header for GeographicLib::CassiniSoldner class | |
| * | | * | |
| * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_CASSINISOLDNER_HPP) | | #if !defined(GEOGRAPHICLIB_CASSINISOLDNER_HPP) | |
| #define GEOGRAPHICLIB_CASSINISOLDNER_HPP \ | | #define GEOGRAPHICLIB_CASSINISOLDNER_HPP \ | |
|
| "$Id: 91fb2cee323a1f955e28352ca6f67bd8700747ec $" | | "$Id: d794ea8a1e64fd9cbb8dcee34755b6dc4fee623a $" | |
| | | | |
| #include <GeographicLib/Geodesic.hpp> | | #include <GeographicLib/Geodesic.hpp> | |
| #include <GeographicLib/GeodesicLine.hpp> | | #include <GeographicLib/GeodesicLine.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Cassini-Soldner Projection. | | * \brief Cassini-Soldner Projection. | |
| * | | * | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| * The determination of (\e lat1, \e lon1) in the forward projection is b
y | | * The determination of (\e lat1, \e lon1) in the forward projection is b
y | |
| * solving the inverse geodesic problem for (\e lat, \e lon) and its twin | | * solving the inverse geodesic problem for (\e lat, \e lon) and its twin | |
| * obtained by reflection in the meridional plane. The scale is found by | | * obtained by reflection in the meridional plane. The scale is found by | |
| * determining where two neighboring geodesics intersecting the central | | * determining where two neighboring geodesics intersecting the central | |
| * meridian at \e lat1 and \e lat1 + \e dlat1 intersect and taking the ra
tio | | * meridian at \e lat1 and \e lat1 + \e dlat1 intersect and taking the ra
tio | |
| * of the reduced lengths for the two geodesics between that point and, | | * of the reduced lengths for the two geodesics between that point and, | |
| * respectively, (\e lat1, \e lon1) and (\e lat, \e lon). | | * respectively, (\e lat1, \e lon1) and (\e lat, \e lon). | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-CassiniSoldner.cpp | | * \include example-CassiniSoldner.cpp | |
|
| | | * | |
| | | * <a href="GeodesicProj.1.html">GeodesicProj</a> is a command-line utili | |
| | | ty | |
| | | * providing access to the functionality of AzimuthalEquidistant, Gnomoni | |
| | | c, | |
| | | * and CassiniSoldner. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT CassiniSoldner { | | class GEOGRAPHIC_EXPORT CassiniSoldner { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| Geodesic _earth; | | Geodesic _earth; | |
| GeodesicLine _meridian; | | GeodesicLine _meridian; | |
| real _sbet0, _cbet0; | | real _sbet0, _cbet0; | |
| static const real eps1_; | | static const real eps1_; | |
| static const real tiny_; | | static const real tiny_; | |
| | | | |
| skipping to change at line 225 | | skipping to change at line 229 | |
| * @return \e a the equatorial radius of the ellipsoid (meters). This
is | | * @return \e a the equatorial radius of the ellipsoid (meters). This
is | |
| * the value inherited from the Geodesic object used in the construct
or. | | * the value inherited from the Geodesic object used in the construct
or. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | | Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geodesic object used in the constructor. | | * inherited from the Geodesic object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _earth.Flattening(); } | | Math::real Flattening() const throw() { return _earth.Flattening(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return _earth.InverseFlattening(); } | | { return _earth.InverseFlattening(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_CASSINISOLDNER_HPP | | #endif // GEOGRAPHICLIB_CASSINISOLDNER_HPP | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 10 lines changed or added | |
|
| Constants.hpp | | Constants.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file Constants.hpp | | * \file Constants.hpp | |
| * \brief Header for GeographicLib::Constants class | | * \brief Header for GeographicLib::Constants class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_CONSTANTS_HPP) | | #if !defined(GEOGRAPHICLIB_CONSTANTS_HPP) | |
| #define GEOGRAPHICLIB_CONSTANTS_HPP \ | | #define GEOGRAPHICLIB_CONSTANTS_HPP \ | |
|
| "$Id: 8e3be453716fd6f8a03fa6308f958f95cbafef31 $" | | "$Id: 895e4bd91979aae347436bbf6be37964f05f5b6f $" | |
| | | | |
| #include <GeographicLib/Config.h> | | #include <GeographicLib/Config.h> | |
| | | | |
| /** | | /** | |
| * A compile-time assert. Use C++11 static_assert, if available. | | * A compile-time assert. Use C++11 static_assert, if available. | |
| **********************************************************************/ | | **********************************************************************/ | |
| #if !defined(STATIC_ASSERT) | | #if !defined(STATIC_ASSERT) | |
| # if defined(__GXX_EXPERIMENTAL_CXX0X__) | | # if defined(__GXX_EXPERIMENTAL_CXX0X__) | |
| # define STATIC_ASSERT static_assert | | # define STATIC_ASSERT static_assert | |
| # elif defined(_MSC_VER) && _MSC_VER >= 1600 | | # elif defined(_MSC_VER) && _MSC_VER >= 1600 | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 130 | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| template<typename T> static inline T WGS84_GM() throw() | | template<typename T> static inline T WGS84_GM() throw() | |
| { return T(3986004) * T(100000000) + T(41800000); } | | { return T(3986004) * T(100000000) + T(41800000); } | |
| /** | | /** | |
| * @tparam T the type of the returned value. | | * @tparam T the type of the returned value. | |
| * @return the angular velocity of the the WGS84 ellipsoid, \e omega, i
n | | * @return the angular velocity of the the WGS84 ellipsoid, \e omega, i
n | |
| * rad s<sup>-1</sup>. | | * rad s<sup>-1</sup>. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| template<typename T> static inline T WGS84_omega() throw() | | template<typename T> static inline T WGS84_omega() throw() | |
| { return T(7292115) / (T(1000000) * T(100000)); } | | { return T(7292115) / (T(1000000) * T(100000)); } | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return the reciprocal flattening of WGS84 ellipsoid. | | * @return the reciprocal flattening of WGS84 ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| template<typename T> static inline T WGS84_r() throw() | | template<typename T> static inline T WGS84_r() throw() | |
| { return 1/WGS84_f<T>(); } | | { return 1/WGS84_f<T>(); } | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * A synonym for WGS84_r<real>(). | | * A synonym for WGS84_r<real>(). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| | | /// \endcond | |
| static inline Math::real WGS84_r() throw() { return WGS84_r<real>(); } | | static inline Math::real WGS84_r() throw() { return WGS84_r<real>(); } | |
| /** | | /** | |
| * @tparam T the type of the returned value. | | * @tparam T the type of the returned value. | |
| * @return the equatorial radius of GRS80 ellipsoid, \e a, in m. | | * @return the equatorial radius of GRS80 ellipsoid, \e a, in m. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| template<typename T> static inline T GRS80_a() throw() | | template<typename T> static inline T GRS80_a() throw() | |
| { return T(6378137); } | | { return T(6378137); } | |
| /** | | /** | |
| * @tparam T the type of the returned value. | | * @tparam T the type of the returned value. | |
| * @return the gravitational constant of the GRS80 ellipsoid, \e GM, in | | * @return the gravitational constant of the GRS80 ellipsoid, \e GM, in | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 3 lines changed or added | |
|
| DMS.hpp | | DMS.hpp | |
| /** | | /** | |
| * \file DMS.hpp | | * \file DMS.hpp | |
| * \brief Header for GeographicLib::DMS class | | * \brief Header for GeographicLib::DMS class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_DMS_HPP) | | #if !defined(GEOGRAPHICLIB_DMS_HPP) | |
|
| #define GEOGRAPHICLIB_DMS_HPP "$Id: a4b640a5a1717ba5a969b8e28c3e3bb1b1d22c1
2 $" | | #define GEOGRAPHICLIB_DMS_HPP "$Id: 67770a78c105495a31a9d3755c811e938729c85
a $" | |
| | | | |
| #include <sstream> | | #include <sstream> | |
| #include <iomanip> | | #include <iomanip> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/Utility.hpp> | | #include <GeographicLib/Utility.hpp> | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| // Squelch warnings about dll vs string | | // Squelch warnings about dll vs string | |
| #pragma warning (push) | | #pragma warning (push) | |
| #pragma warning (disable: 4251) | | #pragma warning (disable: 4251) | |
| | | | |
| skipping to change at line 194 | | skipping to change at line 194 | |
| * @param[in] s arc seconds. | | * @param[in] s arc seconds. | |
| * @return angle (degrees) | | * @return angle (degrees) | |
| * | | * | |
| * This does not propagate the sign on \e d to the other components, so | | * This does not propagate the sign on \e d to the other components, so | |
| * -3d20' would need to be represented as - DMS::Decode(3.0, 20.0) or | | * -3d20' would need to be represented as - DMS::Decode(3.0, 20.0) or | |
| * DMS::Decode(-3.0, -20.0). | | * DMS::Decode(-3.0, -20.0). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real Decode(real d, real m = 0, real s = 0) throw() | | static Math::real Decode(real d, real m = 0, real s = 0) throw() | |
| { return d + (m + s/real(60))/real(60); } | | { return d + (m + s/real(60))/real(60); } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> (use Utility::num, instead). | | * <b>DEPRECATED</b> (use Utility::num, instead). | |
| * Convert a string to a real number. | | * Convert a string to a real number. | |
| * | | * | |
| * @param[in] str string input. | | * @param[in] str string input. | |
| * @return decoded number. | | * @return decoded number. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| static Math::real Decode(const std::string& str) { | | static Math::real Decode(const std::string& str) | |
| return Utility::num<real>(str); | | { return Utility::num<real>(str); } | |
| } | | | |
| | | | |
| /** | | /** | |
| * <b>DEPRECATED</b> (use Utility::fract, instead). | | * <b>DEPRECATED</b> (use Utility::fract, instead). | |
| * Convert a string to a real number treating the case where the string
is | | * Convert a string to a real number treating the case where the string
is | |
| * a simple fraction. | | * a simple fraction. | |
| * | | * | |
| * @param[in] str string input. | | * @param[in] str string input. | |
| * @return decoded number. | | * @return decoded number. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| static Math::real DecodeFraction(const std::string& str) { | | static Math::real DecodeFraction(const std::string& str) | |
| return Utility::fract<real>(str); | | { return Utility::fract<real>(str); } | |
| } | | /// \endcond | |
| | | | |
| /** | | /** | |
| * Convert a pair of strings to latitude and longitude. | | * Convert a pair of strings to latitude and longitude. | |
| * | | * | |
| * @param[in] dmsa first string. | | * @param[in] dmsa first string. | |
| * @param[in] dmsb second string. | | * @param[in] dmsb second string. | |
| * @param[out] lat latitude. | | * @param[out] lat latitude. | |
| * @param[out] lon longitude. | | * @param[out] lon longitude. | |
| * @param[in] swaplatlong if true assume longitude is given before lati
tude | | * @param[in] swaplatlong if true assume longitude is given before lati
tude | |
| * in the absence of hemisphere designators (default false). | | * in the absence of hemisphere designators (default false). | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 272 | |
| | | | |
| /** | | /** | |
| * Convert angle (in degrees) into a DMS string (using d, ', and "
). | | * Convert angle (in degrees) into a DMS string (using d, ', and "
). | |
| * | | * | |
| * @param[in] angle input angle (degrees) | | * @param[in] angle input angle (degrees) | |
| * @param[in] trailing DMS::component value indicating the trailing uni
ts | | * @param[in] trailing DMS::component value indicating the trailing uni
ts | |
| * on the string and this is given as a decimal number if necessary. | | * on the string and this is given as a decimal number if necessary. | |
| * @param[in] prec the number of digits after the decimal point for the | | * @param[in] prec the number of digits after the decimal point for the | |
| * trailing component. | | * trailing component. | |
| * @param[in] ind DMS::flag value indicated additional formatting. | | * @param[in] ind DMS::flag value indicated additional formatting. | |
|
| | | * @param[in] dmssep if non-null, use as the DMS separator character | |
| | | * (instead of d, ', " delimiters). | |
| * @return formatted string | | * @return formatted string | |
| * | | * | |
| * The interpretation of \e ind is as follows: | | * The interpretation of \e ind is as follows: | |
| * - ind == DMS::NONE, signed result no leading zeros on degrees except
in | | * - ind == DMS::NONE, signed result no leading zeros on degrees except
in | |
| * the units place, e.g., -8d03'. | | * the units place, e.g., -8d03'. | |
| * - ind == DMS::LATITUDE, trailing N or S hemisphere designator, no si
gn, | | * - ind == DMS::LATITUDE, trailing N or S hemisphere designator, no si
gn, | |
| * pad degrees to 2 digits, e.g., 08d03'S. | | * pad degrees to 2 digits, e.g., 08d03'S. | |
| * - ind == DMS::LONGITUDE, trailing E or W hemisphere designator, no | | * - ind == DMS::LONGITUDE, trailing E or W hemisphere designator, no | |
| * sign, pad degrees to 3 digits, e.g., 008d03'W. | | * sign, pad degrees to 3 digits, e.g., 008d03'W. | |
| * - ind == DMS::AZIMUTH, convert to the range [0, 360<sup>o</sup>), no | | * - ind == DMS::AZIMUTH, convert to the range [0, 360<sup>o</sup>), no | |
| * sign, pad degrees to 3 digits, , e.g., 351d57'. | | * sign, pad degrees to 3 digits, , e.g., 351d57'. | |
| * . | | * . | |
| * The integer parts of the minutes and seconds components are always g
iven | | * The integer parts of the minutes and seconds components are always g
iven | |
| * with 2 digits. | | * with 2 digits. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static std::string Encode(real angle, component trailing, unsigned prec
, | | static std::string Encode(real angle, component trailing, unsigned prec
, | |
|
| | | flag ind, char dmssep); | |
| | | | |
| | | /** | |
| | | * Convert angle (in degrees) into a DMS string (using d, ', and " | |
| | | ). | |
| | | * | |
| | | * @param[in] angle input angle (degrees) | |
| | | * @param[in] trailing DMS::component value indicating the trailing uni | |
| | | ts | |
| | | * on the string and this is given as a decimal number if necessary. | |
| | | * @param[in] prec the number of digits after the decimal point for the | |
| | | * trailing component. | |
| | | * @param[in] ind DMS::flag value indicated additional formatting. | |
| | | * @return formatted string | |
| | | * | |
| | | * <b>COMPATIBILITY NOTE:</b> This function calls | |
| | | * Encode(real, component, unsigned, flag, char) with a 5th | |
| | | * argument of char(0). At some point, | |
| | | * Encode(real, component, unsigned, flag) and will be withdrawn | |
| | | * and the interface to | |
| | | * Encode(real, component, unsigned, flag, char) changed so that | |
| | | * its 4th and 5th arguments have default values. This will | |
| | | * preserve source-level compatibility. | |
| | | ********************************************************************** | |
| | | / | |
| | | static std::string Encode(real angle, component trailing, unsigned prec | |
| | | , | |
| flag ind = NONE); | | flag ind = NONE); | |
| | | | |
| /** | | /** | |
| * Convert angle into a DMS string (using d, ', and ") selecting t
he | | * Convert angle into a DMS string (using d, ', and ") selecting t
he | |
| * trailing component based on the precision. | | * trailing component based on the precision. | |
| * | | * | |
| * @param[in] angle input angle (degrees) | | * @param[in] angle input angle (degrees) | |
| * @param[in] prec the precision relative to 1 degree. | | * @param[in] prec the precision relative to 1 degree. | |
| * @param[in] ind DMS::flag value indicated additional formatting. | | * @param[in] ind DMS::flag value indicated additional formatting. | |
|
| | | * @param[in] dmssep if non-null, use as the DMS separator character | |
| | | * (instead of d, ', " delimiters). | |
| * @return formatted string | | * @return formatted string | |
| * | | * | |
| * \e prec indicates the precision relative to 1 degree, e.g., \e prec
= 3 | | * \e prec indicates the precision relative to 1 degree, e.g., \e prec
= 3 | |
| * gives a result accurate to 0.1' and \e prec = 4 gives a result accur
ate | | * gives a result accurate to 0.1' and \e prec = 4 gives a result accur
ate | |
| * to 1". \e ind is interpreted as in DMS::Encode with the additi
onal | | * to 1". \e ind is interpreted as in DMS::Encode with the additi
onal | |
| * facility that DMS::NUMBER represents \e angle as a number in fixed | | * facility that DMS::NUMBER represents \e angle as a number in fixed | |
| * format with precision \e prec. | | * format with precision \e prec. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| static std::string Encode(real angle, unsigned prec, flag ind = NONE) { | | static std::string Encode(real angle, unsigned prec, flag ind = NONE, | |
| | | char dmssep = char(0)) { | |
| return ind == NUMBER ? Utility::str<real>(angle, int(prec)) : | | return ind == NUMBER ? Utility::str<real>(angle, int(prec)) : | |
| Encode(angle, | | Encode(angle, | |
| prec < 2 ? DEGREE : (prec < 4 ? MINUTE : SECOND), | | prec < 2 ? DEGREE : (prec < 4 ? MINUTE : SECOND), | |
| prec < 2 ? prec : (prec < 4 ? prec - 2 : prec - 4), | | prec < 2 ? prec : (prec < 4 ? prec - 2 : prec - 4), | |
|
| ind); | | ind, dmssep); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Split angle into degrees and minutes | | * Split angle into degrees and minutes | |
| * | | * | |
| * @param[in] ang angle (degrees) | | * @param[in] ang angle (degrees) | |
| * @param[out] d degrees (an integer returned as a real) | | * @param[out] d degrees (an integer returned as a real) | |
| * @param[out] m arc minutes. | | * @param[out] m arc minutes. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static void Encode(real ang, real& d, real& m) throw() { | | static void Encode(real ang, real& d, real& m) throw() { | |
| | | | |
End of changes. 9 change blocks. |
| 9 lines changed or deleted | | 41 lines changed or added | |
|
| GeoCoords.hpp | | GeoCoords.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file GeoCoords.hpp | | * \file GeoCoords.hpp | |
| * \brief Header for GeographicLib::GeoCoords class | | * \brief Header for GeographicLib::GeoCoords class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #ifndef GEOGRAPHICLIB_GEOCOORDS_HPP | | #ifndef GEOGRAPHICLIB_GEOCOORDS_HPP | |
| #define GEOGRAPHICLIB_GEOCOORDS_HPP \ | | #define GEOGRAPHICLIB_GEOCOORDS_HPP \ | |
|
| "$Id: 0e3e97086e04d9bf0f3c6154d97645fc17f9133d $" | | "$Id: e706d3a35c3be0e2beaf39041cac29beb468a5aa $" | |
| | | | |
| #include <GeographicLib/UTMUPS.hpp> | | #include <GeographicLib/UTMUPS.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Conversion between geographic coordinates | | * \brief Conversion between geographic coordinates | |
| * | | * | |
| * This class stores a geographic position which may be set via the | | * This class stores a geographic position which may be set via the | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| * Methods are provided to return the geographic coordinates, the input U
TM | | * Methods are provided to return the geographic coordinates, the input U
TM | |
| * or UPS coordinates (and associated meridian convergence and scale), or | | * or UPS coordinates (and associated meridian convergence and scale), or | |
| * alternate UTM or UPS coordinates (and their associated meridian | | * alternate UTM or UPS coordinates (and their associated meridian | |
| * convergence and scale). | | * convergence and scale). | |
| * | | * | |
| * Once the input string has been parsed, you can print the result out in
any | | * Once the input string has been parsed, you can print the result out in
any | |
| * of the formats, decimal degrees, degrees minutes seconds, MGRS, UTM/UP
S. | | * of the formats, decimal degrees, degrees minutes seconds, MGRS, UTM/UP
S. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-GeoCoords.cpp | | * \include example-GeoCoords.cpp | |
|
| | | * | |
| | | * <a href="GeoConvert.1.html">GeoConvert</a> is a command-line utility | |
| | | * providing access to the functionality of GeoCoords. | |
| **********************************************************************/ | | **********************************************************************/ | |
| class GEOGRAPHIC_EXPORT GeoCoords { | | class GEOGRAPHIC_EXPORT GeoCoords { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| real _lat, _long, _easting, _northing, _gamma, _k; | | real _lat, _long, _easting, _northing, _gamma, _k; | |
| bool _northp; | | bool _northp; | |
| int _zone; // See UTMUPS::zonespec | | int _zone; // See UTMUPS::zonespec | |
| mutable real _alt_easting, _alt_northing, _alt_gamma, _alt_k; | | mutable real _alt_easting, _alt_northing, _alt_gamma, _alt_k; | |
| mutable int _alt_zone; | | mutable int _alt_zone; | |
| | | | |
| | | | |
| skipping to change at line 106 | | skipping to change at line 109 | |
| * string is broken into space (or comma) separated pieces and Basic | | * string is broken into space (or comma) separated pieces and Basic | |
| * decision on which format is based on number of components | | * decision on which format is based on number of components | |
| * -# MGRS | | * -# MGRS | |
| * -# "Lat Long" or "Long Lat" | | * -# "Lat Long" or "Long Lat" | |
| * -# "Zone Easting Northing" or "Easting Northing Zone" | | * -# "Zone Easting Northing" or "Easting Northing Zone" | |
| * | | * | |
| * The following inputs are approximately the same (Ar Ramadi Bridge, I
raq) | | * The following inputs are approximately the same (Ar Ramadi Bridge, I
raq) | |
| * - Latitude and Longitude | | * - Latitude and Longitude | |
| * - 33.44 43.27 | | * - 33.44 43.27 | |
| * - N33d26.4' E43d16.2' | | * - N33d26.4' E43d16.2' | |
|
| * - 43d16'12"E 33d26'24"N | | * - 43d16'12"E 33d26'24"N | |
| | | * - 43:16:12E 33:26:24 | |
| * - MGRS | | * - MGRS | |
| * - 38SLC301 | | * - 38SLC301 | |
| * - 38SLC391014 | | * - 38SLC391014 | |
| * - 38SLC3918701405 | | * - 38SLC3918701405 | |
| * - 37SHT9708 | | * - 37SHT9708 | |
| * - UTM | | * - UTM | |
| * - 38N 339188 3701405 | | * - 38N 339188 3701405 | |
| * - 897039 3708229 37N | | * - 897039 3708229 37N | |
| * | | * | |
| * Latitude and Longitude parsing. Latitude precedes longitude, unless
a | | * Latitude and Longitude parsing. Latitude precedes longitude, unless
a | |
| * N, S, E, W hemisphere designator is used on one or both coordinates.
If | | * N, S, E, W hemisphere designator is used on one or both coordinates.
If | |
| * \e swaplatlong = true (default is false), then longitude precedes | | * \e swaplatlong = true (default is false), then longitude precedes | |
| * latitude in the absence of a hemisphere designator. Thus (with \e | | * latitude in the absence of a hemisphere designator. Thus (with \e | |
| * swaplatlong = false) | | * swaplatlong = false) | |
| * - 40 -75 | | * - 40 -75 | |
| * - N40 W75 | | * - N40 W75 | |
| * - -75 N40 | | * - -75 N40 | |
| * - 75W 40N | | * - 75W 40N | |
| * - E-75 -40S | | * - E-75 -40S | |
| * . | | * . | |
|
| * are all the same position. The coordinates may be given in decimal | | * are all the same position. The coordinates may be given in | |
| * degrees, degrees and decimal minutes, degrees, minutes, seconds, etc | | * decimal degrees, degrees and decimal minutes, degrees, minutes, | |
| . | | * seconds, etc. Use d, ', and " to mark off the degrees, | |
| * Use d, ', and " to make off the degrees, minutes and seconds. Thus | | * minutes and seconds. Alternatively, use : to separate these | |
| * - 40d30'30" | | * components. Thus | |
| | | * - 40d30'30" | |
| * - 40d30'30 | | * - 40d30'30 | |
| * - 40d30.5' | | * - 40d30.5' | |
| * - 40d30.5 | | * - 40d30.5 | |
|
| | | * - 40:30:30 | |
| | | * - 40:30.5 | |
| * - 40.508333333 | | * - 40.508333333 | |
| * . | | * . | |
| * all specify the same angle. The leading sign applies to all compone
nts | | * all specify the same angle. The leading sign applies to all compone
nts | |
| * so -1d30 is -(1+30/60) = -1.5. Latitudes must be in the range [-90,
90] | | * so -1d30 is -(1+30/60) = -1.5. Latitudes must be in the range [-90,
90] | |
| * and longitudes in the range [-180, 360]. Internally longitudes are | | * and longitudes in the range [-180, 360]. Internally longitudes are | |
| * reduced to the range [-180, 180). | | * reduced to the range [-180, 180). | |
| * | | * | |
| * UTM/UPS parsing. For UTM zones (-80 <= Lat <= 84), the zone designa
tor | | * UTM/UPS parsing. For UTM zones (-80 <= Lat <= 84), the zone designa
tor | |
| * is made up of a zone number (for 1 to 60) and a hemisphere letter (N
or | | * is made up of a zone number (for 1 to 60) and a hemisphere letter (N
or | |
| * S), e.g., 38N. The latitude zone designer ([C–M] in the south
ern | | * S), e.g., 38N. The latitude zone designer ([C–M] in the south
ern | |
| | | | |
| skipping to change at line 357 | | skipping to change at line 365 | |
| * - prec = 9 (max), 10<sup>-14</sup>d | | * - prec = 9 (max), 10<sup>-14</sup>d | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| std::string GeoRepresentation(int prec = 0, bool swaplatlong = false) c
onst; | | std::string GeoRepresentation(int prec = 0, bool swaplatlong = false) c
onst; | |
| | | | |
| /** | | /** | |
| * String representation with latitude and longitude as degrees, minute
s, | | * String representation with latitude and longitude as degrees, minute
s, | |
| * seconds, and hemisphere. | | * seconds, and hemisphere. | |
| * | | * | |
| * @param[in] prec precision (relative to about 1m) | | * @param[in] prec precision (relative to about 1m) | |
| * @param[in] swaplatlong if true give longitude first (default = false
) | | * @param[in] swaplatlong if true give longitude first (default = false
) | |
|
| | | * @param[in] dmssep if non-null, use as the DMS separator character | |
| | | * (instead of d, ', " delimiters). | |
| * @return DMS latitude/longitude string representation. | | * @return DMS latitude/longitude string representation. | |
| * | | * | |
| * Precision specifies accuracy of representation as follows: | | * Precision specifies accuracy of representation as follows: | |
| * - prec = -5 (min), 1d | | * - prec = -5 (min), 1d | |
| * - prec = -4, 0.1d | | * - prec = -4, 0.1d | |
| * - prec = -3, 1' | | * - prec = -3, 1' | |
| * - prec = -2, 0.1' | | * - prec = -2, 0.1' | |
|
| * - prec = -1, 1" | | * - prec = -1, 1" | |
| * - prec = 0, 0.1" (about 3m) | | * - prec = 0, 0.1" (about 3m) | |
| * - prec = 1, 0.01" | | * - prec = 1, 0.01" | |
| * - prec = 10 (max), 10<sup>-11</sup>" | | * - prec = 10 (max), 10<sup>-11</sup>" | |
| | | ********************************************************************** | |
| | | / | |
| | | std::string DMSRepresentation(int prec, bool swaplatlong, char dmssep) | |
| | | const; | |
| | | | |
| | | /** | |
| | | * String representation with latitude and longitude as degrees, minute | |
| | | s, | |
| | | * seconds, and hemisphere. | |
| | | * | |
| | | * @param[in] prec precision (relative to about 1m) | |
| | | * @param[in] swaplatlong if true give longitude first (default = false | |
| | | ) | |
| | | * @return DMS latitude/longitude string representation. | |
| | | * | |
| | | * <b>COMPATIBILITY NOTE:</b> This function calls | |
| | | * DMSRepresentation(int, bool, char) const with a 3rd argument of | |
| | | * char(0). At some point, DMSRepresentation(int, bool) const and | |
| | | * will be withdrawn and the interface to | |
| | | * DMSRepresentation(int, bool, char) const changed so that its | |
| | | * arguments have default values. This will preserve source-level | |
| | | * compatibility. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| std::string DMSRepresentation(int prec = 0, bool swaplatlong = false) c
onst; | | std::string DMSRepresentation(int prec = 0, bool swaplatlong = false) c
onst; | |
| | | | |
| /** | | /** | |
| * MGRS string. | | * MGRS string. | |
| * | | * | |
| * @param[in] prec precision (relative to about 1m). | | * @param[in] prec precision (relative to about 1m). | |
| * @return MGRS string. | | * @return MGRS string. | |
| * | | * | |
| * This gives the coordinates of the enclosing grid square with size gi
ven | | * This gives the coordinates of the enclosing grid square with size gi
ven | |
| | | | |
| skipping to change at line 439 | | skipping to change at line 468 | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return UTMUPS::MajorRadius();
} | | Math::real MajorRadius() const throw() { return UTMUPS::MajorRadius();
} | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the WGS84 ellipsoid. | | * @return \e f the flattening of the WGS84 ellipsoid. | |
| * | | * | |
| * (The WGS84 value is returned because the UTM and UPS projections are | | * (The WGS84 value is returned because the UTM and UPS projections are | |
| * based on this ellipsoid.) | | * based on this ellipsoid.) | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return UTMUPS::Flattening(); } | | Math::real Flattening() const throw() { return UTMUPS::Flattening(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
|
| * @return \e r the inverse flattening of the WGS84 ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return UTMUPS::InverseFlattening(); } | | { return UTMUPS::InverseFlattening(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_GEOCOORDS_HPP | | #endif // GEOGRAPHICLIB_GEOCOORDS_HPP | |
| | | | |
End of changes. 11 change blocks. |
| 13 lines changed or deleted | | 46 lines changed or added | |
|
| Geocentric.hpp | | Geocentric.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file Geocentric.hpp | | * \file Geocentric.hpp | |
| * \brief Header for GeographicLib::Geocentric class | | * \brief Header for GeographicLib::Geocentric class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP) | | #if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP) | |
| #define GEOGRAPHICLIB_GEOCENTRIC_HPP \ | | #define GEOGRAPHICLIB_GEOCENTRIC_HPP \ | |
|
| "$Id: d0b4b35254aca989b27e033bd6f2546dec69890a $" | | "$Id: e9f709c85e61f60509c492429061cba04350eea8 $" | |
| | | | |
| #include <vector> | | #include <vector> | |
| #include <algorithm> | | #include <algorithm> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief %Geocentric coordinates | | * \brief %Geocentric coordinates | |
| * | | * | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 58 | |
| * See \ref geocentric for more information. | | * See \ref geocentric for more information. | |
| * | | * | |
| * The errors in these routines are close to round-off. Specifically, fo
r | | * The errors in these routines are close to round-off. Specifically, fo
r | |
| * points within 5000 km of the surface of the ellipsoid (either inside o
r | | * points within 5000 km of the surface of the ellipsoid (either inside o
r | |
| * outside the ellipsoid), the error is bounded by 7 nm (7 nanometers) fo
r | | * outside the ellipsoid), the error is bounded by 7 nm (7 nanometers) fo
r | |
| * the WGS84 ellipsoid. See \ref geocentric for further information on t
he | | * the WGS84 ellipsoid. See \ref geocentric for further information on t
he | |
| * errors. | | * errors. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-Geocentric.cpp | | * \include example-Geocentric.cpp | |
|
| | | * | |
| | | * <a href="CartConvert.1.html">CartConvert</a> is a command-line utility | |
| | | * providing access to the functionality of Geocentric and LocalCartesian | |
| | | . | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT Geocentric { | | class GEOGRAPHIC_EXPORT Geocentric { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| friend class LocalCartesian; | | friend class LocalCartesian; | |
| friend class MagneticCircle; // MagneticCircle uses Rotation | | friend class MagneticCircle; // MagneticCircle uses Rotation | |
| friend class MagneticModel; // MagneticModel uses IntForward | | friend class MagneticModel; // MagneticModel uses IntForward | |
| friend class GravityCircle; // GravityCircle uses Rotation | | friend class GravityCircle; // GravityCircle uses Rotation | |
| friend class GravityModel; // GravityModel uses IntForward | | friend class GravityModel; // GravityModel uses IntForward | |
| | | | |
| skipping to change at line 254 | | skipping to change at line 257 | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() | | Math::real MajorRadius() const throw() | |
| { return Init() ? _a : Math::NaN<real>(); } | | { return Init() ? _a : Math::NaN<real>(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the | | * @return \e f the flattening of the ellipsoid. This is the | |
| * value used in the constructor. | | * value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() | | Math::real Flattening() const throw() | |
| { return Init() ? _f : Math::NaN<real>(); } | | { return Init() ? _f : Math::NaN<real>(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return Init() ? 1/_f : Math::NaN<real>(); } | | { return Init() ? 1/_f : Math::NaN<real>(); } | |
|
| ///@} | | /// \endcond | |
| | | | |
| /** | | /** | |
| * A global instantiation of Geocentric with the parameters for the WGS
84 | | * A global instantiation of Geocentric with the parameters for the WGS
84 | |
| * ellipsoid. | | * ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static const Geocentric WGS84; | | static const Geocentric WGS84; | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 8 lines changed or added | |
|
| Geodesic.hpp | | Geodesic.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file Geodesic.hpp | | * \file Geodesic.hpp | |
| * \brief Header for GeographicLib::Geodesic class | | * \brief Header for GeographicLib::Geodesic class | |
| * | | * | |
| * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEODESIC_HPP) | | #if !defined(GEOGRAPHICLIB_GEODESIC_HPP) | |
| #define GEOGRAPHICLIB_GEODESIC_HPP \ | | #define GEOGRAPHICLIB_GEODESIC_HPP \ | |
|
| "$Id: f3f99146e9009da6232a8b7a0ab46703b8c480fe $" | | "$Id: c1b085aadd7b8eabe0f9518b29531a38c152d495 $" | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| #if !defined(GEOD_ORD) | | #if !defined(GEOD_ORD) | |
| /** | | /** | |
| * The order of the expansions used by Geodesic. | | * The order of the expansions used by Geodesic. | |
| **********************************************************************/ | | **********************************************************************/ | |
| #define GEOD_ORD \ | | #define GEOD_ORD \ | |
| (GEOGRAPHICLIB_PREC == 1 ? 6 : (GEOGRAPHICLIB_PREC == 0 ? 3 : 7)) | | (GEOGRAPHICLIB_PREC == 1 ? 6 : (GEOGRAPHICLIB_PREC == 0 ? 3 : 7)) | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 124 | | skipping to change at line 124 | |
| * - C. F. F. Karney, | | * - C. F. F. Karney, | |
| * <a href="http://arxiv.org/abs/1109.4448">Algorithms for geodesics</a
>, | | * <a href="http://arxiv.org/abs/1109.4448">Algorithms for geodesics</a
>, | |
| * Sept. 2011; | | * Sept. 2011; | |
| * preprint | | * preprint | |
| * <a href="http://arxiv.org/abs/1109.4448">arxiv:1109.4448</a>. | | * <a href="http://arxiv.org/abs/1109.4448">arxiv:1109.4448</a>. | |
| * . | | * . | |
| * For more information on geodesics see \ref geodesic. | | * For more information on geodesics see \ref geodesic. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-Geodesic.cpp | | * \include example-Geodesic.cpp | |
|
| | | * | |
| | | * <a href="Geod.1.html">Geod</a> is a command-line utility providing acc | |
| | | ess | |
| | | * to the functionality of Geodesic and GeodesicLine. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT Geodesic { | | class GEOGRAPHIC_EXPORT Geodesic { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| friend class GeodesicLine; | | friend class GeodesicLine; | |
| static const int nA1_ = GEOD_ORD; | | static const int nA1_ = GEOD_ORD; | |
| static const int nC1_ = GEOD_ORD; | | static const int nC1_ = GEOD_ORD; | |
| static const int nC1p_ = GEOD_ORD; | | static const int nC1p_ = GEOD_ORD; | |
| static const int nA2_ = GEOD_ORD; | | static const int nA2_ = GEOD_ORD; | |
| | | | |
| skipping to change at line 816 | | skipping to change at line 819 | |
| * the value used in the constructor. | | * the value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _a; } | | Math::real MajorRadius() const throw() { return _a; } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the | | * @return \e f the flattening of the ellipsoid. This is the | |
| * value used in the constructor. | | * value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _f; } | | Math::real Flattening() const throw() { return _f; } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() { return 1/_f; } | | Math::real InverseFlattening() const throw() { return 1/_f; } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return total area of ellipsoid in meters<sup>2</sup>. The area of
a | | * @return total area of ellipsoid in meters<sup>2</sup>. The area of
a | |
| * polygon encircling a pole can be found by adding | | * polygon encircling a pole can be found by adding | |
| * Geodesic::EllipsoidArea()/2 to the sum of \e S12 for each side of
the | | * Geodesic::EllipsoidArea()/2 to the sum of \e S12 for each side of
the | |
| * polygon. | | * polygon. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real EllipsoidArea() const throw() | | Math::real EllipsoidArea() const throw() | |
| { return 4 * Math::pi<real>() * _c2; } | | { return 4 * Math::pi<real>() * _c2; } | |
| ///@} | | ///@} | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| GeodesicLine.hpp | | GeodesicLine.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file GeodesicLine.hpp | | * \file GeodesicLine.hpp | |
| * \brief Header for GeographicLib::GeodesicLine class | | * \brief Header for GeographicLib::GeodesicLine class | |
| * | | * | |
| * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEODESICLINE_HPP) | | #if !defined(GEOGRAPHICLIB_GEODESICLINE_HPP) | |
| #define GEOGRAPHICLIB_GEODESICLINE_HPP \ | | #define GEOGRAPHICLIB_GEODESICLINE_HPP \ | |
|
| "$Id: dd046d5105df4193d2448aeb383b2888f971866b $" | | "$Id: 4bbc611bc3837d78456bc227e17bea39cb443745 $" | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/Geodesic.hpp> | | #include <GeographicLib/Geodesic.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief A geodesic line. | | * \brief A geodesic line. | |
| * | | * | |
| * GeodesicLine facilitates the determination of a series of points on a | | * GeodesicLine facilitates the determination of a series of points on a | |
| | | | |
| skipping to change at line 54 | | skipping to change at line 54 | |
| * - C. F. F. Karney, | | * - C. F. F. Karney, | |
| * <a href="http://arxiv.org/abs/1109.4448">Algorithms for geodesics</a
>, | | * <a href="http://arxiv.org/abs/1109.4448">Algorithms for geodesics</a
>, | |
| * Sept. 2011; | | * Sept. 2011; | |
| * preprint | | * preprint | |
| * <a href="http://arxiv.org/abs/1109.4448">arxiv:1109.4448</a>. | | * <a href="http://arxiv.org/abs/1109.4448">arxiv:1109.4448</a>. | |
| * . | | * . | |
| * For more information on geodesics see \ref geodesic. | | * For more information on geodesics see \ref geodesic. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-GeodesicLine.cpp | | * \include example-GeodesicLine.cpp | |
|
| | | * | |
| | | * <a href="Geod.1.html">Geod</a> is a command-line utility providing acc | |
| | | ess | |
| | | * to the functionality of Geodesic and GeodesicLine. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT GeodesicLine { | | class GEOGRAPHIC_EXPORT GeodesicLine { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| friend class Geodesic; | | friend class Geodesic; | |
| static const int nC1_ = Geodesic::nC1_; | | static const int nC1_ = Geodesic::nC1_; | |
| static const int nC1p_ = Geodesic::nC1p_; | | static const int nC1p_ = Geodesic::nC1p_; | |
| static const int nC2_ = Geodesic::nC2_; | | static const int nC2_ = Geodesic::nC2_; | |
| static const int nC3_ = Geodesic::nC3_; | | static const int nC3_ = Geodesic::nC3_; | |
| | | | |
| skipping to change at line 564 | | skipping to change at line 567 | |
| Math::real MajorRadius() const throw() | | Math::real MajorRadius() const throw() | |
| { return Init() ? _a : Math::NaN<real>(); } | | { return Init() ? _a : Math::NaN<real>(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geodesic object used in the constructor. | | * inherited from the Geodesic object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() | | Math::real Flattening() const throw() | |
| { return Init() ? _f : Math::NaN<real>(); } | | { return Init() ? _f : Math::NaN<real>(); } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return Init() ? 1/_f : Math::NaN<real>(); } | | { return Init() ? 1/_f : Math::NaN<real>(); } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return \e caps the computational capabilities that this object was | | * @return \e caps the computational capabilities that this object was | |
| * constructed with. LATITUDE and AZIMUTH are always included. | | * constructed with. LATITUDE and AZIMUTH are always included. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| unsigned Capabilities() const throw() { return _caps; } | | unsigned Capabilities() const throw() { return _caps; } | |
| | | | |
| /** | | /** | |
| * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. | | * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. | |
| * @return true if the GeodesicLine object has all these capabilities. | | * @return true if the GeodesicLine object has all these capabilities. | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| Geoid.hpp | | Geoid.hpp | |
| /** | | /** | |
| * \file Geoid.hpp | | * \file Geoid.hpp | |
| * \brief Header for GeographicLib::Geoid class | | * \brief Header for GeographicLib::Geoid class | |
| * | | * | |
|
| * Copyright (c) Charles Karney (2009-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2009-2012) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEOID_HPP) | | #if !defined(GEOGRAPHICLIB_GEOID_HPP) | |
| #define GEOGRAPHICLIB_GEOID_HPP \ | | #define GEOGRAPHICLIB_GEOID_HPP \ | |
|
| "$Id: ab4318594c7b3edb747999d1b07822a8ae262bd3 $" | | "$Id: 4e4eb5941d16ad00416798703d246a6f7ef5fe46 $" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <vector> | | #include <vector> | |
| #include <fstream> | | #include <fstream> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| // Squelch warnings about dll vs vector | | // Squelch warnings about dll vs vector | |
| #pragma warning (push) | | #pragma warning (push) | |
| #pragma warning (disable: 4251) | | #pragma warning (disable: 4251) | |
| #endif | | #endif | |
| | | | |
|
| | | #if !defined(PGM_PIXEL_WIDTH) | |
| | | /** | |
| | | * The size of the pixel data in the pgm data files for the geoids. 2 | |
| | | * is the standard size corresponding to a maxval 2^16-1. Setting it | |
| | | * to 4 uses a maxval of 2^32-1 and changes the extension for the data | |
| | | * files from .pgm to .pgm4. Note that the format of these pgm4 files | |
| | | * is a non-standard extension of the pgm format. | |
| | | **********************************************************************/ | |
| | | #define PGM_PIXEL_WIDTH 2 | |
| | | #endif | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Looking up the height of the geoid | | * \brief Looking up the height of the geoid | |
| * | | * | |
| * This class evaluated the height of one of the standard geoids, EGM84, | | * This class evaluated the height of one of the standard geoids, EGM84, | |
| * EGM96, or EGM2008 by bilinear or cubic interpolation into a rectangula
r | | * EGM96, or EGM2008 by bilinear or cubic interpolation into a rectangula
r | |
| * grid of data. These geoid models are documented in | | * grid of data. These geoid models are documented in | |
| * - EGM84: | | * - EGM84: | |
| * http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180
.html | | * http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180
.html | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 80 | |
| * reads the data set and because it maintains a single-cell cache. If | | * reads the data set and because it maintains a single-cell cache. If | |
| * multiple threads need to calculate geoid heights they should all const
ruct | | * multiple threads need to calculate geoid heights they should all const
ruct | |
| * thread-local instantiations. Alternatively, set the optional \e | | * thread-local instantiations. Alternatively, set the optional \e | |
| * threadsafe parameter to true in the constructor. This causes the | | * threadsafe parameter to true in the constructor. This causes the | |
| * constructor to read all the data into memory and to turn off the | | * constructor to read all the data into memory and to turn off the | |
| * single-cell caching which results in a Geoid object which \e is thread | | * single-cell caching which results in a Geoid object which \e is thread | |
| * safe. | | * safe. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-Geoid.cpp | | * \include example-Geoid.cpp | |
|
| | | * | |
| | | * <a href="GeoidEval.1.html">GeoidEval</a> is a command-line utility | |
| | | * providing access to the functionality of Geoid. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT Geoid { | | class GEOGRAPHIC_EXPORT Geoid { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
|
| | | #if PGM_PIXEL_WIDTH != 4 | |
| | | typedef unsigned short pixel_t; | |
| | | static const unsigned pixel_size_ = 2; | |
| | | static const unsigned pixel_max_ = 0xffffu; | |
| | | #else | |
| | | typedef unsigned pixel_t; | |
| | | static const unsigned pixel_size_ = 4; | |
| | | static const unsigned pixel_max_ = 0xffffffffu; | |
| | | #endif | |
| static const unsigned stencilsize_ = 12; | | static const unsigned stencilsize_ = 12; | |
| static const unsigned nterms_ = ((3 + 1) * (3 + 2))/2; // for a cubic f
it | | static const unsigned nterms_ = ((3 + 1) * (3 + 2))/2; // for a cubic f
it | |
| static const real c0_; | | static const real c0_; | |
| static const real c0n_; | | static const real c0n_; | |
| static const real c0s_; | | static const real c0s_; | |
| static const real c3_[stencilsize_ * nterms_]; | | static const real c3_[stencilsize_ * nterms_]; | |
| static const real c3n_[stencilsize_ * nterms_]; | | static const real c3n_[stencilsize_ * nterms_]; | |
| static const real c3s_[stencilsize_ * nterms_]; | | static const real c3s_[stencilsize_ * nterms_]; | |
| | | | |
| std::string _name, _dir, _filename; | | std::string _name, _dir, _filename; | |
| const bool _cubic; | | const bool _cubic; | |
| const real _a, _e2, _degree, _eps; | | const real _a, _e2, _degree, _eps; | |
| mutable std::ifstream _file; | | mutable std::ifstream _file; | |
| real _rlonres, _rlatres; | | real _rlonres, _rlatres; | |
| std::string _description, _datetime; | | std::string _description, _datetime; | |
| real _offset, _scale, _maxerror, _rmserror; | | real _offset, _scale, _maxerror, _rmserror; | |
| int _width, _height; | | int _width, _height; | |
| unsigned long long _datastart, _swidth; | | unsigned long long _datastart, _swidth; | |
| bool _threadsafe; | | bool _threadsafe; | |
| // Area cache | | // Area cache | |
|
| mutable std::vector< std::vector<unsigned short> > _data; | | mutable std::vector< std::vector<pixel_t> > _data; | |
| mutable bool _cache; | | mutable bool _cache; | |
| // NE corner and extent of cache | | // NE corner and extent of cache | |
| mutable int _xoffset, _yoffset, _xsize, _ysize; | | mutable int _xoffset, _yoffset, _xsize, _ysize; | |
| // Cell cache | | // Cell cache | |
| mutable int _ix, _iy; | | mutable int _ix, _iy; | |
| mutable real _v00, _v01, _v10, _v11; | | mutable real _v00, _v01, _v10, _v11; | |
| mutable real _t[nterms_]; | | mutable real _t[nterms_]; | |
| void filepos(int ix, int iy) const { | | void filepos(int ix, int iy) const { | |
| _file.seekg( | | _file.seekg( | |
| #if !(defined(__GNUC__) && __GNUC__ < 4) | | #if !(defined(__GNUC__) && __GNUC__ < 4) | |
| // g++ 3.x doesn't know about the cast to streamoff. | | // g++ 3.x doesn't know about the cast to streamoff. | |
| std::ios::streamoff | | std::ios::streamoff | |
| #endif | | #endif | |
|
| (_datastart + 2ULL * (unsigned(iy)*_swidth + unsigned(ix) | | (_datastart + | |
| ))); | | pixel_size_ * (unsigned(iy)*_swidth + unsigned(ix)))); | |
| } | | } | |
| real rawval(int ix, int iy) const { | | real rawval(int ix, int iy) const { | |
| if (ix < 0) | | if (ix < 0) | |
| ix += _width; | | ix += _width; | |
| else if (ix >= _width) | | else if (ix >= _width) | |
| ix -= _width; | | ix -= _width; | |
| if (_cache && iy >= _yoffset && iy < _yoffset + _ysize && | | if (_cache && iy >= _yoffset && iy < _yoffset + _ysize && | |
| ((ix >= _xoffset && ix < _xoffset + _xsize) || | | ((ix >= _xoffset && ix < _xoffset + _xsize) || | |
| (ix + _width >= _xoffset && ix + _width < _xoffset + _xsize))) { | | (ix + _width >= _xoffset && ix + _width < _xoffset + _xsize))) { | |
| return real(_data[iy - _yoffset] | | return real(_data[iy - _yoffset] | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 154 | |
| } else { | | } else { | |
| if (iy < 0 || iy >= _height) { | | if (iy < 0 || iy >= _height) { | |
| iy = iy < 0 ? -iy : 2 * (_height - 1) - iy; | | iy = iy < 0 ? -iy : 2 * (_height - 1) - iy; | |
| ix += (ix < _width/2 ? 1 : -1) * _width/2; | | ix += (ix < _width/2 ? 1 : -1) * _width/2; | |
| } | | } | |
| try { | | try { | |
| filepos(ix, iy); | | filepos(ix, iy); | |
| char a, b; | | char a, b; | |
| _file.get(a); | | _file.get(a); | |
| _file.get(b); | | _file.get(b); | |
|
| return real((unsigned char)(a) * 256u + (unsigned char)(b)); | | unsigned r = ((unsigned char)(a) << 8) | (unsigned char)(b); | |
| | | if (pixel_size_ == 4) { | |
| | | _file.get(a); | |
| | | _file.get(b); | |
| | | r = (r << 16) | ((unsigned char)(a) << 8) | (unsigned char)(b); | |
| | | } | |
| | | return real(r); | |
| } | | } | |
| catch (const std::exception& e) { | | catch (const std::exception& e) { | |
| // throw GeographicErr("Error reading " + _filename + ": " | | // throw GeographicErr("Error reading " + _filename + ": " | |
| // + e.what()); | | // + e.what()); | |
| // triggers complaints about the "binary '+'" under Visual Studio
. | | // triggers complaints about the "binary '+'" under Visual Studio
. | |
| // So use '+=' instead. | | // So use '+=' instead. | |
| std::string err("Error reading "); | | std::string err("Error reading "); | |
| err += _filename; | | err += _filename; | |
| err += ": "; | | err += ": "; | |
| err += e.what(); | | err += e.what(); | |
| | | | |
| skipping to change at line 271 | | skipping to change at line 301 | |
| * | | * | |
| * @param[in] lat latitude of the point (degrees). | | * @param[in] lat latitude of the point (degrees). | |
| * @param[in] lon longitude of the point (degrees). | | * @param[in] lon longitude of the point (degrees). | |
| * @param[out] gradn northerly gradient (dimensionless). | | * @param[out] gradn northerly gradient (dimensionless). | |
| * @param[out] grade easterly gradient (dimensionless). | | * @param[out] grade easterly gradient (dimensionless). | |
| * @return geoid height (meters). | | * @return geoid height (meters). | |
| * | | * | |
| * The latitude should be in [-90, 90] and longitude should be in [-180
, | | * The latitude should be in [-90, 90] and longitude should be in [-180
, | |
| * 360]. This may throw an error because of an error reading data from | | * 360]. This may throw an error because of an error reading data from | |
| * disk. However, it will not throw if (\e lat, \e lon) is within a | | * disk. However, it will not throw if (\e lat, \e lon) is within a | |
|
| * successfully cached area. | | * successfully cached area. As a result of the way that the geoid dat | |
| | | a is | |
| | | * stored, the calculation of gradients can result in large quantizatio | |
| | | n | |
| | | * errors. This is particularly acute for fine grids, at high latitude | |
| | | s, | |
| | | * and for the easterly gradient. If you need to compute the direction | |
| | | of | |
| | | * the acceleration due to gravity accurately, you should use | |
| | | * GravityModel::Gravity. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real operator()(real lat, real lon, real& gradn, real& grade) con
st { | | Math::real operator()(real lat, real lon, real& gradn, real& grade) con
st { | |
| return height(lat, lon, true, gradn, grade); | | return height(lat, lon, true, gradn, grade); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Convert a height above the geoid to a height above the ellipsoid and | | * Convert a height above the geoid to a height above the ellipsoid and | |
| * vice versa. | | * vice versa. | |
| * | | * | |
| * @param[in] lat latitude of the point (degrees). | | * @param[in] lat latitude of the point (degrees). | |
| | | | |
| skipping to change at line 428 | | skipping to change at line 463 | |
| Math::real MajorRadius() const throw() | | Math::real MajorRadius() const throw() | |
| { return Constants::WGS84_a<real>(); } | | { return Constants::WGS84_a<real>(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the WGS84 ellipsoid. | | * @return \e f the flattening of the WGS84 ellipsoid. | |
| * | | * | |
| * (The WGS84 value is returned because the supported geoid models are
all | | * (The WGS84 value is returned because the supported geoid models are
all | |
| * based on this ellipsoid.) | | * based on this ellipsoid.) | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return Constants::WGS84_f<real>
(); } | | Math::real Flattening() const throw() { return Constants::WGS84_f<real>
(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the WGS84 ellipsoid. | | * @return \e r the inverse flattening of the WGS84 ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return 1/Constants::WGS84_f<real>(); } | | { return 1/Constants::WGS84_f<real>(); } | |
|
| ///@} | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return the default path for geoid data files. | | * @return the default path for geoid data files. | |
| * | | * | |
| * This is the value of the environment variable GEOID_PATH, if set; | | * This is the value of the environment variable GEOID_PATH, if set; | |
| * otherwise, it is $GEOGRAPHICLIB_DATA/geoids if the environment varia
ble | | * otherwise, it is $GEOGRAPHICLIB_DATA/geoids if the environment varia
ble | |
| * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default | | * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default | |
| * (/usr/local/share/GeographicLib/geoids on non-Windows systems and | | * (/usr/local/share/GeographicLib/geoids on non-Windows systems and | |
| * C:/Documents and Settings/All Users/Application | | * C:/Documents and Settings/All Users/Application | |
| * Data/GeographicLib/geoids on Windows systems). | | * Data/GeographicLib/geoids on Windows systems). | |
| | | | |
End of changes. 12 change blocks. |
| 8 lines changed or deleted | | 48 lines changed or added | |
|
| Gnomonic.hpp | | Gnomonic.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file Gnomonic.hpp | | * \file Gnomonic.hpp | |
| * \brief Header for GeographicLib::Gnomonic class | | * \brief Header for GeographicLib::Gnomonic class | |
| * | | * | |
| * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | | * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GNOMONIC_HPP) | | #if !defined(GEOGRAPHICLIB_GNOMONIC_HPP) | |
| #define GEOGRAPHICLIB_GNOMONIC_HPP \ | | #define GEOGRAPHICLIB_GNOMONIC_HPP \ | |
|
| "$Id: 93b8247cb467dd7cbafbe10acd6b7c85f7aaf7d1 $" | | "$Id: f2e7e429e56165c314a518fada607c225132b945 $" | |
| | | | |
| #include <GeographicLib/Geodesic.hpp> | | #include <GeographicLib/Geodesic.hpp> | |
| #include <GeographicLib/GeodesicLine.hpp> | | #include <GeographicLib/GeodesicLine.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief %Gnomonic Projection. | | * \brief %Gnomonic Projection. | |
| * | | * | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 101 | |
| * proposed by I. G. Letoval'tsev, Generalization of the %Gnomonic | | * proposed by I. G. Letoval'tsev, Generalization of the %Gnomonic | |
| * Projection for a Spheroid and the Principal Geodetic Problems Involv
ed | | * Projection for a Spheroid and the Principal Geodetic Problems Involv
ed | |
| * in the Alignment of Surface Routes, Geodesy and Aerophotography (5), | | * in the Alignment of Surface Routes, Geodesy and Aerophotography (5), | |
| * 271-274 (1963). | | * 271-274 (1963). | |
| * - The projection given here. This causes geodesics close to the cente
r | | * - The projection given here. This causes geodesics close to the cente
r | |
| * point to appear as straight lines in the projection; i.e., it | | * point to appear as straight lines in the projection; i.e., it | |
| * generalizes the spherical great circle to a geodesic. | | * generalizes the spherical great circle to a geodesic. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-Gnomonic.cpp | | * \include example-Gnomonic.cpp | |
|
| | | * | |
| | | * <a href="GeodesicProj.1.html">GeodesicProj</a> is a command-line utili | |
| | | ty | |
| | | * providing access to the functionality of AzimuthalEquidistant, Gnomoni | |
| | | c, | |
| | | * and CassiniSoldner. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT Gnomonic { | | class GEOGRAPHIC_EXPORT Gnomonic { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| Geodesic _earth; | | Geodesic _earth; | |
| real _a, _f; | | real _a, _f; | |
| static const real eps0_; | | static const real eps0_; | |
| static const real eps_; | | static const real eps_; | |
| static const int numit_ = 5; | | static const int numit_ = 5; | |
| | | | |
| skipping to change at line 209 | | skipping to change at line 213 | |
| * @return \e a the equatorial radius of the ellipsoid (meters). This
is | | * @return \e a the equatorial radius of the ellipsoid (meters). This
is | |
| * the value inherited from the Geodesic object used in the construct
or. | | * the value inherited from the Geodesic object used in the construct
or. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | | Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geodesic object used in the constructor. | | * inherited from the Geodesic object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _earth.Flattening(); } | | Math::real Flattening() const throw() { return _earth.Flattening(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return _earth.InverseFlattening(); } | | { return _earth.InverseFlattening(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_GNOMONIC_HPP | | #endif // GEOGRAPHICLIB_GNOMONIC_HPP | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 10 lines changed or added | |
|
| GravityCircle.hpp | | GravityCircle.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file GravityCircle.hpp | | * \file GravityCircle.hpp | |
| * \brief Header for GeographicLib::GravityCircle class | | * \brief Header for GeographicLib::GravityCircle class | |
| * | | * | |
| * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | | * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | |
| * the MIT/X11 License. For more information, see | | * the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GRAVITYCIRCLE_HPP) | | #if !defined(GEOGRAPHICLIB_GRAVITYCIRCLE_HPP) | |
| #define GEOGRAPHICLIB_GRAVITYCIRCLE_HPP \ | | #define GEOGRAPHICLIB_GRAVITYCIRCLE_HPP \ | |
|
| "$Id: e7a230fffb6fcb413694f2b4ece36ae44627ef33 $" | | "$Id: 6ae0869411185a48c9f55016e6d1fb14e69aaac1 $" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <vector> | | #include <vector> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/CircularEngine.hpp> | | #include <GeographicLib/CircularEngine.hpp> | |
| #include <GeographicLib/GravityModel.hpp> | | #include <GeographicLib/GravityModel.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| * different longitudes to be evaluated rapidly. | | * different longitudes to be evaluated rapidly. | |
| * | | * | |
| * Use GravityModel::Circle to create a GravityCircle object. (The | | * Use GravityModel::Circle to create a GravityCircle object. (The | |
| * constructor for this class is private.) | | * constructor for this class is private.) | |
| * | | * | |
| * See \ref gravityparallel for an example of using GravityCircle (togeth
er | | * See \ref gravityparallel for an example of using GravityCircle (togeth
er | |
| * with OpenMP) to speed up the computation of geoid heights. | | * with OpenMP) to speed up the computation of geoid heights. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-GravityCircle.cpp | | * \include example-GravityCircle.cpp | |
|
| | | * | |
| | | * <a href="Gravity.1.html">Gravity</a> is a command-line utility providi | |
| | | ng | |
| | | * access to the functionality of GravityModel and GravityCircle. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT GravityCircle { | | class GEOGRAPHIC_EXPORT GravityCircle { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| enum mask { | | enum mask { | |
| NONE = GravityModel::NONE, | | NONE = GravityModel::NONE, | |
| GRAVITY = GravityModel::GRAVITY, | | GRAVITY = GravityModel::GRAVITY, | |
| DISTURBANCE = GravityModel::DISTURBANCE, | | DISTURBANCE = GravityModel::DISTURBANCE, | |
| DISTURBING_POTENTIAL = GravityModel::DISTURBING_POTENTIAL, | | DISTURBING_POTENTIAL = GravityModel::DISTURBING_POTENTIAL, | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 5 lines changed or added | |
|
| GravityModel.hpp | | GravityModel.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file GravityModel.hpp | | * \file GravityModel.hpp | |
| * \brief Header for GeographicLib::GravityModel class | | * \brief Header for GeographicLib::GravityModel class | |
| * | | * | |
| * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | | * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | |
| * the MIT/X11 License. For more information, see | | * the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GRAVITYMODEL_HPP) | | #if !defined(GEOGRAPHICLIB_GRAVITYMODEL_HPP) | |
| #define GEOGRAPHICLIB_GRAVITYMODEL_HPP \ | | #define GEOGRAPHICLIB_GRAVITYMODEL_HPP \ | |
|
| "$Id: e1cd05f6303c46250b29d12bc51c3497d06508ae $" | | "$Id: e1a573fb0148fa5bc408b2dbdb096d4cd3091bac $" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <sstream> | | #include <sstream> | |
| #include <vector> | | #include <vector> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/NormalGravity.hpp> | | #include <GeographicLib/NormalGravity.hpp> | |
| #include <GeographicLib/SphericalHarmonic.hpp> | | #include <GeographicLib/SphericalHarmonic.hpp> | |
| #include <GeographicLib/SphericalHarmonic1.hpp> | | #include <GeographicLib/SphericalHarmonic1.hpp> | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| * | | * | |
| * See \ref gravity for details of how to install the gravity model and t
he | | * See \ref gravity for details of how to install the gravity model and t
he | |
| * data format. | | * data format. | |
| * | | * | |
| * References: | | * References: | |
| * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San | | * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San | |
| * Francisco, 1967). | | * Francisco, 1967). | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-GravityModel.cpp | | * \include example-GravityModel.cpp | |
|
| | | * | |
| | | * <a href="Gravity.1.html">Gravity</a> is a command-line utility providi | |
| | | ng | |
| | | * access to the functionality of GravityModel and GravityCircle. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT GravityModel { | | class GEOGRAPHIC_EXPORT GravityModel { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| friend class GravityCircle; | | friend class GravityCircle; | |
| static const int idlength_ = 8; | | static const int idlength_ = 8; | |
| std::string _name, _dir, _description, _date, _filename, _id; | | std::string _name, _dir, _description, _date, _filename, _id; | |
| real _amodel, _GMmodel, _zeta0, _corrmult; | | real _amodel, _GMmodel, _zeta0, _corrmult; | |
| SphericalHarmonic::normalization _norm; | | SphericalHarmonic::normalization _norm; | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 5 lines changed or added | |
|
| LambertConformalConic.hpp | | LambertConformalConic.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file LambertConformalConic.hpp | | * \file LambertConformalConic.hpp | |
| * \brief Header for GeographicLib::LambertConformalConic class | | * \brief Header for GeographicLib::LambertConformalConic class | |
| * | | * | |
| * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | | * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP) | | #if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP) | |
| #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP \ | | #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP \ | |
|
| "$Id: 01a4aff302dde6b1dca687badd42f945f34b9bf7 $" | | "$Id: 9aef04f77098543818681966f13ef97ea47dedb4 $" | |
| | | | |
| #include <algorithm> | | #include <algorithm> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Lambert Conformal Conic Projection | | * \brief Lambert Conformal Conic Projection | |
| * | | * | |
| * Implementation taken from the report, | | * Implementation taken from the report, | |
| | | | |
| skipping to change at line 54 | | skipping to change at line 54 | |
| * parallels where one is a pole is singular and is disallowed. The cent
ral | | * parallels where one is a pole is singular and is disallowed. The cent
ral | |
| * meridian (which is a trivial shift of the longitude) is specified as t
he | | * meridian (which is a trivial shift of the longitude) is specified as t
he | |
| * \e lon0 argument of the LambertConformalConic::Forward and | | * \e lon0 argument of the LambertConformalConic::Forward and | |
| * LambertConformalConic::Reverse functions. There is no provision in th
is | | * LambertConformalConic::Reverse functions. There is no provision in th
is | |
| * class for specifying a false easting or false northing or a different | | * class for specifying a false easting or false northing or a different | |
| * latitude of origin. However these are can be simply included by the | | * latitude of origin. However these are can be simply included by the | |
| * calling function. For example the Pennsylvania South state coordinate | | * calling function. For example the Pennsylvania South state coordinate | |
| * system (<a href="http://www.spatialreference.org/ref/epsg/3364/"> | | * system (<a href="http://www.spatialreference.org/ref/epsg/3364/"> | |
| * EPSG:3364</a>) is obtained by: | | * EPSG:3364</a>) is obtained by: | |
| * \include example-LambertConformalConic.cpp | | * \include example-LambertConformalConic.cpp | |
|
| | | * | |
| | | * <a href="ConicProj.1.html">ConicProj</a> is a command-line utility | |
| | | * providing access to the functionality of LambertConformalConic and | |
| | | * AlbersEqualArea. | |
| **********************************************************************/ | | **********************************************************************/ | |
| class GEOGRAPHIC_EXPORT LambertConformalConic { | | class GEOGRAPHIC_EXPORT LambertConformalConic { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| real _a, _f, _fm, _e2, _e, _e2m; | | real _a, _f, _fm, _e2, _e, _e2m; | |
| real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0; | | real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0; | |
| real _scbet0, _tchi0, _scchi0, _psi0, _nrho0; | | real _scbet0, _tchi0, _scchi0, _psi0, _nrho0; | |
| static const real eps_; | | static const real eps_; | |
| static const real epsx_; | | static const real epsx_; | |
| static const real tol_; | | static const real tol_; | |
| | | | |
| skipping to change at line 289 | | skipping to change at line 293 | |
| * the value used in the constructor. | | * the value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _a; } | | Math::real MajorRadius() const throw() { return _a; } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the | | * @return \e f the flattening of the ellipsoid. This is the | |
| * value used in the constructor. | | * value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _f; } | | Math::real Flattening() const throw() { return _f; } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() { return 1/_f; } | | Math::real InverseFlattening() const throw() { return 1/_f; } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return latitude of the origin for the projection (degrees). | | * @return latitude of the origin for the projection (degrees). | |
| * | | * | |
| * This is the latitude of minimum scale and equals the \e stdlat in th
e | | * This is the latitude of minimum scale and equals the \e stdlat in th
e | |
| * 1-parallel constructor and lies between \e stdlat1 and \e stdlat2 in
the | | * 1-parallel constructor and lies between \e stdlat1 and \e stdlat2 in
the | |
| * 2-parallel constructors. | | * 2-parallel constructors. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real OriginLatitude() const throw() { return _lat0; } | | Math::real OriginLatitude() const throw() { return _lat0; } | |
| | | | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| LocalCartesian.hpp | | LocalCartesian.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file LocalCartesian.hpp | | * \file LocalCartesian.hpp | |
| * \brief Header for GeographicLib::LocalCartesian class | | * \brief Header for GeographicLib::LocalCartesian class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP) | | #if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP) | |
| #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP \ | | #define GEOGRAPHICLIB_LOCALCARTESIAN_HPP \ | |
|
| "$Id: c614ff49cba632fe217125ec0d40105fe4b9a4c3 $" | | "$Id: 133014a30695adf3bdea9f4b52613fab458c505a $" | |
| | | | |
| #include <GeographicLib/Geocentric.hpp> | | #include <GeographicLib/Geocentric.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Local Cartesian coordinates | | * \brief Local Cartesian coordinates | |
| * | | * | |
| * Convert between geodetic coordinates latitude = \e lat, longitude = \e | | * Convert between geodetic coordinates latitude = \e lat, longitude = \e | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| * to local cartesian coordinates (\e x, \e y, \e z). The origin of loca
l | | * to local cartesian coordinates (\e x, \e y, \e z). The origin of loca
l | |
| * cartesian coordinate system is at \e lat = \e lat0, \e lon = \e lon0,
\e h | | * cartesian coordinate system is at \e lat = \e lat0, \e lon = \e lon0,
\e h | |
| * = \e h0. The \e z axis is normal to the ellipsoid; the \e y axis point
s | | * = \e h0. The \e z axis is normal to the ellipsoid; the \e y axis point
s | |
| * due north. The plane \e z = - \e h0 is tangent to the ellipsoid. | | * due north. The plane \e z = - \e h0 is tangent to the ellipsoid. | |
| * | | * | |
| * The conversions all take place via geocentric coordinates using a | | * The conversions all take place via geocentric coordinates using a | |
| * Geocentric object (by default Geocentric::WGS84). | | * Geocentric object (by default Geocentric::WGS84). | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-LocalCartesian.cpp | | * \include example-LocalCartesian.cpp | |
|
| | | * | |
| | | * <a href="CartConvert.1.html">CartConvert</a> is a command-line utility | |
| | | * providing access to the functionality of Geocentric and LocalCartesian | |
| | | . | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT LocalCartesian { | | class GEOGRAPHIC_EXPORT LocalCartesian { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| static const size_t dim_ = 3; | | static const size_t dim_ = 3; | |
| static const size_t dim2_ = dim_ * dim_; | | static const size_t dim2_ = dim_ * dim_; | |
| Geocentric _earth; | | Geocentric _earth; | |
| real _lat0, _lon0, _h0; | | real _lat0, _lon0, _h0; | |
| real _x0, _y0, _z0, _r[dim2_]; | | real _x0, _y0, _z0, _r[dim2_]; | |
| | | | |
| skipping to change at line 224 | | skipping to change at line 227 | |
| * the value of \e a inherited from the Geocentric object used in the | | * the value of \e a inherited from the Geocentric object used in the | |
| * constructor. | | * constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | | Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geocentric object used in the constructor. | | * inherited from the Geocentric object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _earth.Flattening(); } | | Math::real Flattening() const throw() { return _earth.Flattening(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() | | Math::real InverseFlattening() const throw() | |
| { return _earth.InverseFlattening(); } | | { return _earth.InverseFlattening(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_LOCALCARTESIAN_HPP | | #endif // GEOGRAPHICLIB_LOCALCARTESIAN_HPP | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 8 lines changed or added | |
|
| MGRS.hpp | | MGRS.hpp | |
| /** | | /** | |
| * \file MGRS.hpp | | * \file MGRS.hpp | |
| * \brief Header for GeographicLib::MGRS class | | * \brief Header for GeographicLib::MGRS class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_MGRS_HPP) | | #if !defined(GEOGRAPHICLIB_MGRS_HPP) | |
|
| #define GEOGRAPHICLIB_MGRS_HPP "$Id: 0c88de3f53072cd255e2af6353fb141add83fc
e9 $" | | #define GEOGRAPHICLIB_MGRS_HPP "$Id: 80e08da6eca9d9cf92c5adad148c64302df257
3d $" | |
| | | | |
| #include <sstream> | | #include <sstream> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/UTMUPS.hpp> | | #include <GeographicLib/UTMUPS.hpp> | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| // Squelch warnings about dll vs string | | // Squelch warnings about dll vs string | |
| #pragma warning (push) | | #pragma warning (push) | |
| #pragma warning (disable: 4251) | | #pragma warning (disable: 4251) | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 274 | | skipping to change at line 274 | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real MajorRadius() throw() { return UTMUPS::MajorRadius();
} | | static Math::real MajorRadius() throw() { return UTMUPS::MajorRadius();
} | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the WGS84 ellipsoid. | | * @return \e f the flattening of the WGS84 ellipsoid. | |
| * | | * | |
| * (The WGS84 value is returned because the UTM and UPS projections are | | * (The WGS84 value is returned because the UTM and UPS projections are | |
| * based on this ellipsoid.) | | * based on this ellipsoid.) | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real Flattening() throw() { return UTMUPS::Flattening(); } | | static Math::real Flattening() throw() { return UTMUPS::Flattening(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the WGS84 ellipsoid. | | * @return \e r the inverse flattening of the WGS84 ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real InverseFlattening() throw() | | static Math::real InverseFlattening() throw() | |
| { return UTMUPS::InverseFlattening(); } | | { return UTMUPS::InverseFlattening(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| #pragma warning (pop) | | #pragma warning (pop) | |
| #endif | | #endif | |
| | | | |
| #endif // GEOGRAPHICLIB_MGRS_HPP | | #endif // GEOGRAPHICLIB_MGRS_HPP | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 4 lines changed or added | |
|
| MagneticCircle.hpp | | MagneticCircle.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file MagneticCircle.hpp | | * \file MagneticCircle.hpp | |
| * \brief Header for GeographicLib::MagneticCircle class | | * \brief Header for GeographicLib::MagneticCircle class | |
| * | | * | |
| * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | | * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | |
| * the MIT/X11 License. For more information, see | | * the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP) | | #if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP) | |
| #define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP \ | | #define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP \ | |
|
| "$Id: 3884656adfb278af41423d4df4826b1b928f55f1 $" | | "$Id: 5b3adc58d894f36ca4206864eb565541f24ff492 $" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <vector> | | #include <vector> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/CircularEngine.hpp> | | #include <GeographicLib/CircularEngine.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Geomagnetic field on a circle of latitude | | * \brief Geomagnetic field on a circle of latitude | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| * Evaluate the earth's magnetic field on a circle of constant height and | | * Evaluate the earth's magnetic field on a circle of constant height and | |
| * latitude. This uses a CircleEngine to pre-evaluate the inner sum of t
he | | * latitude. This uses a CircleEngine to pre-evaluate the inner sum of t
he | |
| * spherical harmonic sum, allowing the values of the field at several | | * spherical harmonic sum, allowing the values of the field at several | |
| * different longitudes to be evaluated rapidly. | | * different longitudes to be evaluated rapidly. | |
| * | | * | |
| * Use MagneticModel::Circle to create a MagneticCircle object. (The | | * Use MagneticModel::Circle to create a MagneticCircle object. (The | |
| * constructor for this class is private.) | | * constructor for this class is private.) | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-MagneticCircle.cpp | | * \include example-MagneticCircle.cpp | |
|
| | | * | |
| | | * <a href="MagneticField.1.html">MagneticField</a> is a command-line uti | |
| | | lity | |
| | | * providing access to the functionality of MagneticModel and MagneticCir | |
| | | cle. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT MagneticCircle { | | class GEOGRAPHIC_EXPORT MagneticCircle { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| | | | |
| real _a, _f, _lat, _h, _t, _cphi, _sphi, _t1, _dt0; | | real _a, _f, _lat, _h, _t, _cphi, _sphi, _t1, _dt0; | |
| bool _interpolate; | | bool _interpolate; | |
| CircularEngine _circ0, _circ1; | | CircularEngine _circ0, _circ1; | |
| | | | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 6 lines changed or added | |
|
| MagneticModel.hpp | | MagneticModel.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file MagneticModel.hpp | | * \file MagneticModel.hpp | |
| * \brief Header for GeographicLib::MagneticModel class | | * \brief Header for GeographicLib::MagneticModel class | |
| * | | * | |
| * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | | * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un
der | |
| * the MIT/X11 License. For more information, see | | * the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP) | | #if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP) | |
| #define GEOGRAPHICLIB_MAGNETICMODEL_HPP \ | | #define GEOGRAPHICLIB_MAGNETICMODEL_HPP \ | |
|
| "$Id: 7e3fd1db9a29b713c7ce63584e8fbfd2b28914e2 $" | | "$Id: 7f8c59ee3cdbfce252d1172c1bb4d7db7cf5ef38 $" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <sstream> | | #include <sstream> | |
| #include <vector> | | #include <vector> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/Geocentric.hpp> | | #include <GeographicLib/Geocentric.hpp> | |
| #include <GeographicLib/SphericalHarmonic.hpp> | | #include <GeographicLib/SphericalHarmonic.hpp> | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| // Squelch warnings about dll vs vector | | // Squelch warnings about dll vs vector | |
| | | | |
| skipping to change at line 59 | | skipping to change at line 59 | |
| * - IGRF11: | | * - IGRF11: | |
| * - http://ngdc.noaa.gov/IAGA/vmod/igrf.html | | * - http://ngdc.noaa.gov/IAGA/vmod/igrf.html | |
| * - http://ngdc.noaa.gov/IAGA/vmod/igrf11coeffs.txt | | * - http://ngdc.noaa.gov/IAGA/vmod/igrf11coeffs.txt | |
| * - http://ngdc.noaa.gov/IAGA/vmod/geomag70_linux.tar.gz | | * - http://ngdc.noaa.gov/IAGA/vmod/geomag70_linux.tar.gz | |
| * - EMM2010: | | * - EMM2010: | |
| * - http://ngdc.noaa.gov/geomag/EMM/index.html | | * - http://ngdc.noaa.gov/geomag/EMM/index.html | |
| * - http://ngdc.noaa.gov/geomag/EMM/data/geomag/EMM2010_Sph_Windows_Li
nux.zip | | * - http://ngdc.noaa.gov/geomag/EMM/data/geomag/EMM2010_Sph_Windows_Li
nux.zip | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-MagneticModel.cpp | | * \include example-MagneticModel.cpp | |
|
| | | * | |
| | | * <a href="MagneticField.1.html">MagneticField</a> is a command-line uti | |
| | | lity | |
| | | * providing access to the functionality of MagneticModel and MagneticCir | |
| | | cle. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT MagneticModel { | | class GEOGRAPHIC_EXPORT MagneticModel { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| static const int idlength_ = 8; | | static const int idlength_ = 8; | |
| std::string _name, _dir, _description, _date, _filename, _id; | | std::string _name, _dir, _description, _date, _filename, _id; | |
| real _t0, _dt0, _tmin, _tmax, _a, _hmin, _hmax; | | real _t0, _dt0, _tmin, _tmax, _a, _hmin, _hmax; | |
| int _Nmodels; | | int _Nmodels; | |
| SphericalHarmonic::normalization _norm; | | SphericalHarmonic::normalization _norm; | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 6 lines changed or added | |
|
| OSGB.hpp | | OSGB.hpp | |
| /** | | /** | |
| * \file OSGB.hpp | | * \file OSGB.hpp | |
| * \brief Header for GeographicLib::OSGB class | | * \brief Header for GeographicLib::OSGB class | |
| * | | * | |
| * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | | * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_OSGB_HPP) | | #if !defined(GEOGRAPHICLIB_OSGB_HPP) | |
|
| #define GEOGRAPHICLIB_OSGB_HPP "$Id: 8d8f45bf479e7191b7dae5f8dd2f43ede9e934
d2 $" | | #define GEOGRAPHICLIB_OSGB_HPP "$Id: e91367e693ad63bb500c953e9c21445bef0174
64 $" | |
| | | | |
| #include <string> | | #include <string> | |
| #include <sstream> | | #include <sstream> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/TransverseMercator.hpp> | | #include <GeographicLib/TransverseMercator.hpp> | |
| | | | |
| #if defined(_MSC_VER) | | #if defined(_MSC_VER) | |
| // Squelch warnings about dll vs string | | // Squelch warnings about dll vs string | |
| #pragma warning (push) | | #pragma warning (push) | |
| #pragma warning (disable: 4251) | | #pragma warning (disable: 4251) | |
| | | | |
| skipping to change at line 197 | | skipping to change at line 197 | |
| * @return \e f the inverse flattening of the Airy 1830 ellipsoid. | | * @return \e f the inverse flattening of the Airy 1830 ellipsoid. | |
| * | | * | |
| * For the Airy 1830 ellipsoid, \e a = 20923713 ft and \e b = 20853810
ft; | | * For the Airy 1830 ellipsoid, \e a = 20923713 ft and \e b = 20853810
ft; | |
| * thus the flattening = (20923713 - 20853810)/20923713 = 7767/2324857
= | | * thus the flattening = (20923713 - 20853810)/20923713 = 7767/2324857
= | |
| * 1/299.32496459... (The Airy 1830 value is returned because the OSGB | | * 1/299.32496459... (The Airy 1830 value is returned because the OSGB | |
| * projection is based on this ellipsoid.) | | * projection is based on this ellipsoid.) | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real Flattening() throw() | | static Math::real Flattening() throw() | |
| { return real(20923713 - 20853810) / real(20923713); } | | { return real(20923713 - 20853810) / real(20923713); } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the Airy 1830 ellipsoid. | | * @return \e r the inverse flattening of the Airy 1830 ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real InverseFlattening() throw() { return 1/Flattening();
} | | static Math::real InverseFlattening() throw() { return 1/Flattening();
} | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return \e k0 central scale for the OSGB projection (0.9996012717). | | * @return \e k0 central scale for the OSGB projection (0.9996012717). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real CentralScale() throw() | | static Math::real CentralScale() throw() | |
| { return real(0.9996012717L); } | | { return real(0.9996012717L); } | |
| | | | |
| /** | | /** | |
| * @return latitude of the origin for the OSGB projection (49 degrees). | | * @return latitude of the origin for the OSGB projection (49 degrees). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 3 lines changed or added | |
|
| PolarStereographic.hpp | | PolarStereographic.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file PolarStereographic.hpp | | * \file PolarStereographic.hpp | |
| * \brief Header for GeographicLib::PolarStereographic class | | * \brief Header for GeographicLib::PolarStereographic class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP) | | #if !defined(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP) | |
| #define GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP \ | | #define GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP \ | |
|
| "$Id: 8f2e5895b63cd512461959768583b869ded4fdbb $" | | "$Id: 07add8492c46e42012007a8738060abc902a5504 $" | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Polar Stereographic Projection | | * \brief Polar Stereographic Projection | |
| * | | * | |
| * Implementation taken from the report, | | * Implementation taken from the report, | |
| * - J. P. Snyder, | | * - J. P. Snyder, | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 151 | |
| * the value used in the constructor. | | * the value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _a; } | | Math::real MajorRadius() const throw() { return _a; } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value use
d in | | * @return \e f the flattening of the ellipsoid. This is the value use
d in | |
| * the constructor. | | * the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _f; } | | Math::real Flattening() const throw() { return _f; } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() { return 1/_f; } | | Math::real InverseFlattening() const throw() { return 1/_f; } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * The central scale for the projection. This is the value of \e k0 us
ed | | * The central scale for the projection. This is the value of \e k0 us
ed | |
| * in the constructor and is the scale at the pole unless overridden by | | * in the constructor and is the scale at the pole unless overridden by | |
| * PolarStereographic::SetScale. | | * PolarStereographic::SetScale. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real CentralScale() const throw() { return _k0; } | | Math::real CentralScale() const throw() { return _k0; } | |
| ///@} | | ///@} | |
| | | | |
| /** | | /** | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 3 lines changed or added | |
|
| PolygonArea.hpp | | PolygonArea.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file PolygonArea.hpp | | * \file PolygonArea.hpp | |
| * \brief Header for GeographicLib::PolygonArea class | | * \brief Header for GeographicLib::PolygonArea class | |
| * | | * | |
| * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | | * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen
sed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP) | | #if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP) | |
| #define GEOGRAPHICLIB_POLYGONAREA_HPP \ | | #define GEOGRAPHICLIB_POLYGONAREA_HPP \ | |
|
| "$Id: 8c532d61c2cec114c7bf224b2f80a1c249748f1b $" | | "$Id: 7a339f312a9c977b9fccad3c0c8bfa9009d863e2 $" | |
| | | | |
| #include <GeographicLib/Geodesic.hpp> | | #include <GeographicLib/Geodesic.hpp> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/Accumulator.hpp> | | #include <GeographicLib/Accumulator.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Polygon Areas. | | * \brief Polygon Areas. | |
| * | | * | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| * | | * | |
| * This class lets you add vertices one at a time to the polygon. The ar
ea | | * This class lets you add vertices one at a time to the polygon. The ar
ea | |
| * and perimeter are accumulated in two times the standard floating point | | * and perimeter are accumulated in two times the standard floating point | |
| * precision to guard against the loss of accuracy with many-sided polygo
ns. | | * precision to guard against the loss of accuracy with many-sided polygo
ns. | |
| * At any point you can ask for the perimeter and area so far. There's a
n | | * At any point you can ask for the perimeter and area so far. There's a
n | |
| * option to treat the points as defining a polyline instead of a polygon
; in | | * option to treat the points as defining a polyline instead of a polygon
; in | |
| * that case, only the perimeter is computed. | | * that case, only the perimeter is computed. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-PolygonArea.cpp | | * \include example-PolygonArea.cpp | |
|
| | | * | |
| | | * <a href="Planimeter.1.html">Planimeter</a> is a command-line utility | |
| | | * providing access to the functionality of PolygonArea. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT PolygonArea { | | class GEOGRAPHIC_EXPORT PolygonArea { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| Geodesic _earth; | | Geodesic _earth; | |
| real _area0; // Full ellipsoid area | | real _area0; // Full ellipsoid area | |
| bool _polyline; // Assume polyline (don't close and skip ar
ea) | | bool _polyline; // Assume polyline (don't close and skip ar
ea) | |
| unsigned _mask; | | unsigned _mask; | |
| unsigned _num; | | unsigned _num; | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 4 lines changed or added | |
|
| TransverseMercator.hpp | | TransverseMercator.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file TransverseMercator.hpp | | * \file TransverseMercator.hpp | |
| * \brief Header for GeographicLib::TransverseMercator class | | * \brief Header for GeographicLib::TransverseMercator class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP) | | #if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP) | |
| #define GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP \ | | #define GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP \ | |
|
| "$Id: 7c6d8e85b2934c95879f73512fd1d57a65e9f99c $" | | "$Id: 94bb078aa13d2d7392cee5498aae7df6e9914e4a $" | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| #if !defined(TM_TX_MAXPOW) | | #if !defined(TM_TX_MAXPOW) | |
| /** | | /** | |
| * The order of the series approximation used in TransverseMercator. | | * The order of the series approximation used in TransverseMercator. | |
| * TM_TX_MAXPOW can be set to any integer in [4, 8]. | | * TM_TX_MAXPOW can be set to any integer in [4, 8]. | |
| **********************************************************************/ | | **********************************************************************/ | |
| #define TM_TX_MAXPOW \ | | #define TM_TX_MAXPOW \ | |
| (GEOGRAPHICLIB_PREC == 1 ? 6 : (GEOGRAPHICLIB_PREC == 0 ? 4 : 8)) | | (GEOGRAPHICLIB_PREC == 1 ? 6 : (GEOGRAPHICLIB_PREC == 0 ? 4 : 8)) | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 73 | |
| * Grid (<a href="http://www.spatialreference.org/ref/epsg/7405/"> | | * Grid (<a href="http://www.spatialreference.org/ref/epsg/7405/"> | |
| * EPSG:7405</a>) which requires the use of a latitude of origin. This i
s | | * EPSG:7405</a>) which requires the use of a latitude of origin. This i
s | |
| * implemented by the GeographicLib::OSGB class. | | * implemented by the GeographicLib::OSGB class. | |
| * | | * | |
| * See TransverseMercator.cpp for more information on the implementation. | | * See TransverseMercator.cpp for more information on the implementation. | |
| * | | * | |
| * See \ref transversemercator for a discussion of this projection. | | * See \ref transversemercator for a discussion of this projection. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-TransverseMercator.cpp | | * \include example-TransverseMercator.cpp | |
|
| | | * | |
| | | * <a href="TransverseMercatorProj.1.html">TransverseMercatorProj</a> is | |
| | | a | |
| | | * command-line utility providing access to the functionality of | |
| | | * TransverseMercator and TransverseMercatorExact. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT TransverseMercator { | | class GEOGRAPHIC_EXPORT TransverseMercator { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| static const int maxpow_ = TM_TX_MAXPOW; | | static const int maxpow_ = TM_TX_MAXPOW; | |
| static const real tol_; | | static const real tol_; | |
| static const real overflow_; | | static const real overflow_; | |
| static const int numit_ = 5; | | static const int numit_ = 5; | |
| real _a, _f, _k0, _e2, _e, _e2m, _c, _n; | | real _a, _f, _k0, _e2, _e, _e2m, _c, _n; | |
| | | | |
| skipping to change at line 179 | | skipping to change at line 183 | |
| * the value used in the constructor. | | * the value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _a; } | | Math::real MajorRadius() const throw() { return _a; } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value use
d in | | * @return \e f the flattening of the ellipsoid. This is the value use
d in | |
| * the constructor. | | * the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _f; } | | Math::real Flattening() const throw() { return _f; } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() { return 1/_f; } | | Math::real InverseFlattening() const throw() { return 1/_f; } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return \e k0 central scale for the projection. This is the value o
f \e | | * @return \e k0 central scale for the projection. This is the value o
f \e | |
| * k0 used in the constructor and is the scale on the central meridia
n. | | * k0 used in the constructor and is the scale on the central meridia
n. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real CentralScale() const throw() { return _k0; } | | Math::real CentralScale() const throw() { return _k0; } | |
| ///@} | | ///@} | |
| | | | |
| /** | | /** | |
| * A global instantiation of TransverseMercator with the WGS84 ellipsoi
d | | * A global instantiation of TransverseMercator with the WGS84 ellipsoi
d | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 8 lines changed or added | |
|
| TransverseMercatorExact.hpp | | TransverseMercatorExact.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file TransverseMercatorExact.hpp | | * \file TransverseMercatorExact.hpp | |
| * \brief Header for GeographicLib::TransverseMercatorExact class | | * \brief Header for GeographicLib::TransverseMercatorExact class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP) | | #if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP) | |
| #define GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP \ | | #define GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP \ | |
|
| "$Id: 9516cea48fed92db266fb5e04cab934e97743cb3 $" | | "$Id: bd96340b9dc3e7bfd09d4374296a75f4c6e00fc3 $" | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/EllipticFunction.hpp> | | #include <GeographicLib/EllipticFunction.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief An exact implementation of the Transverse Mercator Projection | | * \brief An exact implementation of the Transverse Mercator Projection | |
| * | | * | |
| * Implementation of the Transverse Mercator Projection given in | | * Implementation of the Transverse Mercator Projection given in | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 73 | |
| * type="application/vnd.google-earth.kmz"> tm-grid.kmz</a>, for an | | * type="application/vnd.google-earth.kmz"> tm-grid.kmz</a>, for an | |
| * illustration of the transverse Mercator grid in Google Earth. | | * illustration of the transverse Mercator grid in Google Earth. | |
| * | | * | |
| * See TransverseMercatorExact.cpp for more information on the | | * See TransverseMercatorExact.cpp for more information on the | |
| * implementation. | | * implementation. | |
| * | | * | |
| * See \ref transversemercator for a discussion of this projection. | | * See \ref transversemercator for a discussion of this projection. | |
| * | | * | |
| * Example of use: | | * Example of use: | |
| * \include example-TransverseMercatorExact.cpp | | * \include example-TransverseMercatorExact.cpp | |
|
| | | * | |
| | | * <a href="TransverseMercatorProj.1.html">TransverseMercatorProj</a> is | |
| | | a | |
| | | * command-line utility providing access to the functionality of | |
| | | * TransverseMercator and TransverseMercatorExact. | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| class GEOGRAPHIC_EXPORT TransverseMercatorExact { | | class GEOGRAPHIC_EXPORT TransverseMercatorExact { | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| static const real tol_; | | static const real tol_; | |
| static const real tol1_; | | static const real tol1_; | |
| static const real tol2_; | | static const real tol2_; | |
| static const real taytol_; | | static const real taytol_; | |
| static const real overflow_; | | static const real overflow_; | |
| | | | |
| skipping to change at line 244 | | skipping to change at line 248 | |
| * the value used in the constructor. | | * the value used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real MajorRadius() const throw() { return _a; } | | Math::real MajorRadius() const throw() { return _a; } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value use
d in | | * @return \e f the flattening of the ellipsoid. This is the value use
d in | |
| * the constructor. | | * the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _f; } | | Math::real Flattening() const throw() { return _f; } | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the ellipsoid. | | * @return \e r the inverse flattening of the ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real InverseFlattening() const throw() { return 1/_f; } | | Math::real InverseFlattening() const throw() { return 1/_f; } | |
|
| | | /// \endcond | |
| | | | |
| /** | | /** | |
| * @return \e k0 central scale for the projection. This is the value o
f \e | | * @return \e k0 central scale for the projection. This is the value o
f \e | |
| * k0 used in the constructor and is the scale on the central meridia
n. | | * k0 used in the constructor and is the scale on the central meridia
n. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real CentralScale() const throw() { return _k0; } | | Math::real CentralScale() const throw() { return _k0; } | |
| ///@} | | ///@} | |
| | | | |
| /** | | /** | |
| * A global instantiation of TransverseMercatorExact with the WGS84 | | * A global instantiation of TransverseMercatorExact with the WGS84 | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 8 lines changed or added | |
|
| UTMUPS.hpp | | UTMUPS.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file UTMUPS.hpp | | * \file UTMUPS.hpp | |
| * \brief Header for GeographicLib::UTMUPS class | | * \brief Header for GeographicLib::UTMUPS class | |
| * | | * | |
| * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_UTMUPS_HPP) | | #if !defined(GEOGRAPHICLIB_UTMUPS_HPP) | |
| #define GEOGRAPHICLIB_UTMUPS_HPP \ | | #define GEOGRAPHICLIB_UTMUPS_HPP \ | |
|
| "$Id: abe46ba34b3f962dcb212cc086eaf753a671030f $" | | "$Id: a529ed8aeaeffb02994254bbc7eb1209aa41b9ca $" | |
| | | | |
| #include <sstream> | | #include <sstream> | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| /** | | /** | |
| * \brief Convert between Geographic coordinates and UTM/UPS | | * \brief Convert between Geographic coordinates and UTM/UPS | |
| * | | * | |
| * UTM and UPS are defined | | * UTM and UPS are defined | |
| | | | |
| skipping to change at line 306 | | skipping to change at line 306 | |
| { return Constants::WGS84_a<real>(); } | | { return Constants::WGS84_a<real>(); } | |
| | | | |
| /** | | /** | |
| * @return \e f the flattening of the WGS84 ellipsoid. | | * @return \e f the flattening of the WGS84 ellipsoid. | |
| * | | * | |
| * (The WGS84 value is returned because the UTM and UPS projections are | | * (The WGS84 value is returned because the UTM and UPS projections are | |
| * based on this ellipsoid.) | | * based on this ellipsoid.) | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real Flattening() throw() | | static Math::real Flattening() throw() | |
| { return Constants::WGS84_f<real>(); } | | { return Constants::WGS84_f<real>(); } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * @return \e r the inverse flattening of the WGS84 ellipsoid. | | * @return \e r the inverse flattening of the WGS84 ellipsoid. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| static Math::real InverseFlattening() throw() | | static Math::real InverseFlattening() throw() | |
| { return 1/Constants::WGS84_f<real>(); } | | { return 1/Constants::WGS84_f<real>(); } | |
|
| ///@} | | /// \endcond | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
| #endif // GEOGRAPHICLIB_UTMUPS_HPP | | #endif // GEOGRAPHICLIB_UTMUPS_HPP | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 4 lines changed or added | |
|
| Utility.hpp | | Utility.hpp | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * \file Utility.hpp | | * \file Utility.hpp | |
| * \brief Header for GeographicLib::Utility class | | * \brief Header for GeographicLib::Utility class | |
| * | | * | |
| * Copyright (c) Charles Karney (2011, 2012) <charles@karney.com> and licen
sed | | * Copyright (c) Charles Karney (2011, 2012) <charles@karney.com> and licen
sed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_UTILITY_HPP) | | #if !defined(GEOGRAPHICLIB_UTILITY_HPP) | |
| #define GEOGRAPHICLIB_UTILITY_HPP \ | | #define GEOGRAPHICLIB_UTILITY_HPP \ | |
|
| "$Id: 8a1cdf4f0de95da280d56bbf8ea299dad043f0b2 $" | | "$Id: 92c92fcb8ea92116fed01909c2611934b708e4cd $" | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <iomanip> | | #include <iomanip> | |
| #include <vector> | | #include <vector> | |
| #include <string> | | #include <string> | |
| #include <sstream> | | #include <sstream> | |
| #include <algorithm> | | #include <algorithm> | |
| #include <cctype> | | #include <cctype> | |
| | | | |
| namespace GeographicLib { | | namespace GeographicLib { | |
| | | | |
| skipping to change at line 398 | | skipping to change at line 398 | |
| int k = int(num); // data values left to read | | int k = int(num); // data values left to read | |
| int i = 0; // index into output array | | int i = 0; // index into output array | |
| while (k) { | | while (k) { | |
| int n = (std::min)(k, bufsize); | | int n = (std::min)(k, bufsize); | |
| str.read(reinterpret_cast<char *>(buffer), n * sizeof(ExtT)); | | str.read(reinterpret_cast<char *>(buffer), n * sizeof(ExtT)); | |
| if (!str.good()) | | if (!str.good()) | |
| throw GeographicErr("Failure reading data"); | | throw GeographicErr("Failure reading data"); | |
| for (int j = 0; j < n; ++j) | | for (int j = 0; j < n; ++j) | |
| // fix endian-ness and cast to IntT | | // fix endian-ness and cast to IntT | |
| array[i++] = IntT(bigendp == Math::bigendian ? buffer[j] : | | array[i++] = IntT(bigendp == Math::bigendian ? buffer[j] : | |
|
| Math::swab<IntT>(buffer[j])); | | Math::swab<ExtT>(buffer[j])); | |
| k -= n; | | k -= n; | |
| } | | } | |
| } | | } | |
| return; | | return; | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Read data of type ExtT from a binary stream to a vector array of typ
e | | * Read data of type ExtT from a binary stream to a vector array of typ
e | |
| * IntT. The data in the file is in (bigendp ? big : little)-endian | | * IntT. The data in the file is in (bigendp ? big : little)-endian | |
| * format. | | * format. | |
| | | | |
| skipping to change at line 424 | | skipping to change at line 424 | |
| * (external). | | * (external). | |
| * @param[out] array the output vector of type IntT (internal). | | * @param[out] array the output vector of type IntT (internal). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| template<typename ExtT, typename IntT, bool bigendp> | | template<typename ExtT, typename IntT, bool bigendp> | |
| static inline void readarray(std::istream& str, | | static inline void readarray(std::istream& str, | |
| std::vector<IntT>& array) { | | std::vector<IntT>& array) { | |
| readarray<ExtT, IntT, bigendp>(str, &array[0], array.size()); | | readarray<ExtT, IntT, bigendp>(str, &array[0], array.size()); | |
| } | | } | |
| | | | |
| /** | | /** | |
|
| | | * Write data in an array of type IntT as type ExtT to a binary stream. | |
| | | * The data in the file is in (bigendp ? big : little)-endian format. | |
| | | * | |
| | | * @tparam ExtT the type of the objects in the binary stream (external) | |
| | | . | |
| | | * @tparam IntT the type of the objects in the array (internal). | |
| | | * @tparam bigendp true if the external storage format is big-endian. | |
| | | * @param[out] str the output stream for the data of type ExtT (externa | |
| | | l). | |
| | | * @param[in] array the input array of type IntT (internal). | |
| | | * @param[in] num the size of the array. | |
| | | ********************************************************************** | |
| | | / | |
| | | template<typename ExtT, typename IntT, bool bigendp> | |
| | | static inline void writearray(std::ostream& str, | |
| | | const IntT array[], size_t num) { | |
| | | if (sizeof(IntT) == sizeof(ExtT) && | |
| | | std::numeric_limits<IntT>::is_integer == | |
| | | std::numeric_limits<ExtT>::is_integer && | |
| | | bigendp == Math::bigendian) { | |
| | | // Data is compatible (including endian-ness). | |
| | | str.write(reinterpret_cast<const char *>(array), num * sizeof(ExtT) | |
| | | ); | |
| | | if (!str.good()) | |
| | | throw GeographicErr("Failure writing data"); | |
| | | } else { | |
| | | const int bufsize = 1024; // write this many values at a time | |
| | | ExtT buffer[bufsize]; // temporary buffer | |
| | | int k = int(num); // data values left to write | |
| | | int i = 0; // index into output array | |
| | | while (k) { | |
| | | int n = (std::min)(k, bufsize); | |
| | | for (int j = 0; j < n; ++j) | |
| | | // cast to ExtT and fix endian-ness | |
| | | buffer[j] = bigendp == Math::bigendian ? ExtT(array[i++]) : | |
| | | Math::swab<ExtT>(ExtT(array[i++])); | |
| | | str.write(reinterpret_cast<const char *>(buffer), n * sizeof(ExtT | |
| | | )); | |
| | | if (!str.good()) | |
| | | throw GeographicErr("Failure writing data"); | |
| | | k -= n; | |
| | | } | |
| | | } | |
| | | return; | |
| | | } | |
| | | | |
| | | /** | |
| | | * Write data in an array of type IntT as type ExtT to a binary stream. | |
| | | * The data in the file is in (bigendp ? big : little)-endian format. | |
| | | * | |
| | | * @tparam ExtT the type of the objects in the binary stream (external) | |
| | | . | |
| | | * @tparam IntT the type of the objects in the array (internal). | |
| | | * @tparam bigendp true if the external storage format is big-endian. | |
| | | * @param[out] str the output stream for the data of type ExtT (externa | |
| | | l). | |
| | | * @param[in] array the input vector of type IntT (internal). | |
| | | ********************************************************************** | |
| | | / | |
| | | template<typename ExtT, typename IntT, bool bigendp> | |
| | | static inline void writearray(std::ostream& str, | |
| | | std::vector<IntT>& array) { | |
| | | writearray<ExtT, IntT, bigendp>(str, &array[0], array.size()); | |
| | | } | |
| | | | |
| | | /** | |
| * Parse a KEY VALUE line. | | * Parse a KEY VALUE line. | |
| * | | * | |
| * @param[in] line the input line. | | * @param[in] line the input line. | |
| * @param[out] key the key. | | * @param[out] key the key. | |
| * @param[out] val the value. | | * @param[out] val the value. | |
| * @return whether a key was found. | | * @return whether a key was found. | |
| * | | * | |
| * A # character and everything after it are discarded. If the results
is | | * A # character and everything after it are discarded. If the results
is | |
| * just white space, the routine returns false (and \e key and \e val a
re | | * just white space, the routine returns false (and \e key and \e val a
re | |
| * not set). Otherwise the first token is taken to be the key and the
rest | | * not set). Otherwise the first token is taken to be the key and the
rest | |
| | | | |
End of changes. 3 change blocks. |
| 2 lines changed or deleted | | 68 lines changed or added | |
|