Ignore:
Timestamp:
2016-01-21T16:46:00+01:00 (8 years ago)
Author:
bastiK
Message:

always normalize longitude before projection and after inverse projection (see #12186)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java

    r9545 r9558  
    288288                lon2 += 2.0 * Math.PI;
    289289            }
    290             centralMeridian = normalizeLon(0.5 * (lon1 + lon2) -
     290            centralMeridian = normalizeLonRad(0.5 * (lon1 + lon2) -
    291291                     Math.atan(J * Math.tan(0.5 * B * (lon1 - lon2)) / P) / B);
    292             gamma0 = Math.atan(2.0 * Math.sin(B * normalizeLon(lon1 - centralMeridian)) /
     292            gamma0 = Math.atan(2.0 * Math.sin(B * normalizeLonRad(lon1 - centralMeridian)) /
    293293                     (Fp - 1.0 / Fp));
    294294            azimuth = Math.asin(D * Math.sin(gamma0));
     
    359359    }
    360360
     361    private double normalizeLonRad(double a) {
     362        return Math.toRadians(LatLon.normalizeLon(Math.toDegrees(a)));
     363    }
     364
    361365    @Override
    362366    public double[] project(double y, double x) {
    363         x = normalizeLon(x);
    364367        double u, v;
    365368        if (Math.abs(Math.abs(y) - Math.PI/2.0) > EPSILON) {
Note: See TracChangeset for help on using the changeset viewer.