Ignore:
Timestamp:
2015-05-11T13:34:53+02:00 (4 years ago)
Author:
Don-vip
Message:

squid:S00116 - Field names should comply with a naming convention

Location:
trunk/src/org/openstreetmap/josm/data/projection/proj
Files:
3 edited

Legend:

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

    r8345 r8346  
    1515import static org.openstreetmap.josm.tools.I18n.tr;
    1616
     17import org.openstreetmap.josm.data.projection.CustomProjection.Param;
    1718import org.openstreetmap.josm.data.projection.Ellipsoid;
    1819import org.openstreetmap.josm.data.projection.ProjectionConfigurationException;
     
    6061     * projection factor
    6162     */
    62     protected double F;
     63    protected double f;
    6364    /**
    6465     * radius of the parallel of latitude of the false origin (2SP) or at
     
    7677        ellps = params.ellps;
    7778        e = ellps.e;
    78         if (params.lat_0 == null)
    79             throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0"));
    80         if (params.lat_1 != null && params.lat_2 != null) {
    81             initialize2SP(params.lat_0, params.lat_1, params.lat_2);
     79        if (params.lat0 == null)
     80            throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", Param.lat_0.key));
     81        if (params.lat1 != null && params.lat2 != null) {
     82            initialize2SP(params.lat0, params.lat1, params.lat2);
    8283        } else {
    83             initialize1SP(params.lat_0);
     84            initialize1SP(params.lat0);
    8485        }
    8586    }
     
    103104
    104105        n  = (log(m1) - log(m2)) / (log(t1) - log(t2));
    105         F  = m1 / (n * pow(t1, n));
    106         r0 = F * pow(tf, n);
     106        f  = m1 / (n * pow(t1, n));
     107        r0 = f * pow(tf, n);
    107108    }
    108109
     
    120121
    121122        n = sin(lat_0_rad);
    122         F  = m0 / (n * pow(t0, n));
    123         r0 = F * pow(t0, n);
     123        f  = m0 / (n * pow(t0, n));
     124        r0 = f * pow(t0, n);
    124125    }
    125126
     
    153154        double sinphi = sin(phi);
    154155        double L = (0.5*log((1+sinphi)/(1-sinphi))) - e/2*log((1+e*sinphi)/(1-e*sinphi));
    155         double r = F*exp(-n*L);
     156        double r = f*exp(-n*L);
    156157        double gamma = n*lambda;
    157158        double X = r*sin(gamma);
     
    165166        double gamma = atan(east / (r0-north));
    166167        double lambda = gamma/n;
    167         double latIso = (-1/n) * log(abs(r/F));
     168        double latIso = (-1/n) * log(abs(r/f));
    168169        double phi = ellps.latitude(latIso, e, epsilon);
    169170        return new double[] { phi, lambda };
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java

    r5230 r8346  
    1111    public Ellipsoid ellps;
    1212
    13     public Double lat_0;
    14     public Double lat_1;
    15     public Double lat_2;
    16 
     13    public Double lat0;
     14    public Double lat1;
     15    public Double lat2;
    1716}
  • trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java

    r6920 r8346  
    3535    private double alpha;
    3636    private double b0;
    37     private double K;
     37    private double k;
    3838
    3939    private static final double EPSILON = 1e-11;
     
    4141    @Override
    4242    public void initialize(ProjParameters params) throws ProjectionConfigurationException {
    43         if (params.lat_0 == null)
     43        if (params.lat0 == null)
    4444            throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0"));
    4545        ellps = params.ellps;
    46         initialize(params.lat_0);
     46        initialize(params.lat0);
    4747    }
    4848
     
    5252        alpha = sqrt(1 + (ellps.eb2 * pow(cos(phi0), 4)));
    5353        b0 = asin(sin(phi0) / alpha);
    54         K = log(tan(PI / 4 + b0 / 2)) - alpha
     54        k = log(tan(PI / 4 + b0 / 2)) - alpha
    5555            * log(tan(PI / 4 + phi0 / 2)) + alpha * ellps.e / 2
    5656            * log((1 + ellps.e * sin(phi0)) / (1 - ellps.e * sin(phi0)));
     
    7171
    7272        double S = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2
    73             * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + K;
     73            * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + k;
    7474        double b = 2 * (atan(exp(S)) - PI / 4);
    7575        double l = alpha * lambda;
     
    9494        double lambda = l / alpha;
    9595        double phi = b;
    96         double S = 0;
     96        double s = 0;
    9797
    9898        double prevPhi = -1000;
     
    103103                throw new RuntimeException("Two many iterations");
    104104            prevPhi = phi;
    105             S = 1 / alpha * (log(tan(PI / 4 + b / 2)) - K) + ellps.e
     105            s = 1 / alpha * (log(tan(PI / 4 + b / 2)) - k) + ellps.e
    106106            * log(tan(PI / 4 + asin(ellps.e * sin(phi)) / 2));
    107             phi = 2 * atan(exp(S)) - PI / 2;
     107            phi = 2 * atan(exp(s)) - PI / 2;
    108108        }
    109109        return new double[] { phi, lambda };
Note: See TracChangeset for help on using the changeset viewer.