GeoTools
  1. GeoTools
  2. GEOT-2716

Geodetic Caluclator - Wrong distance for points on geodetic curve

    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 computing a geodetic curve the distance between the points on the curve is wrong.

      The problem seems to be in the method "getGeodeticCurve(final int numberOfPoints)":
      deltaDistance (distance between steps) = distance / (numberOfPoints+1)
      loop: for (int i = 1; i < numberOfPoints; i++)
      the last point before the destination point is not calculated or the distance between the points is to short

      current curve (numberOfPoints = 3):
      o--o-o-----o

      correct curve (extend deltaDistance to distance / numberOfPoints):
      o---o--o---o
      or (add one extra point with running to loop one more time (for (int i = 1; i <= numberOfPoints; i++)):
      o--o-o-o--o

        Activity

        Hide
        Michael Bedward added a comment -
        Many thanks for the report and the test case.

        Confirmed the issue and fixed in trunk and 2.5.x.

        Note: changing the loop end condition provokes a unit test failure on an assert with a cryptic (to me) comment from Martin. Changing the deltaDistance calculation works.
        Show
        Michael Bedward added a comment - Many thanks for the report and the test case. Confirmed the issue and fixed in trunk and 2.5.x. Note: changing the loop end condition provokes a unit test failure on an assert with a cryptic (to me) comment from Martin. Changing the deltaDistance calculation works.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: