Changeset 28703 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java
- Timestamp:
- 2012-09-11T09:55:54+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java
r28693 r28703 1 1 package relcontext.relationfix; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import org.openstreetmap.josm.command.ChangeCommand; … … 15 17 16 18 public BoundaryFixer() { 17 super( new String[]{"boundary", "multipolygon"});19 super("boundary", "multipolygon"); 18 20 } 19 21 20 22 /** 21 * For boundary relations both "boundary" and "multipolygon" types are applicable, but 23 * For boundary relations both "boundary" and "multipolygon" types are applicable, but 22 24 * it should also have key boundary=administrative to be fully boundary. 23 25 * @see http://wiki.openstreetmap.org/wiki/Relation:boundary … … 27 29 return super.isFixerApplicable(rel) && "administrative".equals(rel.get("boundary")); 28 30 } 29 31 30 32 @Override 31 33 public boolean isRelationGood(Relation rel) { 32 34 for( RelationMember m : rel.getMembers() ) { 33 if (m.getType().equals(OsmPrimitiveType.RELATION) && !"subarea".equals(m.getRole())) 35 if (m.getType().equals(OsmPrimitiveType.RELATION) && !"subarea".equals(m.getRole())) { 36 setWarningMessage(tr("Relation without 'subarea' role found")); 34 37 return false; 35 if (m.getType().equals(OsmPrimitiveType.NODE) && !("label".equals(m.getRole()) || "admin_centre".equals(m.getRole()))) 38 } 39 if (m.getType().equals(OsmPrimitiveType.NODE) && !("label".equals(m.getRole()) || "admin_centre".equals(m.getRole()))) { 40 setWarningMessage(tr("Node without 'label' or 'admin_centre' role found")); 36 41 return false; 37 if (m.getType().equals(OsmPrimitiveType.WAY) && !("outer".equals(m.getRole()) || "inner".equals(m.getRole()))) 42 } 43 if (m.getType().equals(OsmPrimitiveType.WAY) && !("outer".equals(m.getRole()) || "inner".equals(m.getRole()))) { 44 setWarningMessage(tr("Way without 'inner' or 'outer' role found")); 38 45 return false; 46 } 39 47 } 48 clearWarningMessage(); 40 49 return true; 41 50 }
Note:
See TracChangeset
for help on using the changeset viewer.
