Changeset 10363 in josm for trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
- Timestamp:
- 2016-06-12T20:40:45+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
r10234 r10363 42 42 /** Values for {@code power} key interpreted as power stations */ 43 43 protected static final Collection<String> POWER_STATION_TAGS = Arrays.asList("station", "sub_station", "substation", "plant", "generator"); 44 /** Values for {@code building} key interpreted as power stations */ 45 protected static final Collection<String> BUILDING_STATION_TAGS = Arrays.asList("transformer_tower"); 44 46 /** Values for {@code power} key interpreted as allowed power items */ 45 47 protected static final Collection<String> POWER_ALLOWED_TAGS = Arrays.asList("switch", "transformer", "busbar", "generator", "switchgear", … … 174 176 */ 175 177 protected static final boolean isPowerStation(OsmPrimitive p) { 176 return isPowerIn(p, POWER_STATION_TAGS) ;178 return isPowerIn(p, POWER_STATION_TAGS) || isBuildingIn(p, BUILDING_STATION_TAGS); 177 179 } 178 180 … … 196 198 197 199 /** 198 * Helper function to check if power tag sis a certain value.200 * Helper function to check if power tag is a certain value. 199 201 * @param p The primitive to be tested 200 202 * @param values List of possible values … … 203 205 private static boolean isPowerIn(OsmPrimitive p, Collection<String> values) { 204 206 String v = p.get("power"); 207 return v != null && values != null && values.contains(v); 208 } 209 210 /** 211 * Helper function to check if building tag is a certain value. 212 * @param p The primitive to be tested 213 * @param values List of possible values 214 * @return {@code true} if power key is set and equal to possible values 215 */ 216 private static boolean isBuildingIn(OsmPrimitive p, Collection<String> values) { 217 String v = p.get("building"); 205 218 return v != null && values != null && values.contains(v); 206 219 }
Note:
See TracChangeset
for help on using the changeset viewer.