Revision 727 org.gvsig.topology/trunk/org.gvsig.topology/org.gvsig.topology.lib/org.gvsig.topology.lib.impl/src/main/java/org/gvsig/topology/rule/MustNotOverlapPolygonRule.java
MustNotOverlapPolygonRule.java | ||
---|---|---|
134 | 134 |
|
135 | 135 |
public MustNotOverlapPolygonRule( |
136 | 136 |
TopologyPlan plan, |
137 |
TopologyRuleFactory factory |
|
138 |
) { |
|
139 |
super(plan, factory); |
|
140 |
this.addAction(new CreateFetureAction()); |
|
141 |
this.addAction(new MergeAction()); |
|
142 |
this.addAction(new SubtractAction()); |
|
143 |
} |
|
144 |
|
|
145 |
public MustNotOverlapPolygonRule( |
|
146 |
TopologyPlan plan, |
|
147 | 137 |
TopologyRuleFactory factory, |
148 | 138 |
double tolerance, |
149 | 139 |
String dataSet1 |
... | ... | |
174 | 164 |
continue; |
175 | 165 |
} |
176 | 166 |
Feature feature = reference.getFeature(); |
177 |
if (polygon.overlaps(feature.getDefaultGeometry())) { |
|
167 |
Geometry otherPolygon = feature.getDefaultGeometry(); |
|
168 |
if (otherPolygon!=null && polygon.overlaps(otherPolygon)) {; |
|
169 |
Geometry error = otherPolygon.difference(polygon); |
|
178 | 170 |
report.addLine(this, |
179 | 171 |
theDataSet, |
180 | 172 |
null, |
181 | 173 |
polygon, |
174 |
error, |
|
182 | 175 |
feature1.getReference(), |
183 | 176 |
null, |
184 | 177 |
false, |
... | ... | |
198 | 191 |
) |
199 | 192 |
).toString() |
200 | 193 |
); |
201 |
if (theDataSet.findFirst(this.expression) != null) { |
|
194 |
Feature feature = theDataSet.findFirst(this.expression); |
|
195 |
if ( feature != null) { |
|
196 |
Geometry otherPolygon = feature.getDefaultGeometry(); |
|
197 |
Geometry error = null; |
|
198 |
if( otherPolygon!=null ) { |
|
199 |
error = polygon.difference(otherPolygon); |
|
200 |
} |
|
202 | 201 |
report.addLine(this, |
203 | 202 |
theDataSet, |
204 | 203 |
null, |
205 | 204 |
polygon, |
205 |
error, |
|
206 | 206 |
feature1.getReference(), |
207 | 207 |
null, |
208 | 208 |
false, |
Also available in: Unified diff