Opened 6 years ago

Closed 6 years ago

#12414 closed Bugs (fixed)

Geometry azimuth does not compile for geographic coordinates

Reported by: Ken Barker <ken.barker@…> Owned by: Barend Gehrels
Milestone: Boost 1.62.0 Component: geometry
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Calling azimuth to find the relative bearing of one point to another in geographic coordinates does not compile, e.g.:

    typedef boost::geometry::cs::geographic<boost::geometry::radian> Wgs84Coords;
    typedef boost::geometry::model::point<double, 2, Wgs84Coords> GeographicPoint;
    typedef boost::geometry::srs::spheroid<double> SpheroidType;

    double azimuth(GeographicPoint boost_a, GeographicPoint boost_b)
    {
      return boost::geometry::detail::azimuth<double>(boost_a, boost_b);
    }

or

    double wgs84_azimuth(GeographicPoint boost_a, GeographicPoint boost_b)
    {
      SpheroidType spheriod(wgs84::a, wgs84::b);
      return boost::geometry::detail::azimuth<double>(boost_a, boost_b, spheriod);
    }

The problem seems to be caused on line 52 of azimuth.hpp in geometry/algorithms/detail, it is:

    return geometry::detail::vincenty_inverse<ReturnType, false, true>

when it should be:

    return geometry::detail::vincenty_inverse<ReturnType, false, true>::apply

The amended line compiles and gives reasonable results.

Change History (1)

comment:1 by awulkiew, 6 years ago

Milestone: To Be DeterminedBoost 1.62.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.