Changeset 36102 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix
- Timestamp:
- 2023-07-24T15:55:23+02:00 (21 months ago)
- Location:
- applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/AssociatedStreetFixer.java
r33708 r36102 155 155 */ 156 156 // return results 157 if (commandList. size() == 0)157 if (commandList.isEmpty()) { 158 158 return null; 159 if (commandList.size() == 1) 160 return commandList.get(0); 161 return new SequenceCommand(tr("fix associatedStreet relation"), commandList); 159 } 160 return SequenceCommand.wrapIfNeeded(tr("fix associatedStreet relation"), commandList); 162 161 } 163 162 } -
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/BoundaryFixer.java
r34095 r36102 12 12 import org.openstreetmap.josm.gui.MainApplication; 13 13 14 15 14 /** 16 * @see https://wiki.openstreetmap.org/wiki/Relation:boundary 15 * Fix multipolygon boundaries 16 * @see <a href="https://wiki.openstreetmap.org/wiki/Relation:boundary">osmwiki:Relation:boundary</a> 17 17 */ 18 18 public class BoundaryFixer extends MultipolygonFixer { … … 25 25 * For boundary relations both "boundary" and "multipolygon" types are applicable, but 26 26 * it should also have key boundary=administrative to be fully boundary. 27 * @see https://wiki.openstreetmap.org/wiki/Relation:boundary 27 * @see <a href="https://wiki.openstreetmap.org/wiki/Relation:boundary">osmwiki:Relation:boundary</a> 28 28 */ 29 29 @Override -
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/MultipolygonFixer.java
r34095 r36102 20 20 21 21 /** 22 * @see https://wiki.openstreetmap.org/wiki/Relation:multipolygon 22 * @see <a href="https://wiki.openstreetmap.org/wiki/Relation:multipolygon">osmwiki:Relation:multipolygon</a> 23 23 */ 24 24 public class MultipolygonFixer extends RelationFixer { … … 69 69 Set<Way> outerWays = new HashSet<>(); 70 70 for (MultipolygonBuilder.JoinedPolygon poly : mpc.outerWays) { 71 for (Way w : poly.ways) { 72 outerWays.add(w); 73 } 71 outerWays.addAll(poly.ways); 74 72 } 75 73 Set<Way> innerWays = new HashSet<>(); 76 74 for (MultipolygonBuilder.JoinedPolygon poly : mpc.innerWays) { 77 for (Way w : poly.ways) { 78 innerWays.add(w); 79 } 75 innerWays.addAll(poly.ways); 80 76 } 81 77 for (int i = 0; i < r.getMembersCount(); i++) { 82 78 RelationMember m = r.getMember(i); 83 79 if (m.isWay()) { 80 final Way way = m.getWay(); 84 81 String role = null; 85 if (outerWays.contains( m.getMember())) {82 if (outerWays.contains(way)) { 86 83 role = "outer"; 87 } else if (innerWays.contains( m.getMember())) {84 } else if (innerWays.contains(way)) { 88 85 role = "inner"; 89 86 } 90 87 if (role != null && !role.equals(m.getRole())) { 91 r.setMember(i, new RelationMember(role, m.getMember()));88 r.setMember(i, new RelationMember(role, way)); 92 89 fixed = true; 93 90 } -
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/PublicTransportFixer.java
r34095 r36102 14 14 15 15 /** 16 * @see https://wiki.openstreetmap.org/wiki/Key:public_transport17 */18 19 /**20 16 * Helper function for determinate role in public_transport relation 21 17 * @author freeExec 18 * @see <a href="https://wiki.openstreetmap.org/wiki/Key:public_transport">osmwiki:Key:public_transport</a> 22 19 */ 23 20 public class PublicTransportFixer extends RelationFixer { -
applications/editors/josm/plugins/reltoolbox/src/relcontext/relationfix/RelationFixer.java
r34551 r36102 17 17 public abstract class RelationFixer { 18 18 19 private List<String> applicableTypes; 19 private final List<String> applicableTypes; 20 20 private SortAndFixAction sortAndFixAction; 21 21
Note:
See TracChangeset
for help on using the changeset viewer.