Ignore:
Timestamp:
2014-08-06T23:57:21+02:00 (5 years ago)
Author:
Don-vip
Message:

Make CustomProjection.Param public so it can be used by plugins + javadoc

File:
1 edited

Legend:

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

    r7184 r7370  
    2828
    2929/**
    30  * Custom projection
     30 * Custom projection.
    3131 *
    3232 * Inspired by PROJ.4 and Proj4J.
     33 * @since 5072
    3334 */
    3435public class CustomProjection extends AbstractProjection {
     
    4546    protected Bounds bounds;
    4647
    47     protected static enum Param {
    48 
     48    /**
     49     * Proj4-like projection parameters. See <a href="https://trac.osgeo.org/proj/wiki/GenParms">reference</a>.
     50     * @since 7370 (public)
     51     */
     52    public static enum Param {
     53
     54        /** False easting */
    4955        x_0("x_0", true),
     56        /** False northing */
    5057        y_0("y_0", true),
     58        /** Central meridian */
    5159        lon_0("lon_0", true),
     60        /** Scaling factor */
    5261        k_0("k_0", true),
     62        /** Ellipsoid name (see {@code proj -le}) */
    5363        ellps("ellps", true),
     64        /** Semimajor radius of the ellipsoid axis */
    5465        a("a", true),
     66        /** Eccentricity of the ellipsoid squared */
    5567        es("es", true),
     68        /** Reciprocal of the ellipsoid flattening term (e.g. 298) */
    5669        rf("rf", true),
     70        /** Flattening of the ellipsoid = 1-sqrt(1-e^2) */
    5771        f("f", true),
     72        /** Semiminor radius of the ellipsoid axis */
    5873        b("b", true),
     74        /** Datum name (see {@code proj -ld}) */
    5975        datum("datum", true),
     76        /** 3 or 7 term datum transform parameters */
    6077        towgs84("towgs84", true),
     78        /** Filename of NTv2 grid file to use for datum transforms */
    6179        nadgrids("nadgrids", true),
     80        /** Projection name (see {@code proj -l}) */
    6281        proj("proj", true),
     82        /** Latitude of origin */
    6383        lat_0("lat_0", true),
     84        /** Latitude of first standard parallel */
    6485        lat_1("lat_1", true),
     86        /** Latitude of second standard parallel */
    6587        lat_2("lat_2", true),
     88        /** the exact proj.4 string will be preserved in the WKT representation */
    6689        wktext("wktext", false),  // ignored
     90        /** meters, US survey feet, etc. */
    6791        units("units", true),     // ignored
     92        /** Don't use the /usr/share/proj/proj_def.dat defaults file */
    6893        no_defs("no_defs", false),
    6994        init("init", true),
     
    88113    }
    89114
     115    /**
     116     * Constructs a new empty {@code CustomProjection}.
     117     */
    90118    public CustomProjection() {
    91119    }
    92120
     121    /**
     122     * Constructs a new {@code CustomProjection} with given parameters.
     123     * @param pref String containing projection parameters (ex: "+proj=tmerc +lon_0=-3 +k_0=0.9996 +x_0=500000 +ellps=WGS84 +datum=WGS84 +bounds=-8,-5,2,85")
     124     */
    93125    public CustomProjection(String pref) {
    94126        this(null, null, pref, null);
     
    96128
    97129    /**
    98      * Constructor.
     130     * Constructs a new {@code CustomProjection} with given name, code and parameters.
    99131     *
    100132     * @param name describe projection in one or two words
     
    119151    }
    120152
     153    /**
     154     * Updates this {@code CustomProjection} with given parameters.
     155     * @param pref String containing projection parameters (ex: "+proj=lonlat +ellps=WGS84 +datum=WGS84 +bounds=-180,-90,180,90")
     156     * @throws ProjectionConfigurationException if {@code pref} cannot be parsed properly
     157     */
    121158    public final void update(String pref) throws ProjectionConfigurationException {
    122159        this.pref = pref;
Note: See TracChangeset for help on using the changeset viewer.