jscience
  1. jscience
  2. JSCIENCE-136

Wrong conversion LatLon to UTM in UTM Grid's exception zones

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: Version 6.0
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      136

      Description

      Hi,

      In zone 31X, 33X, 35X and 37X (and supposedly 31V and 32V), strange conversion
      happens from LatLon to UTM coordinate. I am not sure it is wrong, but it differs
      from Google Earth for example.

      It happens because author decided central meridian for thus zones are not usual
      ones. (For example for longitude zone 37, usual central meridian is 39°
      longitude, however author choosed 40.5°, which is not even zone's center)

      In NGA UTM specification, I can not find a clue about different central meridian
      for thus exceptions zones, and I assume it has to stay same as for the rest of
      longitude zone, but I may be wrong.

      That's why I am suggesting to remove thus special cases in method
      UTM.getCentralMeridian(int, int) as following :

      public static double getCentralMeridian(int longitudeZone, char latitudeZone) {
      // polar zones
      if (latitudeZone < 'C' || latitudeZone > 'X')

      { return 0.0; }

      return Math.toRadians((longitudeZone - 1) * 6 - 180 + 3);
      }

      It should fixed LatLon to UTM conversion in thus zones.

      By the way there is a bug in this method which should be fixed if I am wrong
      with NGA specifications :

      // V latitude zone exceptions
      if (longitudeZone == 'V') {
      if (latitudeZone == 31)

      { return Math.toRadians(1.5); }

      else if (latitudeZone == 32)

      { return Math.toRadians(7.5); }

      }

      longitudeZone should be latitudeZone and vice-versa

      Hope it helps

        Activity

        Hide
        gdelory added a comment -

        Summary spelling fixed

        Show
        gdelory added a comment - Summary spelling fixed
        Hide
        gdelory added a comment -

        Assignment to Paul D. Anderson

        Show
        gdelory added a comment - Assignment to Paul D. Anderson

          People

          • Assignee:
            andersonpd
            Reporter:
            gdelory
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: