Source Code Cross Referenced for PlateCarree.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » operation » projection » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing.operation.projection 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *
005:         *   (C) 2005-2006, Geotools Project Managment Committee (PMC)
006:         *
007:         *    This library is free software; you can redistribute it and/or
008:         *    modify it under the terms of the GNU Lesser General Public
009:         *    License as published by the Free Software Foundation; either
010:         *    version 2.1 of the License, or (at your option) any later version.
011:         *
012:         *    This library is distributed in the hope that it will be useful,
013:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         *    Lesser General Public License for more details.
016:         */
017:        package org.geotools.referencing.operation.projection;
018:
019:        // J2SE dependencies and extensions
020:        import java.awt.geom.Point2D;
021:
022:        // OpenGIS dependencies
023:        import org.opengis.parameter.ParameterDescriptor;
024:        import org.opengis.parameter.ParameterDescriptorGroup;
025:        import org.opengis.parameter.ParameterNotFoundException;
026:        import org.opengis.parameter.ParameterValueGroup;
027:        import org.opengis.referencing.operation.CylindricalProjection;
028:        import org.opengis.referencing.operation.MathTransform;
029:        import org.opengis.referencing.FactoryException;
030:
031:        // Geotools dependencies
032:        import org.geotools.metadata.iso.citation.Citations;
033:        import org.geotools.referencing.NamedIdentifier;
034:        import org.geotools.resources.i18n.ErrorKeys;
035:        import org.geotools.resources.i18n.Errors;
036:
037:        /**
038:         * Plate Carree (or Equirectangular) projection. This is a particular case of
039:         * {@linkplain EquidistantCylindrical Equidistant Cylindrical} projection where the
040:         * {@code standard_parallel_1} is 0°.
041:         *
042:         * @see <A HREF="http://www.remotesensing.org/geotiff/proj_list/equirectangular.html">"Equirectangular" on RemoteSensing.org</A>
043:         *
044:         * @since 2.2
045:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/PlateCarree.java $
046:         * @version $Id: PlateCarree.java 26540 2007-08-14 12:20:36Z desruisseaux $
047:         * @author John Grange
048:         * @author Martin Desruisseaux
049:         */
050:        public class PlateCarree extends EquidistantCylindrical {
051:            /**
052:             * Constructs a new map projection from the supplied parameters.
053:             *
054:             * @param  parameters The parameter values in standard units.
055:             * @throws ParameterNotFoundException if a mandatory parameter is missing.
056:             */
057:            protected PlateCarree(final ParameterValueGroup parameters)
058:                    throws ParameterNotFoundException {
059:                super (parameters);
060:            }
061:
062:            /**
063:             * {@inheritDoc}
064:             */
065:            public ParameterDescriptorGroup getParameterDescriptors() {
066:                return Provider.PARAMETERS;
067:            }
068:
069:            /**
070:             * Transforms the specified (<var>&lambda;</var>,<var>&phi;</var>) coordinates
071:             * (units in radians) and stores the result in {@code ptDst} (linear distance
072:             * on a unit sphere).
073:             */
074:            protected Point2D transformNormalized(double x, double y,
075:                    final Point2D ptDst) throws ProjectionException {
076:                if (ptDst != null) {
077:                    ptDst.setLocation(x, y);
078:                    return ptDst;
079:                }
080:                return new Point2D.Double(x, y);
081:            }
082:
083:            /**
084:             * Transforms the specified (<var>x</var>,<var>y</var>) coordinates
085:             * and stores the result in {@code ptDst}.
086:             */
087:            protected Point2D inverseTransformNormalized(double x, double y,
088:                    final Point2D ptDst) throws ProjectionException {
089:                if (ptDst != null) {
090:                    ptDst.setLocation(x, y);
091:                    return ptDst;
092:                }
093:                return new Point2D.Double(x, y);
094:            }
095:
096:            //////////////////////////////////////////////////////////////////////////////////////////
097:            //////////////////////////////////////////////////////////////////////////////////////////
098:            ////////                                                                          ////////
099:            ////////                                 PROVIDERS                                ////////
100:            ////////                                                                          ////////
101:            //////////////////////////////////////////////////////////////////////////////////////////
102:            //////////////////////////////////////////////////////////////////////////////////////////
103:
104:            /**
105:             * The {@linkplain org.geotools.referencing.operation.MathTransformProvider math transform
106:             * provider} for an {@linkplain org.geotools.referencing.operation.projection.PlateCarree
107:             * Plate Carree} projection.
108:             *
109:             * @since 2.2
110:             * @version $Id: PlateCarree.java 26540 2007-08-14 12:20:36Z desruisseaux $
111:             * @author John Grange
112:             *
113:             * @see org.geotools.referencing.operation.DefaultMathTransformFactory
114:             */
115:            public static class Provider extends AbstractProvider {
116:                /**
117:                 * The parameters group.
118:                 */
119:                static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(
120:                        new NamedIdentifier[] {
121:                                new NamedIdentifier(Citations.ESRI,
122:                                        "Plate_Carree"),
123:                                new NamedIdentifier(Citations.OGC,
124:                                        "Equirectangular"),
125:                                new NamedIdentifier(Citations.GEOTIFF,
126:                                        "CT_Equirectangular") },
127:                        new ParameterDescriptor[] { SEMI_MAJOR, SEMI_MINOR,
128:                                CENTRAL_MERIDIAN, FALSE_EASTING, FALSE_NORTHING });
129:
130:                /**
131:                 * Constructs a new provider. 
132:                 */
133:                public Provider() {
134:                    super (PARAMETERS);
135:                }
136:
137:                /**
138:                 * Returns the operation type for this map projection.
139:                 */
140:                public Class getOperationType() {
141:                    return CylindricalProjection.class;
142:                }
143:
144:                /**
145:                 * Creates a transform from the specified group of parameter values.
146:                 *
147:                 * @param  parameters The group of parameter values.
148:                 * @return The created math transform.
149:                 * @throws ParameterNotFoundException if a required parameter was not found.
150:                 */
151:                protected MathTransform createMathTransform(
152:                        final ParameterValueGroup parameters)
153:                        throws ParameterNotFoundException, FactoryException {
154:                    if (isSpherical(parameters)) {
155:                        return new PlateCarree(parameters);
156:                    } else {
157:                        throw new FactoryException(Errors
158:                                .format(ErrorKeys.ELLIPTICAL_NOT_SUPPORTED));
159:                    }
160:                }
161:            }
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.