Changeset 5040 in josm for trunk/src


Ignore:
Timestamp:
2012-03-04T21:56:39+01:00 (13 years ago)
Author:
Don-vip
Message:

Allow plugins to retrieve known Lambert projection parameters

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

Legend:

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

    r5039 r5040  
    4040    public final Datum getDatum() {
    4141        return datum;
     42    }
     43
     44    public final Proj getProj() {
     45        return proj;
    4246    }
    4347
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r4285 r5040  
    1717    protected Ellipsoid ellps;
    1818    protected double e;
     19   
     20    public static abstract class Parameters {
     21        public final double latitudeOrigin;
     22        public Parameters(double latitudeOrigin) {
     23            this.latitudeOrigin = latitudeOrigin;
     24        }
     25    };
     26   
     27    public static class Parameters1SP extends Parameters {
     28        public Parameters1SP(double latitudeOrigin) {
     29            super(latitudeOrigin);
     30        }
     31    }
    1932
     33    public static class Parameters2SP extends Parameters {
     34        public final double standardParallel1;
     35        public final double standardParallel2;
     36        public Parameters2SP(double latitudeOrigin, double standardParallel1, double standardParallel2) {
     37            super(latitudeOrigin);
     38            this.standardParallel1 = standardParallel1;
     39            this.standardParallel2 = standardParallel2;
     40        }
     41    }
     42
     43    private Parameters params;
     44   
    2045    /**
    2146     * projection exponent
     
    5378     */
    5479    public void updateParameters2SP(Ellipsoid ellps, double lat_0, double lat_1, double lat_2) {
     80        this.params = new Parameters2SP(lat_0, lat_1, lat_2);
    5581        this.ellps = ellps;
    5682        this.e = ellps.e;
     
    75101     */
    76102    public void updateParameters1SP(Ellipsoid ellps, double lat_0) {
     103        this.params = new Parameters1SP(lat_0);
    77104        this.ellps = ellps;
    78105        this.e = ellps.e;
     
    96123     */
    97124    public void updateParametersDirect(Ellipsoid ellps, double n, double F, double r0) {
     125        this.params = null;
    98126        this.ellps = ellps;
    99127        this.e = ellps.e;
     
    149177    }
    150178   
     179    public final Parameters getParameters() {
     180        return params;
     181    }
    151182}
Note: See TracChangeset for help on using the changeset viewer.