Source Code Cross Referenced for AzimuthalProjection.java in  » GIS » deegree » org » deegree » crs » projections » azimuthal » 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 » deegree » org.deegree.crs.projections.azimuthal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$HeadURL: $
002:        /*----------------    FILE HEADER  ------------------------------------------
003:         This file is part of deegree.
004:         Copyright (C) 2001-2008 by:
005:         Department of Geography, University of Bonn
006:         http://www.giub.uni-bonn.de/deegree/
007:         lat/lon GmbH
008:         http://www.lat-lon.de
009:
010:         This library is free software; you can redistribute it and/or
011:         modify it under the terms of the GNU Lesser General Public
012:         License as published by the Free Software Foundation; either
013:         version 2.1 of the License, or (at your option) any later version.
014:         This library is distributed in the hope that it will be useful,
015:         but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017:         Lesser General Public License for more details.
018:         You should have received a copy of the GNU Lesser General Public
019:         License along with this library; if not, write to the Free Software
020:         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
021:         Contact:
022:
023:         Andreas Poth
024:         lat/lon GmbH
025:         Aennchenstr. 19
026:         53177 Bonn
027:         Germany
028:         E-Mail: poth@lat-lon.de
029:
030:         Prof. Dr. Klaus Greve
031:         Department of Geography
032:         University of Bonn
033:         Meckenheimer Allee 166
034:         53115 Bonn
035:         Germany
036:         E-Mail: greve@giub.uni-bonn.de
037:         ---------------------------------------------------------------------------*/
038:
039:        package org.deegree.crs.projections.azimuthal;
040:
041:        import javax.vecmath.Point2d;
042:
043:        import org.deegree.crs.Identifiable;
044:        import org.deegree.crs.components.Unit;
045:        import org.deegree.crs.coordinatesystems.GeographicCRS;
046:        import org.deegree.crs.projections.ProjectionUtils;
047:        import org.deegree.crs.projections.Projection;
048:
049:        /**
050:         * The <code>AzimuthalProjection</code> class functions as a super class to all azimuthal projections.
051:         * <p>
052:         * (From wikipedia) Azimuthal projections have the property that directions from a central point are preserved (and
053:         * hence, great circles through the central point are represented by straight lines on the map). Usually these
054:         * projections also have radial symmetry in the scales and hence in the distortions: map distances from the central
055:         * point are computed by a function r(d) of the true distance d, independent of the angle; correspondingly, circles with
056:         * the central point as center are mapped into circles which have as center the central point on the map.
057:         * </p>
058:         * 
059:         * <p>
060:         * The mapping of radial lines can be visualized by imagining a plane tangent to the Earth, with the central point as
061:         * tangent point.
062:         * </p>
063:         * 
064:         * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
065:         * 
066:         * @author last edited by: $Author:$
067:         * 
068:         * @version $Revision:$, $Date:$
069:         * 
070:         */
071:
072:        public abstract class AzimuthalProjection extends Projection {
073:
074:            /**
075:             * Defining that the center of this azimuthal projection is at the north pole
076:             */
077:            public final static int NORTH_POLE = 0;
078:
079:            /**
080:             * Defining that the center of this azimuthal projection is at the south pole
081:             */
082:            public final static int SOUTH_POLE = 1;
083:
084:            /**
085:             * Defining that the center of this azimuthal projection is at the equator
086:             */
087:            public final static int EQUATOR = 2;
088:
089:            /**
090:             * Defining that the center of this azimuthal projection is oblique
091:             */
092:            public final static int OBLIQUE = 3;
093:
094:            private int mode;
095:
096:            /**
097:             * @param geographicCRS
098:             * @param falseNorthing
099:             * @param falseEasting
100:             * @param naturalOrigin
101:             * @param units
102:             * @param scale
103:             * @param conformal
104:             * @param equalArea 
105:             * @param id to get the identifiable values from may not be <code>null</code>
106:             */
107:            public AzimuthalProjection(GeographicCRS geographicCRS,
108:                    double falseNorthing, double falseEasting,
109:                    Point2d naturalOrigin, Unit units, double scale,
110:                    boolean conformal, boolean equalArea, Identifiable id) {
111:                this (geographicCRS, falseNorthing, falseEasting, naturalOrigin,
112:                        units, scale, conformal, equalArea,
113:                        id.getIdentifiers(), id.getNames(), id.getVersions(),
114:                        id.getDescriptions(), id.getAreasOfUse());
115:            }
116:
117:            /**
118:             * @param geographicCRS
119:             * @param falseNorthing
120:             * @param falseEasting
121:             * @param naturalOrigin
122:             * @param units
123:             * @param scale
124:             * @param conformal
125:             * @param equalArea 
126:             * @param identifiers
127:             * @param names
128:             * @param versions
129:             * @param descriptions
130:             * @param areasOfUse
131:             */
132:            public AzimuthalProjection(GeographicCRS geographicCRS,
133:                    double falseNorthing, double falseEasting,
134:                    Point2d naturalOrigin, Unit units, double scale,
135:                    boolean conformal, boolean equalArea, String[] identifiers,
136:                    String[] names, String[] versions, String[] descriptions,
137:                    String[] areasOfUse) {
138:                super (geographicCRS, falseNorthing, falseEasting,
139:                        naturalOrigin, units, scale, conformal, equalArea,
140:                        identifiers, names, versions, descriptions, areasOfUse);
141:                if (Math.abs(Math.abs(getProjectionLatitude())
142:                        - ProjectionUtils.HALFPI) < ProjectionUtils.EPS10) {
143:                    mode = getProjectionLatitude() < 0. ? SOUTH_POLE
144:                            : NORTH_POLE;
145:                } else if (Math.abs(getProjectionLatitude()) > ProjectionUtils.EPS10) {
146:                    mode = OBLIQUE;
147:                } else {
148:                    mode = EQUATOR;
149:                }
150:            }
151:
152:            /**
153:             * @return the mode.
154:             */
155:            public final int getMode() {
156:                return mode;
157:            }
158:
159:            /**
160:             * Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even
161:             * distribution and is relatively fast. It is created from field <b>f</b> as follows:
162:             * <ul>
163:             * <li>boolean -- code = (f ? 0 : 1)</li>
164:             * <li>byte, char, short, int -- code = (int)f </li>
165:             * <li>long -- code = (int)(f ^ (f &gt;&gt;&gt;32))</li>
166:             * <li>float -- code = Float.floatToIntBits(f);</li>
167:             * <li>double -- long l = Double.doubleToLongBits(f); code = (int)(l ^ (l &gt;&gt;&gt; 32))</li>
168:             * <li>all Objects, (where equals(&nbsp;) calls equals(&nbsp;) for this field) -- code = f.hashCode(&nbsp;)</li>
169:             * <li>Array -- Apply above rules to each element</li>
170:             * </ul>
171:             * <p>
172:             * Combining the hash code(s) computed above: result = 37 * result + code;
173:             * </p>
174:             * 
175:             * @return (int) ( result >>> 32 ) ^ (int) result;
176:             * 
177:             * @see java.lang.Object#hashCode()
178:             */
179:            @Override
180:            public int hashCode() {
181:                // the 2nd millionth prime, :-)
182:                long code = 32452843;
183:                code = code * 37 + super .hashCode();
184:                code = code * 37 + getMode();
185:                return (int) (code >>> 32) ^ (int) code;
186:            }
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.