GeoTools
  1. GeoTools
  2. GEOT-2715

GeodeticCalculator - Wrong azimuth calculation

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.5.8, 2.6-M3
    • Component/s: referencing
    • Labels:
      None
    • Environment:
      winxp, java 1.5.0_11
    • Testcase included:
      yes

      Description

      When trying to compute a geodetic curve at the equator from east to west,
      a wrong azimuth is calculated.

      The problem seems to be in the (private) method "computeDirection":
      If "dlon" (delta longitude) is < 0 a wrong calculation is done:
      ... Math.PI * (3 / 2) ...
      (3 / 2) is computed as integer and then used with pi.

      The whole computation must be performed with double precision!

        Activity

        Hide
        Michael Bedward added a comment -
        Well spotted ! Many thanks for picking this up and providing a test case.

        Fixed in 2.5.x and trunk
        Show
        Michael Bedward added a comment - Well spotted ! Many thanks for picking this up and providing a test case. Fixed in 2.5.x and trunk

          People

          • Assignee:
            Michael Bedward
            Reporter:
            Katrin Lasinger
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: