Changeset 5662 in josm
- Timestamp:
- 2013-01-04T01:49:12+01:00 (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/defaultpresets.xml
r5644 r5662 5929 5929 <roles> 5930 5930 <role key="street" text="street" requisite="required" type="way,closedway" member_expression="highway" /> 5931 <role key="house" text="house" requisite="required" type="node,closedway,relation" member_expression=""addr:housenumber"" /> 5931 <role key="house" text="house" requisite="required" type="node,way,closedway,relation" 5932 member_expression=""addr:housenumber" | "addr:interpolation"" /> 5932 5933 </roles> 5933 5934 </item> -
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r5655 r5662 41 41 protected static final int HOUSE_NUMBER_ON_NON_BUILDING_AREA = 2606; 42 42 43 protected static final String ADDR_HOUSE_NUMBER = "addr:housenumber"; 44 protected static final String ADDR_STREET = "addr:street"; 45 protected static final String ASSOCIATED_STREET = "associatedStreet"; 43 protected static final String ADDR_HOUSE_NUMBER = "addr:housenumber"; 44 protected static final String ADDR_INTERPOLATION = "addr:interpolation"; 45 protected static final String ADDR_STREET = "addr:street"; 46 protected static final String ASSOCIATED_STREET = "associatedStreet"; 46 47 47 48 protected class AddressError extends TestError { … … 143 144 } 144 145 // Report duplicate house numbers 145 String description_en = marktr("House number ' {0}' duplicated");146 String description_en = marktr("House number ''{0}'' duplicated"); 146 147 for (String key : map.keySet()) { 147 148 List<OsmPrimitive> list = map.get(key); … … 159 160 if (!street.isEmpty()) { 160 161 for (OsmPrimitive house : houses) { 161 checkDistance(house, street); 162 if (house.isUsable()) { 163 checkDistance(house, street); 164 } 162 165 } 163 166 } … … 170 173 centroid = ((Node) house).getEastNorth(); 171 174 } else if (house instanceof Way) { 172 centroid = Geometry.getCentroid(((Way)house).getNodes()); 175 List<Node> nodes = ((Way)house).getNodes(); 176 if (house.hasKey(ADDR_INTERPOLATION)) { 177 for (Node n : nodes) { 178 if (n.hasKey(ADDR_HOUSE_NUMBER)) { 179 checkDistance(n, street); 180 } 181 } 182 return; 183 } 184 centroid = Geometry.getCentroid(nodes); 173 185 } else { 174 186 return; // TODO handle multipolygon houses ?
Note:
See TracChangeset
for help on using the changeset viewer.