Source Code Cross Referenced for CRSEnvelope.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » ows » 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.data.ows 
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:         *    
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation; either
009:         *    version 2.1 of the License, or (at your option) any later version.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.data.ows;
017:
018:        import org.geotools.geometry.GeneralDirectPosition;
019:        import org.opengis.referencing.crs.CoordinateReferenceSystem;
020:        import org.opengis.geometry.DirectPosition;
021:        import org.opengis.geometry.Envelope;
022:
023:        /**
024:         * A pair of coordinates and a reference system that represents a section of
025:         * the Earth
026:         *
027:         * @author Richard Gould
028:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wms/src/main/java/org/geotools/data/ows/CRSEnvelope.java $
029:         */
030:        public class CRSEnvelope implements  Envelope {
031:            /** Represents the Coordinate Reference System this bounding box is in */
032:            private String epsgCode;
033:            protected double minX;
034:            protected double minY;
035:            protected double maxX;
036:            protected double maxY;
037:
038:            /**
039:             * Construct an empty BoundingBox
040:             */
041:            public CRSEnvelope() {
042:                super ();
043:            }
044:
045:            /**
046:             * Create a bounding box with the specified properties
047:             *
048:             * @param epsgCode The Coordinate Reference System this bounding box is in
049:             * @param minX
050:             * @param minY
051:             * @param maxX
052:             * @param maxY
053:             */
054:            public CRSEnvelope(String epsgCode, double minX, double minY,
055:                    double maxX, double maxY) {
056:                this .epsgCode = epsgCode;
057:                this .minX = minX;
058:                this .maxX = maxX;
059:                this .minY = minY;
060:                this .maxY = maxY;
061:            }
062:
063:            /**
064:             * Returns the coordinate reference system for this envelope.
065:             * Current implementation always return {@code null}, but it
066:             * may change in a future version.
067:             */
068:            public CoordinateReferenceSystem getCoordinateReferenceSystem() {
069:                return null;
070:            }
071:
072:            /**
073:             * The CRS is bounding box's Coordinate Reference System
074:             *
075:             * @return the CRS/SRS value
076:             */
077:            public String getEPSGCode() {
078:                return epsgCode;
079:            }
080:
081:            /**
082:             * The CRS is bounding box's Coordinate Reference System
083:             *
084:             * @param epsgCode the new value for the CRS/SRS
085:             */
086:            public void setEPSGCode(String epsgCode) {
087:                this .epsgCode = epsgCode;
088:            }
089:
090:            public int getDimension() {
091:                return 2;
092:            }
093:
094:            public double getMinimum(int dimension) {
095:                if (dimension == 0) {
096:                    return getMinX();
097:                }
098:
099:                return getMinY();
100:            }
101:
102:            public double getMaximum(int dimension) {
103:                if (dimension == 0) {
104:                    return getMaxX();
105:                }
106:
107:                return getMaxY();
108:            }
109:
110:            public double getCenter(int dimension) {
111:                double min, max;
112:                if (dimension == 0) {
113:                    min = getMinX();
114:                    max = getMaxX();
115:                } else {
116:                    min = getMinY();
117:                    max = getMaxY();
118:                }
119:                return min + (getLength(dimension) / 2);
120:            }
121:
122:            public double getLength(int dimension) {
123:                double min, max;
124:                if (dimension == 0) {
125:                    min = getMinX();
126:                    max = getMaxX();
127:                } else {
128:                    min = getMinY();
129:                    max = getMaxY();
130:                }
131:
132:                return max - min;
133:            }
134:
135:            public DirectPosition getUpperCorner() {
136:                return new GeneralDirectPosition(getMaxX(), getMaxY());
137:            }
138:
139:            public DirectPosition getLowerCorner() {
140:                return new GeneralDirectPosition(getMinX(), getMinY());
141:            }
142:
143:            /**
144:             * The maxX value is the higher X coordinate value
145:             *
146:             * @return the bounding box's maxX value
147:             */
148:            public double getMaxX() {
149:                return maxX;
150:            }
151:
152:            /**
153:             * The maxX value is the higher X coordinate value
154:             *
155:             * @param maxX the new value for maxX. Should be greater than minX.
156:             */
157:            public void setMaxX(double maxX) {
158:                this .maxX = maxX;
159:            }
160:
161:            /**
162:             * The maxY value is the higher Y coordinate value
163:             *
164:             * @return the bounding box's maxY value
165:             */
166:            public double getMaxY() {
167:                return maxY;
168:            }
169:
170:            /**
171:             * The maxY value is the higher Y coordinate value
172:             *
173:             * @param maxY the new value for maxY. Should be greater than minY.
174:             */
175:            public void setMaxY(double maxY) {
176:                this .maxY = maxY;
177:            }
178:
179:            /**
180:             * The minX value is the lower X coordinate value
181:             *
182:             * @return the bounding box's minX value
183:             */
184:            public double getMinX() {
185:                return minX;
186:            }
187:
188:            /**
189:             * The minX value is the lower X coordinate value
190:             *
191:             * @param minX the new value for minX. Should be less than maxX.
192:             */
193:            public void setMinX(double minX) {
194:                this .minX = minX;
195:            }
196:
197:            /**
198:             * The minY value is the lower Y coordinate value
199:             *
200:             * @return the bounding box's minY value
201:             */
202:            public double getMinY() {
203:                return minY;
204:            }
205:
206:            /**
207:             * The minY value is the lower Y coordinate value
208:             *
209:             * @param minY the new value for minY. Should be less than maxY.
210:             */
211:            public void setMinY(double minY) {
212:                this .minY = minY;
213:            }
214:
215:            public String toString() {
216:                return epsgCode.toString() + " [" + minX + "," + minY + " "
217:                        + maxX + "," + maxY + "]";
218:            }
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.