Source Code Cross Referenced for AbstractSingleCRS.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » crs » 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.crs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2003-2006, GeoTools Project Managment Committee (PMC)
005:         *    (C) 2001, Institut de Recherche pour le Développement
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;
010:         *    version 2.1 of the License.
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:         *    This package contains documentation from OpenGIS specifications.
018:         *    OpenGIS consortium's work is fully acknowledged here.
019:         */
020:        package org.geotools.referencing.crs;
021:
022:        // J2SE dependencies
023:        import java.util.Map;
024:
025:        // OpenGIS dependencies
026:        import org.opengis.referencing.cs.CoordinateSystem;
027:        import org.opengis.referencing.cs.CoordinateSystemAxis;
028:        import org.opengis.referencing.crs.SingleCRS;
029:        import org.opengis.referencing.datum.Datum;
030:
031:        // Geotools dependencies
032:        import org.geotools.referencing.AbstractIdentifiedObject;
033:        import org.geotools.referencing.AbstractReferenceSystem;
034:        import org.geotools.referencing.wkt.Formatter;
035:
036:        /**
037:         * Abstract coordinate reference system, consisting of a single
038:         * {@linkplain CoordinateSystem coordinate system} and a single
039:         * {@linkplain Datum datum} (as opposed to {@linkplain DefaultCompoundCRS compound CRS}).
040:         * <p>
041:         * A coordinate reference system consists of an ordered sequence of coordinate system
042:         * axes that are related to the earth through a datum. A coordinate reference system
043:         * is defined by one datum and by one coordinate system. Most coordinate reference system
044:         * do not move relative to the earth, except for engineering coordinate reference systems
045:         * defined on moving platforms such as cars, ships, aircraft, and spacecraft.
046:         * <p>
047:         * Coordinate reference systems are commonly divided into sub-types. The common classification
048:         * criterion for sub-typing of coordinate reference systems is the way in which they deal with
049:         * earth curvature. This has a direct effect on the portion of the earth's surface that can be
050:         * covered by that type of CRS with an acceptable degree of error. The exception to the rule is
051:         * the subtype "Temporal" which has been added by analogy.
052:         * <p>
053:         * This class is conceptually <cite>abstract</cite>, even if it is technically possible to
054:         * instantiate it. Typical applications should create instances of the most specific subclass with
055:         * {@code Default} prefix instead. An exception to this rule may occurs when it is not possible to
056:         * identify the exact type.
057:         *
058:         * @since 2.1
059:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/crs/AbstractSingleCRS.java $
060:         * @version $Id: AbstractSingleCRS.java 24609 2007-02-26 23:35:53Z desruisseaux $
061:         * @author Martin Desruisseaux
062:         *
063:         * @see org.geotools.referencing.cs.AbstractCS
064:         * @see org.geotools.referencing.datum.AbstractDatum
065:         */
066:        public class AbstractSingleCRS extends AbstractCRS implements  SingleCRS {
067:            /**
068:             * Serial number for interoperability with different versions.
069:             */
070:            private static final long serialVersionUID = 1815712797774273L;
071:
072:            /**
073:             * The datum.
074:             */
075:            protected final Datum datum;
076:
077:            /**
078:             * Constructs a new coordinate reference system with the same values than the specified one.
079:             * This copy constructor provides a way to wrap an arbitrary implementation into a
080:             * Geotools one or a user-defined one (as a subclass), usually in order to leverage
081:             * some implementation-specific API. This constructor performs a shallow copy,
082:             * i.e. the properties are not cloned.
083:             *
084:             * @since 2.2
085:             */
086:            public AbstractSingleCRS(final SingleCRS crs) {
087:                super (crs);
088:                datum = crs.getDatum();
089:            }
090:
091:            /**
092:             * Constructs a coordinate reference system from a set of properties. The properties are given
093:             * unchanged to the {@linkplain AbstractReferenceSystem#AbstractReferenceSystem(Map) super-class
094:             * constructor}.
095:             *
096:             * @param properties Set of properties. Should contains at least <code>"name"</code>.
097:             * @param datum The datum.
098:             * @param cs The coordinate system.
099:             */
100:            public AbstractSingleCRS(final Map properties, final Datum datum,
101:                    final CoordinateSystem cs) {
102:                super (properties, cs);
103:                this .datum = datum;
104:                ensureNonNull("datum", datum);
105:            }
106:
107:            /**
108:             * Returns the datum.
109:             *
110:             * @return The datum.
111:             */
112:            public Datum getDatum() {
113:                return datum;
114:            }
115:
116:            /**
117:             * Returns the dimension of the underlying {@linkplain CoordinateSystem coordinate system}.
118:             * This is equivalent to <code>{@linkplain #coordinateSystem}.{@linkplain
119:             * CoordinateSystem#getDimension getDimension}()</code>.
120:             *
121:             * @return The dimension of this coordinate reference system.
122:             */
123:            public int getDimension() {
124:                return coordinateSystem.getDimension();
125:            }
126:
127:            /**
128:             * Returns the axis for the underlying {@linkplain CoordinateSystem coordinate system} at
129:             * the specified dimension. This is equivalent to
130:             * <code>{@linkplain #coordinateSystem}.{@linkplain CoordinateSystem#getAxis getAxis}(dimension)</code>.
131:             *
132:             * @param  dimension The zero based index of axis.
133:             * @return The axis at the specified dimension.
134:             * @throws IndexOutOfBoundsException if {@code dimension} is out of bounds.
135:             */
136:            public CoordinateSystemAxis getAxis(int dimension)
137:                    throws IndexOutOfBoundsException {
138:                return coordinateSystem.getAxis(dimension);
139:            }
140:
141:            /**
142:             * Compare this coordinate reference system with the specified object for equality.
143:             * If {@code compareMetadata} is {@code true}, then all available properties are
144:             * compared including {@linkplain #getValidArea valid area} and {@linkplain #getScope scope}.
145:             *
146:             * @param  object The object to compare to {@code this}.
147:             * @param  compareMetadata {@code true} for performing a strict comparaison, or
148:             *         {@code false} for comparing only properties relevant to transformations.
149:             * @return {@code true} if both objects are equal.
150:             */
151:            public boolean equals(final AbstractIdentifiedObject object,
152:                    final boolean compareMetadata) {
153:                if (super .equals(object, compareMetadata)) {
154:                    final AbstractSingleCRS that = (AbstractSingleCRS) object;
155:                    return equals(this .datum, that.datum, compareMetadata);
156:                }
157:                return false;
158:            }
159:
160:            /**
161:             * Returns a hash value for this CRS. {@linkplain #getName Name},
162:             * {@linkplain #getIdentifiers identifiers} and {@linkplain #getRemarks remarks}
163:             * are not taken in account. In other words, two CRS objects will return the same
164:             * hash value if they are equal in the sense of
165:             * <code>{@link #equals(AbstractIdentifiedObject,boolean) equals}(AbstractIdentifiedObject,
166:             * <strong>false</strong>)</code>.
167:             *
168:             * @return The hash code value. This value doesn't need to be the same
169:             *         in past or future versions of this class.
170:             */
171:            public int hashCode() {
172:                return super .hashCode() ^ datum.hashCode();
173:            }
174:
175:            /**
176:             * {@inheritDoc}
177:             */
178:            //@Override
179:            final void formatDefaultWKT(final Formatter formatter) {
180:                formatter.append(datum);
181:                super.formatDefaultWKT(formatter);
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.