Changeset 7947 in josm for trunk


Ignore:
Timestamp:
2015-01-09T21:14:38+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #10945 - allow several associatedStreet relations if they share the same name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java

    r7937 r7947  
    2828import org.openstreetmap.josm.tools.Geometry;
    2929import org.openstreetmap.josm.tools.Pair;
     30import org.openstreetmap.josm.tools.Predicate;
     31import org.openstreetmap.josm.tools.Utils;
    3032
    3133/**
     
    7678        }
    7779        if (list.size() > 1) {
    78             List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(list);
    79             errorList.add(0, p);
    80             errors.add(new AddressError(MULTIPLE_STREET_RELATIONS, errorList, tr("Multiple associatedStreet relations")));
     80            // no warning if several relations have the same name, see #10945
     81            final String name = list.get(0).get("name");
     82            if (name == null || Utils.filter(list, new Predicate<Relation>() {
     83                @Override
     84                public boolean evaluate(Relation r) {
     85                    return name.equals(r.get("name"));
     86                }
     87            }).size() < list.size()) {
     88                List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(list);
     89                errorList.add(0, p);
     90                errors.add(new AddressError(MULTIPLE_STREET_RELATIONS, errorList, tr("Multiple associatedStreet relations")));
     91            }
    8192        }
    8293        return list;
Note: See TracChangeset for help on using the changeset viewer.