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 Orthographic ({@code AUTO:42003}).
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.
026: *
027: * <pre>
028: * PROJCS["WGS 84 / Auto Orthographic",
029: * GEOGCS["WGS 84",
030: * DATUM["WGS_1984",
031: * SPHEROID["WGS_1984", 6378137, 298.257223563]],
032: * PRIMEM["Greenwich", 0],
033: * UNIT["Decimal_Degree", 0.0174532925199433]],
034: * PROJECTION["Orthographic"],
035: * PARAMETER["Latitude_of_Origin", ${latitude_of_origin}],
036: * PARAMETER["Central_Meridian", ${central_meridian}],
037: * UNIT["Meter", 1]]
038: * </pre>
039: *
040: * Where:
041: *
042: * <pre>
043: * ${latitude_of_origin} = ${lat0}
044: * ${central_meridian} = ${lon0}
045: * </pre>
046: *
047: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/factory/wms/Auto42003.java $
048: * @version $Id: Auto42003.java 20874 2006-08-07 10:00:01Z jgarnett $
049: * @author Jody Garnett
050: * @author Rueben Schulz
051: * @author Martin Desruisseaux
052: *
053: * @todo The coordinate operation method should uses ellipsoidal formulas,
054: * but this is not yet implemented in Geotools (as of version 2.2).
055: */
056: final class Auto42003 extends Factlet {
057: /**
058: * A shared (thread-safe) instance.
059: */
060: public static final Auto42003 DEFAULT = new Auto42003();
061:
062: /**
063: * Do not allows instantiation except the {@link #DEFAULT} constant.
064: */
065: private Auto42003() {
066: }
067:
068: /**
069: * {@inheritDoc}
070: */
071: public int code() {
072: return 42003;
073: }
074:
075: /**
076: * {@inheritDoc}
077: */
078: public String getName() {
079: return "WGS 84 / Auto Orthographic";
080: }
081:
082: /**
083: * {@inheritDoc}
084: */
085: public String getClassification() {
086: return "Orthographic";
087: }
088:
089: /**
090: * {@inheritDoc}
091: */
092: protected void setProjectionParameters(
093: final ParameterValueGroup parameters, final Code code) {
094: final double latitudeOfOrigin = code.latitude;
095: final double centralMeridian = code.longitude;
096:
097: parameters.parameter("latitude_of_origin").setValue(
098: latitudeOfOrigin);
099: parameters.parameter("central_meridian").setValue(
100: centralMeridian);
101: }
102: }
|