- Timestamp:
- 2014-08-06T23:57:21+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r7184 r7370 28 28 29 29 /** 30 * Custom projection 30 * Custom projection. 31 31 * 32 32 * Inspired by PROJ.4 and Proj4J. 33 * @since 5072 33 34 */ 34 35 public class CustomProjection extends AbstractProjection { … … 45 46 protected Bounds bounds; 46 47 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 */ 49 55 x_0("x_0", true), 56 /** False northing */ 50 57 y_0("y_0", true), 58 /** Central meridian */ 51 59 lon_0("lon_0", true), 60 /** Scaling factor */ 52 61 k_0("k_0", true), 62 /** Ellipsoid name (see {@code proj -le}) */ 53 63 ellps("ellps", true), 64 /** Semimajor radius of the ellipsoid axis */ 54 65 a("a", true), 66 /** Eccentricity of the ellipsoid squared */ 55 67 es("es", true), 68 /** Reciprocal of the ellipsoid flattening term (e.g. 298) */ 56 69 rf("rf", true), 70 /** Flattening of the ellipsoid = 1-sqrt(1-e^2) */ 57 71 f("f", true), 72 /** Semiminor radius of the ellipsoid axis */ 58 73 b("b", true), 74 /** Datum name (see {@code proj -ld}) */ 59 75 datum("datum", true), 76 /** 3 or 7 term datum transform parameters */ 60 77 towgs84("towgs84", true), 78 /** Filename of NTv2 grid file to use for datum transforms */ 61 79 nadgrids("nadgrids", true), 80 /** Projection name (see {@code proj -l}) */ 62 81 proj("proj", true), 82 /** Latitude of origin */ 63 83 lat_0("lat_0", true), 84 /** Latitude of first standard parallel */ 64 85 lat_1("lat_1", true), 86 /** Latitude of second standard parallel */ 65 87 lat_2("lat_2", true), 88 /** the exact proj.4 string will be preserved in the WKT representation */ 66 89 wktext("wktext", false), // ignored 90 /** meters, US survey feet, etc. */ 67 91 units("units", true), // ignored 92 /** Don't use the /usr/share/proj/proj_def.dat defaults file */ 68 93 no_defs("no_defs", false), 69 94 init("init", true), … … 88 113 } 89 114 115 /** 116 * Constructs a new empty {@code CustomProjection}. 117 */ 90 118 public CustomProjection() { 91 119 } 92 120 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 */ 93 125 public CustomProjection(String pref) { 94 126 this(null, null, pref, null); … … 96 128 97 129 /** 98 * Construct or.130 * Constructs a new {@code CustomProjection} with given name, code and parameters. 99 131 * 100 132 * @param name describe projection in one or two words … … 119 151 } 120 152 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 */ 121 158 public final void update(String pref) throws ProjectionConfigurationException { 122 159 this.pref = pref;
Note:
See TracChangeset
for help on using the changeset viewer.