Changeset 19066 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r18208 r19066 465 465 String key = entry.getKey(); 466 466 String value = entry.getValue(); 467 List<OsmPrimitive> affectedWays = innerWays.stream().filter(way -> value.equals(way.get(key))).collect(Collectors.toList()); 467 List<OsmPrimitive> affectedWays; 468 if ("area".equals(key)) { 469 affectedWays = innerWays.stream().filter(way -> value.equals(way.get(key))).collect(Collectors.toList()); 470 } else { 471 affectedWays = new ArrayList<>(); 472 } 468 473 469 474 if (moveTags) { -
trunk/test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
r18870 r19066 291 291 } 292 292 293 /** 294 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/23641">Bug #23641</a>. 295 * @throws Exception if an error occurs 296 */ 297 @Test 298 void testTicket23642() throws Exception { 299 DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(23641, "data.osm"), null); 300 assertEquals(0, ds.getRelations().size()); 301 Pair<SequenceCommand, Relation> cmd = CreateMultipolygonAction.createMultipolygonCommand(ds.getWays(), null); 302 assertNotNull(cmd); 303 cmd.a.executeCommand(); 304 assertEquals(1, ds.getRelations().size()); 305 Relation mp = ds.getRelations().iterator().next(); 306 assertTrue(mp.hasTag("landuse", "forest")); 307 assertTrue(mp.hasTag("leaf_type", "needleleaved")); 308 assertEquals(0, ds.getWays().stream().filter(w -> w.hasTag("leaf_type", "needleleaved")).count()); 309 assertEquals(1, ds.getWays().stream().filter(w -> w.hasTag("leaf_type", "broadleaved")).count()); 310 assertEquals(1, mp.getMembers().stream() 311 .filter(m -> "inner".equals(m.getRole()) && m.getMember().hasTag("landuse", "forest")).count()); 312 Pair<SequenceCommand, Relation> updateCmd = CreateMultipolygonAction.createMultipolygonCommand(ds.getWays(), mp); 313 assertNull(updateCmd); 314 } 315 293 316 }
Note:
See TracChangeset
for help on using the changeset viewer.