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


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005:         *    (C) 2004, 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.cs;
021:
022:        // J2SE dependencies
023:        import java.util.Map;
024:
025:        // OpenGIS dependencies
026:        import org.opengis.referencing.cs.VerticalCS;
027:        import org.opengis.referencing.cs.AxisDirection;
028:        import org.opengis.referencing.cs.CoordinateSystemAxis;
029:        import org.opengis.geometry.MismatchedDimensionException;
030:
031:        // Geotools dependencies
032:        import org.geotools.measure.Measure;
033:        import org.geotools.resources.i18n.VocabularyKeys;
034:
035:        /**
036:         * A one-dimensional coordinate system used to record the heights (or depths) of points. Such a
037:         * coordinate system is usually dependent on the Earth's gravity field, perhaps loosely as when
038:         * atmospheric pressure is the basis for the vertical coordinate system axis. An exact definition
039:         * is deliberately not provided as the complexities of the subject fall outside the scope of this
040:         * specification. A {@code VerticalCS} shall have one {@linkplain #getAxis axis}.
041:         *
042:         * <TABLE CELLPADDING='6' BORDER='1'>
043:         * <TR BGCOLOR="#EEEEFF"><TH NOWRAP>Used with CRS type(s)</TH></TR>
044:         * <TR><TD>
045:         *   {@link org.geotools.referencing.crs.DefaultVerticalCRS    Vertical},
046:         *   {@link org.geotools.referencing.crs.DefaultEngineeringCRS Engineering}
047:         * </TD></TR></TABLE>
048:         *
049:         * @since 2.1
050:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/cs/DefaultVerticalCS.java $
051:         * @version $Id: DefaultVerticalCS.java 24925 2007-03-27 20:12:08Z jgarnett $
052:         * @author Martin Desruisseaux
053:         */
054:        public class DefaultVerticalCS extends AbstractCS implements  VerticalCS {
055:            /**
056:             * Serial number for interoperability with different versions.
057:             */
058:            private static final long serialVersionUID = 1201155778896630499L;;
059:
060:            /**
061:             * A one-dimensional vertical CS with
062:             * <var>{@linkplain DefaultCoordinateSystemAxis#ELLIPSOIDAL_HEIGHT
063:             * ellipsoidal height}</var> axis in metres.
064:             */
065:            public static DefaultVerticalCS ELLIPSOIDAL_HEIGHT = new DefaultVerticalCS(
066:                    name(VocabularyKeys.ELLIPSOIDAL_HEIGHT),
067:                    DefaultCoordinateSystemAxis.ELLIPSOIDAL_HEIGHT);
068:
069:            /**
070:             * A one-dimensional vertical CS with
071:             * <var>{@linkplain DefaultCoordinateSystemAxis#GRAVITY_RELATED_HEIGHT
072:             * gravity-related height}</var> axis in metres.
073:             */
074:            public static DefaultVerticalCS GRAVITY_RELATED = new DefaultVerticalCS(
075:                    name(VocabularyKeys.GRAVITY_RELATED_HEIGHT),
076:                    DefaultCoordinateSystemAxis.GRAVITY_RELATED_HEIGHT);
077:
078:            /**
079:             * A one-dimensional vertical CS with
080:             * <var>{@linkplain DefaultCoordinateSystemAxis#DEPTH depth}</var>
081:             * axis in metres.
082:             */
083:            public static DefaultVerticalCS DEPTH = new DefaultVerticalCS(
084:                    name(VocabularyKeys.DEPTH),
085:                    DefaultCoordinateSystemAxis.DEPTH);
086:
087:            /**
088:             * Constructs a new coordinate system with the same values than the specified one.
089:             * This copy constructor provides a way to wrap an arbitrary implementation into a
090:             * Geotools one or a user-defined one (as a subclass), usually in order to leverage
091:             * some implementation-specific API. This constructor performs a shallow copy,
092:             * i.e. the properties are not cloned.
093:             *
094:             * @since 2.2
095:             */
096:            public DefaultVerticalCS(final VerticalCS cs) {
097:                super (cs);
098:            }
099:
100:            /**
101:             * Constructs a coordinate system from a name.
102:             *
103:             * @param name  The coordinate system name.
104:             * @param axis  The axis.
105:             */
106:            public DefaultVerticalCS(final String name,
107:                    final CoordinateSystemAxis axis) {
108:                super (name, new CoordinateSystemAxis[] { axis });
109:            }
110:
111:            /**
112:             * Constructs a coordinate system from a set of properties. The properties map is given unchanged
113:             * to the {@linkplain AbstractCS#AbstractCS(Map,CoordinateSystemAxis[]) super-class constructor}.
114:             *
115:             * @param properties   Set of properties. Should contains at least <code>"name"</code>.
116:             * @param axis         The axis.
117:             */
118:            public DefaultVerticalCS(final Map properties,
119:                    final CoordinateSystemAxis axis) {
120:                super (properties, new CoordinateSystemAxis[] { axis });
121:            }
122:
123:            /**
124:             * Returns {@code true} if the specified axis direction is allowed for this coordinate
125:             * system. The default implementation accepts only vertical directions (i.e.
126:             * {@link AxisDirection#UP UP} and {@link AxisDirection#DOWN DOWN}).
127:             */
128:            protected boolean isCompatibleDirection(
129:                    final AxisDirection direction) {
130:                return AxisDirection.UP.equals(direction.absolute());
131:            }
132:
133:            /**
134:             * Computes the distance between two points.
135:             *
136:             * @param  coord1 Coordinates of the first point.
137:             * @param  coord2 Coordinates of the second point.
138:             * @return The distance between {@code coord1} and {@code coord2}.
139:             * @throws MismatchedDimensionException if a coordinate doesn't have the expected dimension.
140:             */
141:            public Measure distance(final double[] coord1, final double[] coord2)
142:                    throws MismatchedDimensionException {
143:                ensureDimensionMatch("coord1", coord1);
144:                ensureDimensionMatch("coord2", coord2);
145:                return new Measure(Math.abs(coord1[0] - coord2[0]),
146:                        getDistanceUnit());
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.