- Timestamp:
- 2014-02-08T00:20:41+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r6330 r6826 83 83 } 84 84 85 @Override 86 public void visit(Node n) { 87 List<Relation> associatedStreets = getAndCheckAssociatedStreets(n); 85 protected void checkHouseNumbersWithoutStreet(OsmPrimitive p) { 86 List<Relation> associatedStreets = getAndCheckAssociatedStreets(p); 88 87 // Find house number without proper location (neither addr:street, associatedStreet, addr:place or addr:interpolation) 89 if ( n.hasKey(ADDR_HOUSE_NUMBER) && !n.hasKey(ADDR_STREET) && !n.hasKey(ADDR_PLACE)) {88 if (p.hasKey(ADDR_HOUSE_NUMBER) && !p.hasKey(ADDR_STREET) && !p.hasKey(ADDR_PLACE)) { 90 89 for (Relation r : associatedStreets) { 91 90 if (r.hasTag("type", ASSOCIATED_STREET)) { … … 93 92 } 94 93 } 95 for (Way w : OsmPrimitive.getFilteredList( n.getReferrers(), Way.class)) {94 for (Way w : OsmPrimitive.getFilteredList(p.getReferrers(), Way.class)) { 96 95 if (w.hasKey(ADDR_INTERPOLATION) && w.hasKey(ADDR_STREET)) { 97 96 return; … … 99 98 } 100 99 // No street found 101 errors.add(new AddressError(HOUSE_NUMBER_WITHOUT_STREET, n, tr("House number without street"))); 102 } 100 errors.add(new AddressError(HOUSE_NUMBER_WITHOUT_STREET, p, tr("House number without street"))); 101 } 102 } 103 104 @Override 105 public void visit(Node n) { 106 checkHouseNumbersWithoutStreet(n); 103 107 } 104 108 105 109 @Override 106 110 public void visit(Way w) { 107 getAndCheckAssociatedStreets(w);111 checkHouseNumbersWithoutStreet(w); 108 112 } 109 113 110 114 @Override 111 115 public void visit(Relation r) { 112 getAndCheckAssociatedStreets(r);116 checkHouseNumbersWithoutStreet(r); 113 117 if (r.hasTag("type", ASSOCIATED_STREET)) { 114 118 // Used to count occurences of each house number in order to find duplicates … … 202 206 } 203 207 } else { 204 Main.warn("Addresses test skipped chunck "+chunk+" for street part "+streetPart+" because p1 or p2 is null"); 208 Main.warn("Addresses test skipped chunck "+chunk+" for street part "+streetPart+" because p1 or p2 is null"); 205 209 } 206 210 }
Note:
See TracChangeset
for help on using the changeset viewer.