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


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2007, GeoTools Project Managment Committee (PMC)
005:         *    (C) 2007, Geomatys
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:        package org.geotools.image.io.metadata;
018:
019:        // OpenGIS dependencies
020:        import org.opengis.referencing.datum.Datum; // For javadoc
021:        import org.opengis.referencing.datum.TemporalDatum; // For javadoc
022:        import org.opengis.referencing.cs.AxisDirection; // For javadoc
023:        import org.opengis.referencing.cs.CoordinateSystem; // For javadoc
024:        import org.opengis.referencing.cs.CoordinateSystemAxis; // For javadoc
025:        import org.opengis.referencing.crs.CoordinateReferenceSystem; // For javadoc
026:
027:        /**
028:         * A {@code <CoordinateReferenceSystem>} element in
029:         * {@linkplain GeographicMetadataFormat geographic metadata format}, together with its
030:         * {@code <CoordinateSystem>} and {@code <Datum>} child elements.
031:         *
032:         * @since 2.4
033:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/coverageio/src/main/java/org/geotools/image/io/metadata/ImageReferencing.java $
034:         * @version $Id: ImageReferencing.java 27544 2007-10-18 19:16:40Z desruisseaux $
035:         * @author Martin Desruisseaux
036:         */
037:        public class ImageReferencing extends MetadataAccessor {
038:            /**
039:             * The {@code "CoordinateReferenceSystem/Datum"} node.
040:             */
041:            private final MetadataAccessor datum;
042:
043:            /**
044:             * The {@code "CoordinateReferenceSystem/CoordinateSystem"} node.
045:             */
046:            final ChildList/*<Axis>*/cs;
047:
048:            /**
049:             * Creates a parser for a coordinate system. This constructor should not be invoked
050:             * directly; use {@link GeographicMetadata#getReferencing} instead.
051:             *
052:             * @param metadata The metadata node.
053:             */
054:            protected ImageReferencing(final GeographicMetadata metadata) {
055:                super (metadata, "CoordinateReferenceSystem", null);
056:                datum = new MetadataAccessor(metadata,
057:                        "CoordinateReferenceSystem/Datum", null);
058:                cs = new ChildList.Axes(metadata);
059:            }
060:
061:            /**
062:             * Returns the {@linkplain Identification#name name} and {@linkplain Identification#type type}
063:             * of the {@linkplain CoordinateReferenceSystem coordinate reference system}.
064:             *
065:             * @see CoordinateReferenceSystem
066:             */
067:            public Identification getCoordinateReferenceSystem() {
068:                return new Identification(this );
069:            }
070:
071:            /**
072:             * Sets the {@linkplain Identification#name name} and {@linkplain Identification#type type}
073:             * of the {@linkplain CoordinateReferenceSystem coordinate reference system}.
074:             *
075:             * @param name The coordinate reference system name, or {@code null} if unknown.
076:             * @param type The coordinate reference system type (usually
077:             *             {@value GeographicMetadataFormat#GEOGRAPHIC} or
078:             *             {@value GeographicMetadataFormat#PROJECTED}), or {@code null} if unknown.
079:             *
080:             * @see CoordinateReferenceSystem
081:             */
082:            public void setCoordinateReferenceSystem(final String name,
083:                    final String type) {
084:                setString("name", name);
085:                setEnum("type", type, GeographicMetadataFormat.CRS_TYPES);
086:            }
087:
088:            /**
089:             * Returns the {@linkplain Identification#name name} and {@linkplain Identification#type type}
090:             * of the {@linkplain CoordinateSystem coordinate system}.
091:             *
092:             * @see CoordinateSystem
093:             */
094:            public Identification getCoordinateSystem() {
095:                return new Identification(cs);
096:            }
097:
098:            /**
099:             * Sets the {@linkplain Identification#name name} and {@linkplain Identification#type type}
100:             * of the {@linkplain CoordinateSystem coordinate system}.
101:             *
102:             * @param name The coordinate system name, or {@code null} if unknown.
103:             * @param type The coordinate system type (usually
104:             *             {@value GeographicMetadataFormat#ELLIPSOIDAL} or
105:             *             {@value GeographicMetadataFormat#CARTESIAN}), or {@code null} if unknown.
106:             *
107:             * @see CoordinateSystem
108:             */
109:            public void setCoordinateSystem(final String name, final String type) {
110:                cs.setString("name", name);
111:                cs.setEnum("type", type, GeographicMetadataFormat.CS_TYPES);
112:            }
113:
114:            /**
115:             * Returns the {@linkplain Identification#name name} and {@linkplain Identification#type type}
116:             * of the {@linkplain Datum datum}.
117:             *
118:             * @see Datum
119:             */
120:            public Identification getDatum() {
121:                return new Identification(datum);
122:            }
123:
124:            /**
125:             * Sets the {@linkplain Identification#name name} and {@linkplain Identification#type type}
126:             * of the {@linkplain Datum datum}.
127:             *
128:             * @param name The datum name, or {@code null} if unknown.
129:             *
130:             * @see Datum
131:             */
132:            public void setDatum(final String name) {
133:                datum.setString("name", name);
134:            }
135:
136:            /**
137:             * Returns the number of dimensions.
138:             */
139:            public int getDimension() {
140:                return cs.childCount();
141:            }
142:
143:            /**
144:             * Returns the axis at the specified index.
145:             *
146:             * @param  index the axis index, ranging from 0 inclusive to {@link #getDimension} exclusive.
147:             * @throws IndexOutOfBoundsException if the index is out of bounds.
148:             */
149:            public Axis getAxis(final int index)
150:                    throws IndexOutOfBoundsException {
151:                return (Axis) cs.getChild(index);
152:            }
153:
154:            /**
155:             * Adds an {@linkplain CoordinateSystemAxis axis} to the
156:             * {@linkplain CoordinateSystem coordinate system}.
157:             *
158:             * @param name The axis name, or {@code null} if unknown.
159:             * @param direction The {@linkplain AxisDirection axis direction}
160:             *        (usually {@code "east"}, {@code "weast"}, {@code "north"}, {@code "south"},
161:             *        {@code "up"} or {@code "down"}), or {@code null} if unknown.
162:             * @param units The axis units symbol, or {@code null} if unknown.
163:             *
164:             * @see CoordinateSystemAxis
165:             * @see AxisDirection
166:             */
167:            public Axis addAxis(final String name, final String direction,
168:                    final String units) {
169:                final Axis axis = (Axis) cs.addChild();
170:                axis.setName(name);
171:                axis.setDirection(direction);
172:                axis.setUnits(units);
173:                return axis;
174:            }
175:
176:            /**
177:             * Returns the {@linkplain CoordinateReferenceSystem coordinate reference system} in
178:             * <A HREF="http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/doc-files/WKT.html"><cite>Well
179:             * Known Text</cite> format</A>, or {@code null} if none.
180:             */
181:            public String getWKT() {
182:                return getString("WKT");
183:            }
184:
185:            /**
186:             * Sets the {@linkplain CoordinateReferenceSystem coordinate reference system} in
187:             * <A HREF="http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/doc-files/WKT.html"><cite>Well
188:             * Known Text</cite> format</A>.
189:             */
190:            public void setWKT(final String wkt) {
191:                setString("WKT", wkt);
192:            }
193:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.