001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.referencing.factory.wms;
017:
018: // OpenGIS dependencies
019: import org.opengis.parameter.ParameterValueGroup;
020:
021: /**
022: * Auto Transverse Mercator ({@code AUTO:42002}).
023: * In the notation below, "<code>${var}</code>" denotes a reference to the value of a variable
024: * "{@code var}". The variables "{@code lat0}" and "{@code lon0}" are the central point of the
025: * projection appearing in the CRS parameter of the map request. The coordinate operation method
026: * uses ellipsoidal formulas.
027: *
028: * <pre>
029: * PROJCS["WGS 84 / Auto Tr. Mercator",
030: * GEOGCS["WGS 84",
031: * DATUM["WGS_1984",
032: * SPHEROID["WGS_1984", 6378137, 298.257223563]],
033: * PRIMEM["Greenwich", 0],
034: * UNIT["Decimal_Degree", 0.0174532925199433]],
035: * PROJECTION["Transverse_Mercator"],
036: * PARAMETER["Latitude_of_Origin", 0],
037: * PARAMETER["Central_Meridian", ${central_meridian}],
038: * PARAMETER["False_Easting", 500000],
039: * PARAMETER["False_Northing", ${false_northing}],
040: * PARAMETER["Scale_Factor", 0.9996],
041: * UNIT["Meter", 1]]
042: * </pre>
043: *
044: * Where:
045: *
046: * <pre>
047: * ${central_meridian} = ${lon0}
048: * ${false_northing} = (${lat0} >= 0.0) ? 0.0 : 10000000.0
049: * </pre>
050: *
051: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/factory/wms/Auto42002.java $
052: * @version $Id: Auto42002.java 20874 2006-08-07 10:00:01Z jgarnett $
053: * @author Jody Garnett
054: * @author Rueben Schulz
055: * @author Martin Desruisseaux
056: */
057: final class Auto42002 extends Factlet {
058: /**
059: * A shared (thread-safe) instance.
060: */
061: public static final Auto42002 DEFAULT = new Auto42002();
062:
063: /**
064: * Do not allows instantiation except the {@link #DEFAULT} constant.
065: */
066: private Auto42002() {
067: }
068:
069: /**
070: * {@inheritDoc}
071: */
072: public int code() {
073: return 42002;
074: }
075:
076: /**
077: * {@inheritDoc}
078: */
079: public String getName() {
080: return "WGS 84 / Auto Tr. Mercator";
081: }
082:
083: /**
084: * {@inheritDoc}
085: */
086: public String getClassification() {
087: return "Transverse_Mercator";
088: }
089:
090: /**
091: * {@inheritDoc}
092: */
093: protected void setProjectionParameters(
094: final ParameterValueGroup parameters, final Code code) {
095: final double centralMeridian = code.longitude;
096: final double falseNorthing = code.latitude >= 0.0 ? 0.0
097: : 10000000.0;
098:
099: parameters.parameter("latitude_of_origin").setValue(0.0);
100: parameters.parameter("central_meridian").setValue(
101: centralMeridian);
102: parameters.parameter("false_easting").setValue(500000.0);
103: parameters.parameter("false_northing").setValue(falseNorthing);
104: parameters.parameter("scale_factor").setValue(0.9996);
105: }
106: }
|