diff --git a/include/boost/geometry/srs/projections/impl/pj_datums.hpp b/include/boost/geometry/srs/projections/impl/pj_datums.hpp index 55da24a2c..c26067bb9 100644 --- a/include/boost/geometry/srs/projections/impl/pj_datums.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_datums.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -41,17 +41,35 @@ #include +#include + namespace boost { namespace geometry { namespace projections { namespace detail { +// Originally defined in projects.h +struct pj_datums_type +{ + std::string id; /* datum keyword */ + std::string defn; /* ie. "to_wgs84=..." */ + std::string ellipse_id; /* ie from ellipse table */ + std::string comments; /* EPSG code, etc */ +}; + +// Originally defined in projects.h +struct pj_prime_meridians_type +{ + std::string id; /* prime meridian keyword */ + std::string defn; /* offset from greenwich in DMS format. */ +}; + /* * The ellipse code must match one from pj_ellps.c. The datum id should * be kept to 12 characters or less if possible. Use the official OGC * datum name for the comments if available. */ -static const PJ_DATUMS pj_datums[] = +static const pj_datums_type pj_datums[] = { /* id definition ellipse comments */ /* -- ---------- ------- -------- */ @@ -87,7 +105,7 @@ static const PJ_DATUMS pj_datums[] = }; -static const PJ_PRIME_MERIDIANS pj_prime_meridians[] = +static const pj_prime_meridians_type pj_prime_meridians[] = { /* id definition */ /* -- ---------- */ diff --git a/include/boost/geometry/srs/projections/impl/pj_ellps.hpp b/include/boost/geometry/srs/projections/impl/pj_ellps.hpp index 586802778..da13f7f14 100644 --- a/include/boost/geometry/srs/projections/impl/pj_ellps.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_ellps.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -41,11 +41,22 @@ #include +#include + namespace boost { namespace geometry { namespace projections { namespace detail { -static const PJ_ELLPS pj_ellps[] = +// Originally defined in projects.h +struct pj_ellps_type +{ + std::string id; /* ellipse keyword name */ + std::string major; /* a= value */ + std::string ell; /* elliptical parameter */ + std::string name; /* comments */ +}; + +static const pj_ellps_type pj_ellps[] = { {"MERIT", "a=6378137.0", "rf=298.257", "MERIT 1983"}, {"SGS85", "a=6378136.0", "rf=298.257", "Soviet Geodetic System 85"}, diff --git a/include/boost/geometry/srs/projections/impl/pj_units.hpp b/include/boost/geometry/srs/projections/impl/pj_units.hpp index 269b8ff92..98e1fa4c9 100644 --- a/include/boost/geometry/srs/projections/impl/pj_units.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_units.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -44,11 +44,19 @@ namespace boost { namespace geometry { namespace projections { namespace detail { +// Originally defined in projects.h +struct pj_units_type +{ + std::string id; /* units keyword */ + std::string to_meter; /* multiply by value to get meters */ + std::string name; /* comments */ +}; + /* Field 2 that contains the multiplier to convert named units to meters ** may be expressed by either a simple floating point constant or a ** numerator/denomenator values (e.g. 1/1000) */ -static const PJ_UNITS pj_units[] = +static const pj_units_type pj_units[] = { { "km", "1000.", "Kilometer" }, { "m", "1.", "Meter" }, diff --git a/include/boost/geometry/srs/projections/impl/pj_zpoly1.hpp b/include/boost/geometry/srs/projections/impl/pj_zpoly1.hpp index 613b6d2b3..4cb1cb1f6 100644 --- a/include/boost/geometry/srs/projections/impl/pj_zpoly1.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_zpoly1.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -52,10 +52,10 @@ namespace boost { namespace geometry { namespace projections { namespace detail ** n should always be >= 1 though no checks are made */ template - inline COMPLEX - pj_zpoly1(COMPLEX z, const COMPLEX *C, int n) + inline pj_complex + pj_zpoly1(pj_complex z, const pj_complex *C, int n) { - COMPLEX a; + pj_complex a; T t; a = *(C += n); @@ -71,14 +71,14 @@ namespace boost { namespace geometry { namespace projections { namespace detail /* evaluate complex polynomial and derivative */ template - inline COMPLEX - pj_zpolyd1(COMPLEX z, const COMPLEX *C, int n, COMPLEX *der) + inline pj_complex + pj_zpolyd1(pj_complex z, const pj_complex *C, int n, pj_complex *der) { T t; bool first = true; - COMPLEX a = *(C += n); - COMPLEX b = a; + pj_complex a = *(C += n); + pj_complex b = a; while (n-- > 0) { if (first) diff --git a/include/boost/geometry/srs/projections/impl/projects.hpp b/include/boost/geometry/srs/projections/impl/projects.hpp index 504764b35..312522a3d 100644 --- a/include/boost/geometry/srs/projections/impl/projects.hpp +++ b/include/boost/geometry/srs/projections/impl/projects.hpp @@ -60,11 +60,11 @@ namespace detail /* datum_type values */ enum datum_type { - datum_unknown = 0, - datum_3param = 1, - datum_7param = 2, + datum_unknown = 0, + datum_3param = 1, + datum_7param = 2, datum_gridshift = 3, - datum_wgs84 = 4 /* WGS84 (or anything considered equivelent) */ + datum_wgs84 = 4 /* WGS84 (or anything considered equivelent) */ }; /* library errors */ @@ -140,16 +140,16 @@ struct pvalue // Originally defined in proj_internal.h //enum pj_io_units { -// PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */ -// PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */ -// PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */ -// PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */ -// PJ_IO_UNITS_ANGULAR = 4 /* Radians */ +// pj_io_units_whatever = 0, /* Doesn't matter (or depends on pipeline neighbours) */ +// pj_io_units_classic = 1, /* Scaled meters (right), projected system */ +// pj_io_units_projected = 2, /* Meters, projected system */ +// pj_io_units_cartesian = 3, /* Meters, 3D cartesian system */ +// pj_io_units_angular = 4 /* Radians */ //}; // Originally defined in proj_internal.h /* Maximum latitudinal overshoot accepted */ -//static const double PJ_EPS_LAT = 1e-12; +//static const double pj_epsilon_lat = 1e-12; template struct pj_consts @@ -222,55 +222,7 @@ struct pj_consts // PROJ4 complex. Might be replaced with std::complex template -struct COMPLEX { T r, i; }; - -struct PJ_ELLPS -{ - std::string id; /* ellipse keyword name */ - std::string major; /* a= value */ - std::string ell; /* elliptical parameter */ - std::string name; /* comments */ -}; - -struct PJ_DATUMS -{ - std::string id; /* datum keyword */ - std::string defn; /* ie. "to_wgs84=..." */ - std::string ellipse_id; /* ie from ellipse table */ - std::string comments; /* EPSG code, etc */ -}; - -struct PJ_PRIME_MERIDIANS -{ - std::string id; /* prime meridian keyword */ - std::string defn; /* offset from greenwich in DMS format. */ -}; - -struct PJ_UNITS -{ - std::string id; /* units keyword */ - std::string to_meter; /* multiply by value to get meters */ - std::string name; /* comments */ -}; - -template -struct DERIVS -{ - T x_l, x_p; /* derivatives of x for lambda-phi */ - T y_l, y_p; /* derivatives of y for lambda-phi */ -}; - -template -struct FACTORS -{ - DERIVS der; - T h, k; /* meridinal, parallel scales */ - T omega, thetap; /* angular distortion, theta prime */ - T conv; /* convergence */ - T s; /* areal scale factor */ - T a, b; /* max-min scale error */ - int code; /* info as to analytics, see following */ -}; +struct pj_complex { T r, i; }; } // namespace detail #endif // DOXYGEN_NO_DETAIL diff --git a/include/boost/geometry/srs/projections/proj/igh.hpp b/include/boost/geometry/srs/projections/proj/igh.hpp index 9ef6a7935..f9554cf47 100644 --- a/include/boost/geometry/srs/projections/proj/igh.hpp +++ b/include/boost/geometry/srs/projections/proj/igh.hpp @@ -102,7 +102,7 @@ namespace projections template inline T d180() { return T(180) * geometry::math::d2r(); } - static const double EPSLN = 1.e-10; // allow a little 'slack' on zone edge positions + static const double epsilon = 1.e-10; // allow a little 'slack' on zone edge positions // Converted from #define SETUP(n, proj, x_0, y_0, lon_0) template