Ignore:
Timestamp:
2017-08-15T22:41:09+02:00 (7 years ago)
Author:
giackserva
Message:

[pt_assistant] added support for entry and exit only stops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/data/PTStop.java

    r33498 r33499  
    5252        super(other);
    5353
     54        String role = "";
     55        if (other.getRole().contains("_exit_only")) {
     56            exitOnly = true;
     57            role = "_exit_only";
     58        } else if (other.getRole().contains("_entry_only")) {
     59            entryOnly = true;
     60            role = "_entry_only";
     61        }
     62
    5463        if (isPTStopPosition(other)) {
    5564            stopPosition = other.getNode();
    5665            name = stopPosition.get("name");
    57             setStopPositionRM(new RelationMember("stop", other.getMember()));
     66            stopPositionRM = new RelationMember("stop" + role, other.getMember());
    5867        } else if (isPTPlatform(other)) {
    5968            platform = other.getMember();
    6069            name = platform.get("name");
    61             setPlatformRM(new RelationMember("platform", other.getMember()));
     70            platformRM = new RelationMember("platform" + role, other.getMember());
    6271        } else {
    6372            throw new IllegalArgumentException(
     
    7887    public boolean addStopElement(RelationMember member) {
    7988
     89        String role = "";
     90        if (member.getRole().contains("_exit_only")) {
     91            exitOnly = true;
     92            role = "_exit_only";
     93        } else if (member.getRole().contains("_entry_only")) {
     94            entryOnly = true;
     95            role = "_entry_only";
     96        }
     97
    8098        if (stopPosition == null && isPTStopPosition(member)) {
    8199            this.stopPosition = member.getNode();
    82             stopPositionRM = new RelationMember("stop", member.getMember());
     100            stopPositionRM = new RelationMember("stop" + role, member.getMember());
    83101            return true;
    84102        } else if (platform == null && isPTPlatform(member)) {
    85103            platform = member.getMember();
    86             platformRM = new RelationMember("platform", member.getMember());
     104            platformRM = new RelationMember("platform" + role, member.getMember());
    87105            return true;
    88106        }
Note: See TracChangeset for help on using the changeset viewer.