Ticket #19594: 19594.patch
File 19594.patch, 2.2 KB (added by , 5 years ago) |
---|
-
src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
395 395 } 396 396 } 397 397 398 private static final List<String> DEFAULT_LINEAR_TAGS = Arrays.asList("barrier", "fence_type", " source");398 private static final List<String> DEFAULT_LINEAR_TAGS = Arrays.asList("barrier", "fence_type", "highway", "source"); 399 399 400 400 /** 401 401 * This method removes tags/value pairs from inner and outer ways and put them on relation if necessary. … … 445 445 } 446 446 } 447 447 448 int origValuesSize = values.size(); 449 448 450 for (String key : conflictingKeys) { 449 451 values.remove(key); 450 452 } … … 456 458 if ("coastline".equals(values.get("natural"))) 457 459 values.remove("natural"); 458 460 461 boolean moveTags = Config.getPref().getBoolean("multipoly.movetags", true); 462 boolean badMove = moveTags && Config.getPref().getBoolean("multipoly.no-movetag-on-conflict", true) 463 && (!conflictingKeys.isEmpty() || origValuesSize > values.size()); 464 List<Command> commands = new ArrayList<>(); 465 459 466 values.put("area", OsmUtils.TRUE_VALUE); 460 467 461 List<Command> commands = new ArrayList<>();462 boolean moveTags = Config.getPref().getBoolean("multipoly.movetags", true);463 464 468 for (Entry<String, String> entry : values.entrySet()) { 465 469 String key = entry.getKey(); 466 470 String value = entry.getValue(); … … 482 486 } 483 487 484 488 values.remove("area"); 489 if (badMove && !commands.isEmpty()) { 490 commands.clear(); 491 moveTags = false; 492 } 485 493 if (moveTags && !values.isEmpty()) { 486 494 // add those tag values to the relation 487 495 Map<String, String> tagsToAdd = new HashMap<>(); … … 498 506 commands.add(new ChangePropertyCommand(Collections.singleton(relation), tagsToAdd)); 499 507 } 500 508 } 501 502 509 return commands; 503 510 } 504 511 }