Ignore:
Timestamp:
2016-01-18T22:48:40+01:00 (4 years ago)
Author:
bastiK
Message:

see #12186 - add Oblique Mercator projection
(imports pieces of code from the Geotools project)

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

Legend:

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

    r9432 r9532  
    2525
    2626    /**
     27     * Difference allowed in iterative computations.
     28     */
     29    private static final double ITERATION_TOLERANCE = 1E-10;
     30
     31    /**
    2732     * Relative iteration precision used in the <code>mlfn</code> method
    2833     */
     
    153158
    154159    /**
     160     * Iteratively solve equation (7-9) from Snyder.
     161     */
     162    final double cphi2(final double ts) {
     163        final double eccnth = 0.5 * e;
     164        double phi = (Math.PI/2) - 2.0 * Math.atan(ts);
     165        for (int i=0; i<MAXIMUM_ITERATIONS; i++) {
     166            final double con  = e * Math.sin(phi);
     167            final double dphi = (Math.PI/2) - 2.0*Math.atan(ts * Math.pow((1-con)/(1+con), eccnth)) - phi;
     168            phi += dphi;
     169            if (Math.abs(dphi) <= ITERATION_TOLERANCE) {
     170                return phi;
     171            }
     172        }
     173        throw new RuntimeException("no convergence");
     174    }
     175
     176    /**
    155177     * Computes function <code>f(s,c,e²) = c/sqrt(1 - s²&times;e²)</code> needed for the true scale
    156178     * latitude (Snyder 14-15), where <var>s</var> and <var>c</var> are the sine and cosine of
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java

    r9419 r9532  
    1414    public Double lat1;
    1515    public Double lat2;
     16
     17    // Polar Stereographic
    1618    public Double lat_ts;
     19
     20    // Oblique Mercator
     21    public Double lonc;
     22    public Double alpha;
     23    public Double gamma;
     24    public Boolean no_off;
     25    public Double lon1;
     26    public Double lon2;
    1727}
Note: See TracChangeset for help on using the changeset viewer.