Changeset 7422 in josm
- Timestamp:
- 2014-08-16T18:10:32+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java
r7402 r7422 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Rectangle; 6 7 import java.awt.geom.Area; 7 8 import java.util.ArrayList; … … 32 33 public final List<Node> nodes; 33 34 public final Area area; 35 public final Rectangle bounds; 34 36 35 37 /** … … 42 44 this.nodes = this.getNodes(); 43 45 this.area = Geometry.getArea(nodes); 46 this.bounds = area.getBounds(); 44 47 } 45 48 … … 275 278 } 276 279 277 PolygonIntersection intersection = Geometry.polygonIntersection(outerWay.area, innerWay.area); 278 279 if (intersection == PolygonIntersection.FIRST_INSIDE_SECOND) { 280 outerGood = false; // outer is inside another polygon 281 break; 282 } else if (intersection == PolygonIntersection.SECOND_INSIDE_FIRST) { 283 innerCandidates.add(innerWay); 284 } else if (intersection == PolygonIntersection.CROSSING) { 285 //ways intersect 286 return null; 280 // Preliminary computation on bounds. If bounds do not intersect, no need to do a costly area intersection 281 if (outerWay.bounds.intersects(innerWay.bounds)) { 282 // Bounds intersection, let's see in detail 283 PolygonIntersection intersection = Geometry.polygonIntersection(outerWay.area, innerWay.area); 284 285 if (intersection == PolygonIntersection.FIRST_INSIDE_SECOND) { 286 outerGood = false; // outer is inside another polygon 287 break; 288 } else if (intersection == PolygonIntersection.SECOND_INSIDE_FIRST) { 289 innerCandidates.add(innerWay); 290 } else if (intersection == PolygonIntersection.CROSSING) { 291 //ways intersect 292 return null; 293 } 287 294 } 288 295 } -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java
r7005 r7422 44 44 } 45 45 } 46 46 47 47 private JCheckBox prefUseIgnore; 48 48 private JCheckBox prefUseLayer; … … 92 92 test.addGui(testPanel); 93 93 } 94 94 95 95 gui.getValidatorPreference().addSubTab(this, tr("Tests"), 96 96 GuiHelper.embedInVerticalScrollPane(testPanel), … … 105 105 for (Test test : allTests) { 106 106 test.ok(); 107 String name = test.getClass().get SimpleName();107 String name = test.getClass().getName(); 108 108 if(!test.enabled) 109 109 tests.add(name); … … 111 111 testsBeforeUpload.add(name); 112 112 } 113 113 114 114 // Initializes all tests but MapCSSTagChecker because it is initialized 115 115 // later in ValidatorTagCheckerRulesPreference.ok(),
Note:
See TracChangeset
for help on using the changeset viewer.