Source Code Cross Referenced for BoundaryNodeRule.java in  » GIS » jts » com » vividsolutions » jts » algorithm » 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 » jts » com.vividsolutions.jts.algorithm 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The JTS Topology Suite is a collection of Java classes that
003:         * implement the fundamental operations required to validate a given
004:         * geo-spatial data set to a known topological specification.
005:         *
006:         * Copyright (C) 2001 Vivid Solutions
007:         *
008:         * This library is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU Lesser General Public
010:         * License as published by the Free Software Foundation; either
011:         * version 2.1 of the License, or (at your option) any later version.
012:         *
013:         * This library is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:         * Lesser General Public License for more details.
017:         *
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:         *
022:         * For more information, contact:
023:         *
024:         *     Vivid Solutions
025:         *     Suite #1A
026:         *     2328 Government Street
027:         *     Victoria BC  V8T 5G5
028:         *     Canada
029:         *
030:         *     (250)385-6040
031:         *     www.vividsolutions.com
032:         */
033:        package com.vividsolutions.jts.algorithm;
034:
035:        /**
036:         * An interface for rules which determine whether node points
037:         * which are in boundaries of lineal geometry components
038:         * are in the boundary of the parent geometry collection.
039:         * The SFS specifies a single kind of boundary node rule,
040:         * the {@link Mod2BoundaryNodeRule} rule.
041:         * However, other kinds of Boundary Node Rules are appropriate
042:         * in specific situations (for instance, linear network topology
043:         * usually follows the {@link EndPointBoundaryNodeRule}.)
044:         * Some JTS operations allow the BoundaryNodeRule to be specified,
045:         * and respect this rule when computing the results of the operation.
046:         *
047:         * @author Martin Davis
048:         * @version 1.7
049:         *
050:         * @see RelateOp
051:         * @see IsSimpleOp
052:         */
053:        public interface BoundaryNodeRule {
054:
055:            boolean isInBoundary(int boundaryCount);
056:
057:            /**
058:             * The Mod-2 Boundary Node Rule (as used in the OGC SFS).
059:             */
060:            public static final BoundaryNodeRule MOD2_BOUNDARY_RULE = new Mod2BoundaryNodeRule();
061:
062:            /**
063:             * The Endpoint Boundary Node Rule.
064:             */
065:            public static final BoundaryNodeRule ENDPOINT_BOUNDARY_RULE = new EndPointBoundaryNodeRule();
066:
067:            /**
068:             * The MultiValent Endpoint Boundary Node Rule.
069:             */
070:            public static final BoundaryNodeRule MULTIVALENT_ENDPOINT_BOUNDARY_RULE = new MultiValentEndPointBoundaryNodeRule();
071:
072:            /**
073:             * The Monovalent Endpoint Boundary Node Rule.
074:             */
075:            public static final BoundaryNodeRule MONOVALENT_ENDPOINT_BOUNDARY_RULE = new MonoValentEndPointBoundaryNodeRule();
076:
077:            /**
078:             * The Boundary Node Rule specified by the OGC Simple Features Specification,
079:             * equal to the Mod-2 rule.
080:             */
081:            public static final BoundaryNodeRule OGC_SFS_BOUNDARY_RULE = MOD2_BOUNDARY_RULE;
082:
083:            /**
084:             * A {@link BoundaryNodeRule} specifies that points are in the
085:             * boundary of a lineal geometry iff
086:             * the point lies on the boundary of an odd number
087:             * of components.
088:             * Under this rule {@link LinearRing}s and closed
089:             * {@link LineString}s have an empty boundary.
090:             * <p>
091:             * This is the rule specified by the <i>OGC SFS</i>,
092:             * and is the default rule used in JTS.
093:             *
094:             * @author Martin Davis
095:             * @version 1.7
096:             */
097:            public static class Mod2BoundaryNodeRule implements 
098:                    BoundaryNodeRule {
099:                public boolean isInBoundary(int boundaryCount) {
100:                    // the "Mod-2 Rule"
101:                    return boundaryCount % 2 == 1;
102:                }
103:            }
104:
105:            /**
106:             * A {@link BoundaryNodeRule} which specifies that any points which are endpoints
107:             * of lineal components are in the boundary of the
108:             * parent geometry.
109:             * This corresponds to the "intuitive" topological definition
110:             * of boundary.
111:             * Under this rule {@link LinearRing}s have a non-empty boundary
112:             * (the common endpoint of the underlying LineString).
113:             * <p>
114:             * This rule is useful when dealing with linear networks.
115:             * For example, it can be used to check
116:             * whether linear networks are correctly noded.
117:             * The usual network topology constraint is that linear segments may touch only at endpoints.
118:             * In the case of a segment touching a closed segment (ring) at one point,
119:             * the Mod2 rule cannot distinguish between the permitted case of touching at the
120:             * node point and the invalid case of touching at some other interior (non-node) point.
121:             * The EndPoint rule does distinguish between these cases,
122:             * so is more appropriate for use.
123:             *
124:             * @author Martin Davis
125:             * @version 1.7
126:             */
127:            public static class EndPointBoundaryNodeRule implements 
128:                    BoundaryNodeRule {
129:                public boolean isInBoundary(int boundaryCount) {
130:                    return boundaryCount > 0;
131:                }
132:            }
133:
134:            /**
135:             * A {@link BoundaryNodeRule} which determines that only
136:             * endpoints with valency greater than 1 are on the boundary.
137:             * This corresponds to the boundary of a {@link MultiLineString}
138:             * being all the "attached" endpoints, but not
139:             * the "unattached" ones.
140:             *
141:             * @author Martin Davis
142:             * @version 1.7
143:             */
144:            public static class MultiValentEndPointBoundaryNodeRule implements 
145:                    BoundaryNodeRule {
146:                public boolean isInBoundary(int boundaryCount) {
147:                    return boundaryCount > 1;
148:                }
149:            }
150:
151:            /**
152:             * A {@link BoundaryNodeRule} which determines that only
153:             * endpoints with valency of exactly 1 are on the boundary.
154:             * This corresponds to the boundary of a {@link MultiLineString}
155:             * being all the "unattached" endpoints.
156:             *
157:             * @author Martin Davis
158:             * @version 1.7
159:             */
160:            public static class MonoValentEndPointBoundaryNodeRule implements 
161:                    BoundaryNodeRule {
162:                public boolean isInBoundary(int boundaryCount) {
163:                    return boundaryCount == 1;
164:                }
165:            }
166:
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.