From 964b2543f5f4e7a3d640d361fe7c41eb96392855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Mon, 24 Aug 2020 10:05:49 +0200 Subject: [PATCH 01/52] Add action to extract new relation from a subset of members of an existing relation --- ...actRelationMembersToNewRelationAction.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java new file mode 100644 index 00000000..fab062cd --- /dev/null +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -0,0 +1,73 @@ +package org.openstreetmap.josm.plugins.pt_assistant.actions; + +import java.awt.event.ActionEvent; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; + +import javax.swing.JOptionPane; + +import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; +import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; +import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; +import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; +import org.openstreetmap.josm.tools.I18n; +import org.openstreetmap.josm.tools.ImageProvider; + +public class ExtractRelationMembersToNewRelationAction extends AbstractRelationEditorAction { + public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess editorAccess) { + super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.TAG_CHANGE); + new ImageProvider("bus").getResource().attachImageIcon(this); + } + + @Override + public void actionPerformed(ActionEvent actionEvent) { + final Collection selectedMembers = editorAccess.getMemberTableModel().getSelectedMembers(); + final Map tags = editorAccess.getTagModel().getTags(); + + final Relation extractedRelation = new Relation(); + extractedRelation.setKeys(tags); + for (final RelationMember member : selectedMembers) { + extractedRelation.addMember(member); + } + + if ( + JOptionPane.showConfirmDialog( + getMemberTable(), + I18n.tr( + "Do you really want to create a new relation from the {0} selected members of relation {1}, copying the {2} tags to the new relation?", + selectedMembers.size(), + getEditor().getRelation().getId(), + tags.size() + ), + I18n.tr("Extract part from relation?"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE + ) == JOptionPane.OK_OPTION + ) { + getEditor().getLayer().data.addPrimitive(extractedRelation); + RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); + } + } + + @Override + public boolean isExpertOnly() { + return true; + } + + @Override + protected void updateEnabledState() { + final boolean newEnabledState = !editorAccess.getSelectionTableModel().getSelection().isEmpty() + && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> "route".equals(it.getValue())).isPresent(); + + putValue(SHORT_DESCRIPTION, ( + newEnabledState + ? I18n.tr("Extract part of the route into new relation") + : I18n.tr("Extract into new relation (needs type=route tag and at least one selected relation member)") + )); + setEnabled(newEnabledState); + } +} From 7d0ad20bf55420ae7deb93b65fa56704717cfad2 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 24 Aug 2020 19:21:01 +0200 Subject: [PATCH 02/52] Added code to --- .../pt_assistant/PTAssistantPlugin.java | 16 +++--------- ...actRelationMembersToNewRelationAction.java | 26 ++++++++++++++++--- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java index aaf42d2d..8beabece 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/PTAssistantPlugin.java @@ -27,18 +27,7 @@ import org.openstreetmap.josm.plugins.Plugin; import org.openstreetmap.josm.plugins.PluginInformation; import org.openstreetmap.josm.plugins.customizepublictransportstop.CustomizeStopAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.AddStopPositionAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.CreatePlatformNodeAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.CreatePlatformNodeThroughReplaceAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.CreatePlatformShortcutAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.DoubleSplitAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.EdgeSelectionAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.ExtractPlatformNodeAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.PTWizardAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.RoutingAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.SortPTRouteMembersAction; -import org.openstreetmap.josm.plugins.pt_assistant.actions.SortPTRouteMembersMenuBar; -import org.openstreetmap.josm.plugins.pt_assistant.actions.SplitRoundaboutAction; +import org.openstreetmap.josm.plugins.pt_assistant.actions.*; import org.openstreetmap.josm.plugins.pt_assistant.data.PTRouteSegment; import org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantLayerManager; import org.openstreetmap.josm.plugins.pt_assistant.validation.BicycleFootRouteValidatorTest; @@ -191,7 +180,8 @@ public int order() { @Override public List getActions(IRelationEditorActionAccess editorAccess) { - return Arrays.asList(new SortPTRouteMembersAction(editorAccess)); + return Arrays.asList(new SortPTRouteMembersAction(editorAccess), + new ExtractRelationMembersToNewRelationAction(editorAccess)); } }; RelationEditorHooks.addActionsToMembers(group1); diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index fab062cd..bcc1b18d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -8,6 +8,8 @@ import javax.swing.JOptionPane; +import org.openstreetmap.josm.command.ChangeCommand; +import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; @@ -27,12 +29,28 @@ public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess edi public void actionPerformed(ActionEvent actionEvent) { final Collection selectedMembers = editorAccess.getMemberTableModel().getSelectedMembers(); final Map tags = editorAccess.getTagModel().getTags(); + final Relation superroute_relation = editorAccess.getEditor().getRelation(); final Relation extractedRelation = new Relation(); extractedRelation.setKeys(tags); - for (final RelationMember member : selectedMembers) { - extractedRelation.addMember(member); + int i = 0; boolean flag = true; + + Relation newsuperroute_relation = new Relation(superroute_relation); + for (final RelationMember member : newsuperroute_relation.getMembers()) { + if (selectedMembers.contains(member)) { + extractedRelation.addMember(member); + newsuperroute_relation.removeMembersFor(member.getMember()); + } + if (flag) { + // superroute_relation.addMember(i, new RelationMember("", extractedRelation)); + flag = false; + } + i++; } + extractedRelation.put("type", "route"); + + UndoRedoHandler.getInstance().add(new ChangeCommand(superroute_relation, newsuperroute_relation)); + editorAccess.getEditor().reloadDataFromRelation(); if ( JOptionPane.showConfirmDialog( @@ -61,12 +79,12 @@ public boolean isExpertOnly() { @Override protected void updateEnabledState() { final boolean newEnabledState = !editorAccess.getSelectionTableModel().getSelection().isEmpty() - && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> "route".equals(it.getValue())).isPresent(); + && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> "superroute".equals(it.getValue())).isPresent(); putValue(SHORT_DESCRIPTION, ( newEnabledState ? I18n.tr("Extract part of the route into new relation") - : I18n.tr("Extract into new relation (needs type=route tag and at least one selected relation member)") + : I18n.tr("Extract into new relation (needs type=superroute tag and at least one selected relation member)") )); setEnabled(newEnabledState); } From 3da486073770db7c09f29bdca41fb669a3a3de51 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Tue, 25 Aug 2020 01:05:59 +0200 Subject: [PATCH 03/52] Added code to --- ...actRelationMembersToNewRelationAction.java | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index bcc1b18d..c8d16d5b 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -1,17 +1,16 @@ package org.openstreetmap.josm.plugins.pt_assistant.actions; import java.awt.event.ActionEvent; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; +import java.util.*; import javax.swing.JOptionPane; +import org.openstreetmap.josm.command.AddCommand; import org.openstreetmap.josm.command.ChangeCommand; import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.gui.MainApplication; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; @@ -19,6 +18,8 @@ import org.openstreetmap.josm.tools.I18n; import org.openstreetmap.josm.tools.ImageProvider; +import static org.openstreetmap.josm.gui.MainApplication.*; + public class ExtractRelationMembersToNewRelationAction extends AbstractRelationEditorAction { public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess editorAccess) { super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.TAG_CHANGE); @@ -29,28 +30,8 @@ public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess edi public void actionPerformed(ActionEvent actionEvent) { final Collection selectedMembers = editorAccess.getMemberTableModel().getSelectedMembers(); final Map tags = editorAccess.getTagModel().getTags(); - final Relation superroute_relation = editorAccess.getEditor().getRelation(); - - final Relation extractedRelation = new Relation(); - extractedRelation.setKeys(tags); - int i = 0; boolean flag = true; + final Relation originalRelation = editorAccess.getEditor().getRelation(); - Relation newsuperroute_relation = new Relation(superroute_relation); - for (final RelationMember member : newsuperroute_relation.getMembers()) { - if (selectedMembers.contains(member)) { - extractedRelation.addMember(member); - newsuperroute_relation.removeMembersFor(member.getMember()); - } - if (flag) { - // superroute_relation.addMember(i, new RelationMember("", extractedRelation)); - flag = false; - } - i++; - } - extractedRelation.put("type", "route"); - - UndoRedoHandler.getInstance().add(new ChangeCommand(superroute_relation, newsuperroute_relation)); - editorAccess.getEditor().reloadDataFromRelation(); if ( JOptionPane.showConfirmDialog( @@ -66,7 +47,30 @@ public void actionPerformed(ActionEvent actionEvent) { JOptionPane.QUESTION_MESSAGE ) == JOptionPane.OK_OPTION ) { - getEditor().getLayer().data.addPrimitive(extractedRelation); + final Relation extractedRelation = new Relation(); + extractedRelation.setKeys(tags); + UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); + final Relation newExtractedRelation = new Relation(extractedRelation); + boolean flag = true; + + Relation newRelation = new Relation(originalRelation); + List members = newRelation.getMembers(); + for (int i = members.size()-1; i >= 0; i--) { + RelationMember member = members.get(i); + if (selectedMembers.contains(member)) { + newExtractedRelation.addMember(0, member); + newRelation.removeMember(i); + if (flag) { + newRelation.addMember(i, new RelationMember("", extractedRelation)); + flag = false; + } + } + } + newExtractedRelation.put("type", "route"); + + UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, newRelation)); + UndoRedoHandler.getInstance().add(new ChangeCommand(extractedRelation, newExtractedRelation)); + editorAccess.getEditor().reloadDataFromRelation(); RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); } } From 12411a34acebe3f29aa3f9eb37c44f0d4f50f188 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Tue, 25 Aug 2020 01:07:48 +0200 Subject: [PATCH 04/52] Now it works the way I wanted it to work. I'll keep testing it more thoroughly --- .../actions/ExtractRelationMembersToNewRelationAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index c8d16d5b..36d72dc7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -83,12 +83,12 @@ public boolean isExpertOnly() { @Override protected void updateEnabledState() { final boolean newEnabledState = !editorAccess.getSelectionTableModel().getSelection().isEmpty() - && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> "superroute".equals(it.getValue())).isPresent(); + && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> "route".equals(it.getValue())).isPresent(); putValue(SHORT_DESCRIPTION, ( newEnabledState ? I18n.tr("Extract part of the route into new relation") - : I18n.tr("Extract into new relation (needs type=superroute tag and at least one selected relation member)") + : I18n.tr("Extract into new relation (needs type=route tag and at least one selected relation member)") )); setEnabled(newEnabledState); } From ce6106dfbfe997cfc34dc818b735b882555679b7 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 26 Aug 2020 11:48:37 +0200 Subject: [PATCH 05/52] I succeeded in making it work the way I want and I incorporated Florian's suggestions. It sometimes still crashes on line 72. editorAccess.getEditor().reloadDataFromRelation(); Particularly if I use it on a new relation that wasn't saved yet. --- ...actRelationMembersToNewRelationAction.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 36d72dc7..0e89b593 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -11,6 +11,7 @@ import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.gui.MainApplication; +import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; @@ -28,7 +29,8 @@ public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess edi @Override public void actionPerformed(ActionEvent actionEvent) { - final Collection selectedMembers = editorAccess.getMemberTableModel().getSelectedMembers(); + final MemberTableModel memberTableModel = editorAccess.getMemberTableModel(); + final Collection selectedMembers = memberTableModel.getSelectedMembers(); final Map tags = editorAccess.getTagModel().getTags(); final Relation originalRelation = editorAccess.getEditor().getRelation(); @@ -49,27 +51,24 @@ public void actionPerformed(ActionEvent actionEvent) { ) { final Relation extractedRelation = new Relation(); extractedRelation.setKeys(tags); - UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); - final Relation newExtractedRelation = new Relation(extractedRelation); - boolean flag = true; + extractedRelation.put("type", "route"); - Relation newRelation = new Relation(originalRelation); + final Relation newRelation = new Relation(originalRelation); List members = newRelation.getMembers(); - for (int i = members.size()-1; i >= 0; i--) { - RelationMember member = members.get(i); - if (selectedMembers.contains(member)) { - newExtractedRelation.addMember(0, member); - newRelation.removeMember(i); - if (flag) { - newRelation.addMember(i, new RelationMember("", extractedRelation)); - flag = false; - } - } + int[] selectedIndices = memberTableModel.getSelectedIndices(); + int index = 0; + for (int i = selectedIndices.length-1; i >= 0; i--) { + index = selectedIndices[i]; + RelationMember member = members.get(index); + extractedRelation.addMember(0, member); + newRelation.removeMember(index); } - newExtractedRelation.put("type", "route"); + UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); + if (index > 0) { + newRelation.addMember(index, new RelationMember("", extractedRelation)); + } UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, newRelation)); - UndoRedoHandler.getInstance().add(new ChangeCommand(extractedRelation, newExtractedRelation)); editorAccess.getEditor().reloadDataFromRelation(); RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); } @@ -83,7 +82,7 @@ public boolean isExpertOnly() { @Override protected void updateEnabledState() { final boolean newEnabledState = !editorAccess.getSelectionTableModel().getSelection().isEmpty() - && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> "route".equals(it.getValue())).isPresent(); + && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> it.getValue().matches("route|superroute")).isPresent(); putValue(SHORT_DESCRIPTION, ( newEnabledState From e3ff05906d4f64a183ad7433143800f11f349e20 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 26 Aug 2020 12:22:31 +0200 Subject: [PATCH 06/52] The relation wasn't added if member 1-... were selected, so if the first member was part of the selection. I took away the condition. Needs more testing. --- .../actions/ExtractRelationMembersToNewRelationAction.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 0e89b593..e6832e96 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -65,9 +65,8 @@ public void actionPerformed(ActionEvent actionEvent) { } UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); - if (index > 0) { - newRelation.addMember(index, new RelationMember("", extractedRelation)); - } + newRelation.addMember(index, new RelationMember("", extractedRelation)); + UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, newRelation)); editorAccess.getEditor().reloadDataFromRelation(); RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); From 7616d426cf26a7b82f01f0416318e755bf6c6c86 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 26 Aug 2020 14:37:01 +0200 Subject: [PATCH 07/52] refactored to extract the methods that do the work. I may want to use this for other purposes as well. --- ...actRelationMembersToNewRelationAction.java | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index e6832e96..a0082c7f 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -10,7 +10,6 @@ import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; -import org.openstreetmap.josm.gui.MainApplication; import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; @@ -49,30 +48,39 @@ public void actionPerformed(ActionEvent actionEvent) { JOptionPane.QUESTION_MESSAGE ) == JOptionPane.OK_OPTION ) { - final Relation extractedRelation = new Relation(); - extractedRelation.setKeys(tags); - extractedRelation.put("type", "route"); - - final Relation newRelation = new Relation(originalRelation); - List members = newRelation.getMembers(); - int[] selectedIndices = memberTableModel.getSelectedIndices(); - int index = 0; - for (int i = selectedIndices.length-1; i >= 0; i--) { - index = selectedIndices[i]; - RelationMember member = members.get(index); - extractedRelation.addMember(0, member); - newRelation.removeMember(index); - } - UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); - - newRelation.addMember(index, new RelationMember("", extractedRelation)); - - UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, newRelation)); + final Relation extractedRelation = extractMembersToRouteRelationAndSubstituteThem(originalRelation, memberTableModel, tags); editorAccess.getEditor().reloadDataFromRelation(); RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); } } + public Relation extractMembersToRouteRelationAndSubstituteThem(Relation originalRelation, MemberTableModel memberTableModel, Map tags) { + int[] selectedIndices = memberTableModel.getSelectedIndices(); + return extractMembersForIndicesAndSubstitute(originalRelation, selectedIndices, tags); + } + + public Relation extractMembersForIndicesAndSubstitute(Relation originalRelation, int[] selectedIndices, Map tags) { + final Relation extractedRelation = new Relation(); + extractedRelation.setKeys(tags); + extractedRelation.put("type", "route"); + + final Relation newRelation = new Relation(originalRelation); + List members = newRelation.getMembers(); + int index = 0; + for (int i = selectedIndices.length-1; i >= 0; i--) { + index = selectedIndices[i]; + RelationMember member = members.get(index); + extractedRelation.addMember(0, member); + newRelation.removeMember(index); + } + UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); + + newRelation.addMember(index, new RelationMember("", extractedRelation)); + + UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, newRelation)); + return extractedRelation; + } + @Override public boolean isExpertOnly() { return true; From 4d1af91bb7f200082eb7d7ed783c93bff0051de5 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 26 Aug 2020 14:37:54 +0200 Subject: [PATCH 08/52] renamed bus.png to bus. It's not a bus.svg, which is detected automatically if no file extension is given. --- .../customizepublictransportstop/CustomizeStopAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/customizepublictransportstop/CustomizeStopAction.java b/src/main/java/org/openstreetmap/josm/plugins/customizepublictransportstop/CustomizeStopAction.java index ea4176e4..16896d9d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/customizepublictransportstop/CustomizeStopAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/customizepublictransportstop/CustomizeStopAction.java @@ -45,7 +45,7 @@ public static CustomizeStopAction createCustomizeStopAction() { // CHECKSTYLE.OFF: LineLength CustomizeStopAction action = new CustomizeStopAction( tr("Customize stop"), - "bus.png", + "bus", tr("Customize stop under osm public transit standard v2"), Shortcut.registerShortcut("tools:customizestop", tr("Tool: {0}", tr("Customize stop")), KeyEvent.VK_U, Shortcut.DIRECT), true From eca82d5662a9381c60bfd3fa19260b8d797134b4 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Thu, 27 Aug 2020 12:51:30 +0200 Subject: [PATCH 09/52] refactored, it works OK most of the time, but when extracting from a Relation Editor that contains a sequence of ways that was extracted itself, it usually causes an exception. --- ...actRelationMembersToNewRelationAction.java | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index a0082c7f..4dc4ee73 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -8,6 +8,7 @@ import org.openstreetmap.josm.command.AddCommand; import org.openstreetmap.josm.command.ChangeCommand; import org.openstreetmap.josm.data.UndoRedoHandler; +import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; @@ -20,9 +21,18 @@ import static org.openstreetmap.josm.gui.MainApplication.*; +/* +Extracts selected members to a new route relation +and substitutes them with this new route relation +in the original relation + + * @author Florian, Polyglot + */ public class ExtractRelationMembersToNewRelationAction extends AbstractRelationEditorAction { public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess editorAccess) { - super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.TAG_CHANGE); + super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION, + IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, + IRelationEditorUpdateOn.TAG_CHANGE); new ImageProvider("bus").getResource().attachImageIcon(this); } @@ -30,38 +40,37 @@ public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess edi public void actionPerformed(ActionEvent actionEvent) { final MemberTableModel memberTableModel = editorAccess.getMemberTableModel(); final Collection selectedMembers = memberTableModel.getSelectedMembers(); - final Map tags = editorAccess.getTagModel().getTags(); final Relation originalRelation = editorAccess.getEditor().getRelation(); - if ( JOptionPane.showConfirmDialog( getMemberTable(), I18n.tr( - "Do you really want to create a new relation from the {0} selected members of relation {1}, copying the {2} tags to the new relation?", + "Do you really want to create a new relation from the {0} selected members of relation {1}?", selectedMembers.size(), - getEditor().getRelation().getId(), - tags.size() + getEditor().getRelation().getId() ), I18n.tr("Extract part from relation?"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE ) == JOptionPane.OK_OPTION ) { - final Relation extractedRelation = extractMembersToRouteRelationAndSubstituteThem(originalRelation, memberTableModel, tags); + final Relation extractedRelation = extractMembersToRouteRelationAndSubstituteThem(originalRelation, memberTableModel); editorAccess.getEditor().reloadDataFromRelation(); RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); } } - public Relation extractMembersToRouteRelationAndSubstituteThem(Relation originalRelation, MemberTableModel memberTableModel, Map tags) { + public Relation extractMembersToRouteRelationAndSubstituteThem(Relation originalRelation, + MemberTableModel memberTableModel) { int[] selectedIndices = memberTableModel.getSelectedIndices(); - return extractMembersForIndicesAndSubstitute(originalRelation, selectedIndices, tags); + return extractMembersForIndicesAndSubstitute(originalRelation, selectedIndices); } - public Relation extractMembersForIndicesAndSubstitute(Relation originalRelation, int[] selectedIndices, Map tags) { + public Relation extractMembersForIndicesAndSubstitute(Relation originalRelation, + int[] selectedIndices) { final Relation extractedRelation = new Relation(); - extractedRelation.setKeys(tags); + extractedRelation.setKeys(originalRelation.getKeys()); extractedRelation.put("type", "route"); final Relation newRelation = new Relation(originalRelation); @@ -69,15 +78,18 @@ public Relation extractMembersForIndicesAndSubstitute(Relation originalRelation, int index = 0; for (int i = selectedIndices.length-1; i >= 0; i--) { index = selectedIndices[i]; - RelationMember member = members.get(index); - extractedRelation.addMember(0, member); - newRelation.removeMember(index); + RelationMember relationMember = newRelation.removeMember(index); + extractedRelation.addMember(0, relationMember); } - UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); + DataSet activeDataSet = getLayerManager().getActiveDataSet(); + UndoRedoHandler.getInstance() + .add(new AddCommand(activeDataSet, extractedRelation)); - newRelation.addMember(index, new RelationMember("", extractedRelation)); + newRelation.addMember(index, + new RelationMember("", extractedRelation)); - UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, newRelation)); + UndoRedoHandler.getInstance() + .add(new ChangeCommand(originalRelation, newRelation)); return extractedRelation; } From 92e1bab7d390329b060038abb179a7ec797705ac Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Tue, 8 Sep 2020 02:48:59 +0200 Subject: [PATCH 10/52] Sometimes there is an exception. What I find odd is that this happens when editor.reloadDataFromRelation(); is executed, not when I'm mangling the cloned relation and not when performing the commands by passing them to the undoRedoHandler --- ...actRelationMembersToNewRelationAction.java | 101 +++++++++++++----- 1 file changed, 74 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 4dc4ee73..578c1306 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -3,14 +3,17 @@ import java.awt.event.ActionEvent; import java.util.*; -import javax.swing.JOptionPane; +import javax.swing.*; import org.openstreetmap.josm.command.AddCommand; import org.openstreetmap.josm.command.ChangeCommand; +import org.openstreetmap.josm.command.Command; +import org.openstreetmap.josm.command.SequenceCommand; import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; @@ -18,6 +21,7 @@ import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; import org.openstreetmap.josm.tools.I18n; import org.openstreetmap.josm.tools.ImageProvider; +import org.openstreetmap.josm.tools.Logging; import static org.openstreetmap.josm.gui.MainApplication.*; @@ -39,58 +43,101 @@ public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess edi @Override public void actionPerformed(ActionEvent actionEvent) { final MemberTableModel memberTableModel = editorAccess.getMemberTableModel(); + IRelationEditor editor = editorAccess.getEditor(); + final Relation originalRelation = editor.getRelation(); + + // save the current state, otherwise accidents happen + memberTableModel.applyToRelation(originalRelation); + // todo unfortunately there are still index out of bounds exceptions happening + final Collection selectedMembers = memberTableModel.getSelectedMembers(); - final Relation originalRelation = editorAccess.getEditor().getRelation(); + List commands = new ArrayList<>(); + + String title = I18n.tr("Extract part from relation?"); + String question = I18n.tr( + "Do you want to create a new relation with the {0} selected members?", + selectedMembers.size() + ); + final JCheckBox cbConvertToSuperroute = new JCheckBox(I18n.tr("Convert to superroute")); + final JCheckBox cbProposed = new JCheckBox(I18n.tr("subrelation is proposed")); + final JCheckBox cbDeviation = new JCheckBox(I18n.tr("subrelation is deviation")); + final JTextField tfNameTag = new JTextField(getEditor().getRelation().get("name")); + Object[] params = {question, tfNameTag, cbConvertToSuperroute, cbProposed, cbDeviation}; if ( JOptionPane.showConfirmDialog( getMemberTable(), - I18n.tr( - "Do you really want to create a new relation from the {0} selected members of relation {1}?", - selectedMembers.size(), - getEditor().getRelation().getId() - ), - I18n.tr("Extract part from relation?"), + params, + title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE ) == JOptionPane.OK_OPTION ) { - final Relation extractedRelation = extractMembersToRouteRelationAndSubstituteThem(originalRelation, memberTableModel); - editorAccess.getEditor().reloadDataFromRelation(); - RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).setVisible(true); + final Relation clonedRelation = new Relation(originalRelation); + final Relation extractedRelation = extractMembersToRouteRelationAndSubstituteThem(clonedRelation, memberTableModel); + if (extractedRelation != null) { + if (cbConvertToSuperroute.isSelected()) { + clonedRelation.put("type", "superroute"); + } + extractedRelation.put("name", tfNameTag.getText()); + if (cbProposed.isSelected()) { + extractedRelation.put("state", "proposed"); + extractedRelation.put("name", tfNameTag.getText() + " (wenslijn)"); + } + if (cbDeviation.isSelected()) { + extractedRelation.put("name", tfNameTag.getText() + " (omleiding)"); + } + DataSet activeDataSet = getLayerManager().getActiveDataSet(); + commands.add(new AddCommand(activeDataSet, extractedRelation)); + commands.add(new ChangeCommand(originalRelation, clonedRelation)); + UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); + RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).toFront(); + try { + editor.reloadDataFromRelation(); + // todo this often give index out of bounds exception + // I can't figure out why. + // catching it here causes the exception to occur when + // the user presses the update button, so not really a solution + // The update button appears if I remove 1 or 2 members before extracting + // so when the relation editor is 'dirty'. + // using memberTableModel.applyToRelation(originalRelation); + // at the beginning doesn't seem to actually save the relation + } catch (Exception e) { + Logging.error(e); + } + } } } - public Relation extractMembersToRouteRelationAndSubstituteThem(Relation originalRelation, + public Relation extractMembersToRouteRelationAndSubstituteThem(Relation clonedRelation, MemberTableModel memberTableModel) { int[] selectedIndices = memberTableModel.getSelectedIndices(); - return extractMembersForIndicesAndSubstitute(originalRelation, selectedIndices); + return extractMembersForIndicesAndSubstitute(clonedRelation, selectedIndices); } - public Relation extractMembersForIndicesAndSubstitute(Relation originalRelation, + public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, int[] selectedIndices) { final Relation extractedRelation = new Relation(); - extractedRelation.setKeys(originalRelation.getKeys()); + extractedRelation.setKeys(clonedRelation.getKeys()); extractedRelation.put("type", "route"); - final Relation newRelation = new Relation(originalRelation); - List members = newRelation.getMembers(); int index = 0; + boolean atLeast1MemberAddedToExtractedRelation = false; for (int i = selectedIndices.length-1; i >= 0; i--) { + atLeast1MemberAddedToExtractedRelation = true; index = selectedIndices[i]; - RelationMember relationMember = newRelation.removeMember(index); + RelationMember relationMember = clonedRelation.removeMember(index); extractedRelation.addMember(0, relationMember); } - DataSet activeDataSet = getLayerManager().getActiveDataSet(); - UndoRedoHandler.getInstance() - .add(new AddCommand(activeDataSet, extractedRelation)); - newRelation.addMember(index, - new RelationMember("", extractedRelation)); - - UndoRedoHandler.getInstance() - .add(new ChangeCommand(originalRelation, newRelation)); - return extractedRelation; + if (atLeast1MemberAddedToExtractedRelation) { + // replace removed members with the extracted relation + clonedRelation.addMember(index, + new RelationMember("", extractedRelation)); + return extractedRelation; + } else { + return null; + } } @Override From 0d4b9d993fcbf4fb88564ac8eb1b861e22eaa9d8 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 9 Sep 2020 18:27:20 +0200 Subject: [PATCH 11/52] If the route relation that is divide into 2 route relations is already a member or superroute relations, the extracted relation most likely needs to be added to those superroute relations. So an extra option is added with the checkbox checked. It only appears when the circumstances are right for it. --- ...actRelationMembersToNewRelationAction.java | 266 +++++++++++++----- 1 file changed, 203 insertions(+), 63 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 578c1306..390f099a 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -2,6 +2,7 @@ import java.awt.event.ActionEvent; import java.util.*; +import java.util.stream.Collectors; import javax.swing.*; @@ -10,19 +11,19 @@ import org.openstreetmap.josm.command.Command; import org.openstreetmap.josm.command.SequenceCommand; import org.openstreetmap.josm.data.UndoRedoHandler; -import org.openstreetmap.josm.data.osm.DataSet; -import org.openstreetmap.josm.data.osm.Relation; -import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.data.osm.*; import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; -import org.openstreetmap.josm.tools.I18n; -import org.openstreetmap.josm.tools.ImageProvider; -import org.openstreetmap.josm.tools.Logging; +import org.openstreetmap.josm.plugins.pt_assistant.data.PTStop; +import org.openstreetmap.josm.plugins.pt_assistant.data.PTWay; +import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; +import org.openstreetmap.josm.tools.*; +import static java.util.Collections.*; import static org.openstreetmap.josm.gui.MainApplication.*; /* @@ -35,8 +36,8 @@ public class ExtractRelationMembersToNewRelationAction extends AbstractRelationEditorAction { public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess editorAccess) { super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION, - IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, - IRelationEditorUpdateOn.TAG_CHANGE); + IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, + IRelationEditorUpdateOn.TAG_CHANGE); new ImageProvider("bus").getResource().attachImageIcon(this); } @@ -45,10 +46,11 @@ public void actionPerformed(ActionEvent actionEvent) { final MemberTableModel memberTableModel = editorAccess.getMemberTableModel(); IRelationEditor editor = editorAccess.getEditor(); final Relation originalRelation = editor.getRelation(); - + Relation editedRelation = new Relation(originalRelation); // save the current state, otherwise accidents happen - memberTableModel.applyToRelation(originalRelation); - // todo unfortunately there are still index out of bounds exceptions happening + memberTableModel.applyToRelation(editedRelation); + editorAccess.getTagModel().applyToPrimitive(editedRelation); + UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, editedRelation)); final Collection selectedMembers = memberTableModel.getSelectedMembers(); @@ -59,11 +61,39 @@ public void actionPerformed(ActionEvent actionEvent) { "Do you want to create a new relation with the {0} selected members?", selectedMembers.size() ); - final JCheckBox cbConvertToSuperroute = new JCheckBox(I18n.tr("Convert to superroute")); - final JCheckBox cbProposed = new JCheckBox(I18n.tr("subrelation is proposed")); - final JCheckBox cbDeviation = new JCheckBox(I18n.tr("subrelation is deviation")); + List parentRelations = new ArrayList<>(Utils.filteredCollection(originalRelation.getReferrers(), Relation.class)); + parentRelations.removeIf(parentRelation -> !Objects.equals(parentRelation.get("type"), "superroute")); + final int numberOfParentRelations = parentRelations.size(); + final JCheckBox cbReplaceInSuperrouteRelations = new JCheckBox(I18n.tr( + "This route is a member of {0} superroute {1}, add the extracted relation there instead of in this relation?", + numberOfParentRelations, + I18n.trn("relation", "relations", numberOfParentRelations))); + final JCheckBox cbConvertToSuperroute = new JCheckBox(I18n.tr("Convert this relation to superroute")); + final JCheckBox cbProposed = new JCheckBox(I18n.tr("subrelation is proposed (wenslijn)")); + final JCheckBox cbDeviation = new JCheckBox(I18n.tr("subrelation is deviation (omleiding)")); + final JCheckBox cbFindAllSegmentsAutomatically = new JCheckBox(I18n.tr("Process complete route relation for segments and extract into multiple sub route relations")); final JTextField tfNameTag = new JTextField(getEditor().getRelation().get("name")); - Object[] params = {question, tfNameTag, cbConvertToSuperroute, cbProposed, cbDeviation}; + ArrayList paramsList = new ArrayList<>(); + paramsList.add(question); + paramsList.add(tfNameTag); + // Only show cbReplaceInSuperrouteRelations when it's relevant + if (numberOfParentRelations > 0) { + // check the check box + cbReplaceInSuperrouteRelations.setSelected(true); + paramsList.add(cbReplaceInSuperrouteRelations); + } + if (originalRelation.hasTag("cycle_network", "cycle_highway")) { + paramsList.add(cbDeviation); + paramsList.add(cbProposed); + } + paramsList.add(cbConvertToSuperroute); + if (RouteUtils.isVersionTwoPTRoute(originalRelation)) { + cbConvertToSuperroute.setSelected(true); + cbFindAllSegmentsAutomatically.setSelected(true); + paramsList.add(cbFindAllSegmentsAutomatically); + } + paramsList.add(cbConvertToSuperroute); + Object[] params = paramsList.toArray(new Object[paramsList.size()]); if ( JOptionPane.showConfirmDialog( getMemberTable(), @@ -73,70 +103,179 @@ public void actionPerformed(ActionEvent actionEvent) { JOptionPane.QUESTION_MESSAGE ) == JOptionPane.OK_OPTION ) { - final Relation clonedRelation = new Relation(originalRelation); - final Relation extractedRelation = extractMembersToRouteRelationAndSubstituteThem(clonedRelation, memberTableModel); - if (extractedRelation != null) { - if (cbConvertToSuperroute.isSelected()) { - clonedRelation.put("type", "superroute"); - } - extractedRelation.put("name", tfNameTag.getText()); - if (cbProposed.isSelected()) { - extractedRelation.put("state", "proposed"); - extractedRelation.put("name", tfNameTag.getText() + " (wenslijn)"); - } - if (cbDeviation.isSelected()) { - extractedRelation.put("name", tfNameTag.getText() + " (omleiding)"); + if (!cbFindAllSegmentsAutomatically.isSelected()) { + final Relation clonedRelation = new Relation(originalRelation); + boolean substituteWaysWithRelation = !cbReplaceInSuperrouteRelations.isSelected(); + List selectedIndices = Arrays.stream(memberTableModel.getSelectedIndices()) + .boxed().collect(Collectors.toList()); + final Relation extractedRelation = extractMembersForIndicesAndSubstitute( + clonedRelation, selectedIndices, substituteWaysWithRelation); + if (extractedRelation != null) { + if (cbConvertToSuperroute.isSelected()) { + clonedRelation.put("type", "superroute"); + } + extractedRelation.put("name", tfNameTag.getText()); + if (cbProposed.isSelected()) { + extractedRelation.put("state", "proposed"); + extractedRelation.put("name", tfNameTag.getText() + " (wenslijn)"); + } + if (cbDeviation.isSelected()) { + extractedRelation.put("name", tfNameTag.getText() + " (omleiding)"); + } + DataSet activeDataSet = getLayerManager().getActiveDataSet(); + commands.add(new AddCommand(activeDataSet, extractedRelation)); + commands.add(new ChangeCommand(originalRelation, clonedRelation)); + addExtractedRelationToParentSuperrouteRelations(originalRelation, commands, parentRelations, selectedIndices, extractedRelation); + UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); + RelationEditor extraEditor = RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, emptyList()); + extraEditor.setVisible(true); + extraEditor.setAlwaysOnTop(true); + + try { + editor.reloadDataFromRelation(); + // todo this often gives index out of bounds exception + // I can't figure out why. + // catching it here causes the exception to occur when + // the user presses the update button, so not really a solution + // The update button appears if I remove 1 or 2 members before extracting + // so when the relation editor is 'dirty'. + // using memberTableModel.applyToRelation(originalRelation); + // at the beginning doesn't seem to actually save the relation + } catch (Exception e) { + Logging.error(e); + } } + } else { + final Relation clonedRelation = new Relation(originalRelation); DataSet activeDataSet = getLayerManager().getActiveDataSet(); - commands.add(new AddCommand(activeDataSet, extractedRelation)); + String previousLineIdentifiersSignature = ""; + List selectedIndices = new ArrayList<>(); + List members = clonedRelation.getMembers(); + List streetNamesList = new ArrayList<>(); + for (int i = members.size()-1; i>=0; i--) { + RelationMember rm = members.get(i); + if (rm.getType().equals(OsmPrimitiveType.WAY)) { + final Way rmWay = rm.getWay(); + List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(rmWay.getReferrers(), Relation.class)); + List lineIdentifiersList = new ArrayList<>(); + for (Relation pr : parentRouteRelations) { + final String ref = pr.get("ref"); + if (ref != null && !lineIdentifiersList.contains(ref)) { + lineIdentifiersList.add(ref); + } + } + sort(lineIdentifiersList); + String lineIdentifiersSignature = String.join(";", lineIdentifiersList); + + String streetName = rmWay.get("name"); + if (streetName == null) { + streetName = rmWay.get("ref"); + } + // check if we need to start a new segment + if (!lineIdentifiersSignature.equals(previousLineIdentifiersSignature)) { + if (!"".equals(previousLineIdentifiersSignature)) { + // todo check if a similar sub route relation already exists + String streetNamesSignature = String.join(";", streetNamesList); + Relation extractedRelation = extractMembersForIndicesAndSubstitute( + clonedRelation, selectedIndices, true); + if (extractedRelation != null) { + if (!streetNamesSignature.isEmpty()) { + extractedRelation.put("street_names", streetNamesSignature); + } + String fromToStreet = ""; + if (streetNamesList.size() > 0) { + fromToStreet = streetNamesList.get(0).concat(" "); + if (streetNamesList.size() > 1) { + fromToStreet = String.format("%s- %s ", fromToStreet, streetNamesList.get(streetNamesList.size() - 1)); + } + } + String name = String.format("%s(%s)",fromToStreet, previousLineIdentifiersSignature); + extractedRelation.put("name", name); + extractedRelation.put("route_ref", previousLineIdentifiersSignature); + extractedRelation.remove("bus"); + extractedRelation.remove("colour"); + extractedRelation.remove("from"); + extractedRelation.remove("network"); + extractedRelation.remove("network:wikidata"); + extractedRelation.remove("operator"); + extractedRelation.remove("operator:wikidata"); + extractedRelation.remove("ref"); + extractedRelation.remove("to"); + extractedRelation.remove("via"); + extractedRelation.remove("wikidata"); + commands.add(new AddCommand(activeDataSet, extractedRelation)); + RelationEditor extraEditor = RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, emptyList()); + extraEditor.setVisible(true); + // extraEditor.setAlwaysOnTop(true); + } + streetNamesList = new ArrayList<>(); + selectedIndices = new ArrayList<>(); + } + previousLineIdentifiersSignature = lineIdentifiersSignature; + } + if (streetName != null && !streetNamesList.contains(streetName)) { + streetNamesList.add(0,streetName); + } + selectedIndices.add(0,i); + } + } commands.add(new ChangeCommand(originalRelation, clonedRelation)); UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); - RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, Collections.emptyList()).toFront(); - try { - editor.reloadDataFromRelation(); - // todo this often give index out of bounds exception - // I can't figure out why. - // catching it here causes the exception to occur when - // the user presses the update button, so not really a solution - // The update button appears if I remove 1 or 2 members before extracting - // so when the relation editor is 'dirty'. - // using memberTableModel.applyToRelation(originalRelation); - // at the beginning doesn't seem to actually save the relation - } catch (Exception e) { - Logging.error(e); - } } } } - public Relation extractMembersToRouteRelationAndSubstituteThem(Relation clonedRelation, - MemberTableModel memberTableModel) { - int[] selectedIndices = memberTableModel.getSelectedIndices(); - return extractMembersForIndicesAndSubstitute(clonedRelation, selectedIndices); - } - public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, - int[] selectedIndices) { + List selectedIndices, + boolean substituteWaysWithRelation) { final Relation extractedRelation = new Relation(); extractedRelation.setKeys(clonedRelation.getKeys()); extractedRelation.put("type", "route"); int index = 0; boolean atLeast1MemberAddedToExtractedRelation = false; - for (int i = selectedIndices.length-1; i >= 0; i--) { + for (int i = selectedIndices.size() - 1; i >= 0; i--) { atLeast1MemberAddedToExtractedRelation = true; - index = selectedIndices[i]; + index = selectedIndices.get(i); RelationMember relationMember = clonedRelation.removeMember(index); extractedRelation.addMember(0, relationMember); } if (atLeast1MemberAddedToExtractedRelation) { - // replace removed members with the extracted relation - clonedRelation.addMember(index, - new RelationMember("", extractedRelation)); - return extractedRelation; - } else { - return null; + if (substituteWaysWithRelation) { + // replace removed members with the extracted relation + if (index >= clonedRelation.getMembersCount()) { + index = clonedRelation.getMembersCount() - 1; + } + clonedRelation.addMember(index, new RelationMember("", extractedRelation)); + } + } else { + return null; + } + return extractedRelation; + } + + private void addExtractedRelationToParentSuperrouteRelations(Relation originalRelation, List commands, List parentRelations, List selectedIndices, Relation extractedRelation) { + for (Relation superroute : parentRelations) { + int index = 0; + for (RelationMember member : superroute.getMembers()) { + if (member.getMember().getId() == originalRelation.getId()) { + Relation clonedParentRelation = new Relation(superroute); + if (selectedIndices.get(0) != 0) { + // if the user selected a block that didn't start with + // the first member, add the extracted relation after + // the position where this relation was in the parent + index++; + } + if (index >= superroute.getMembersCount()) { + index = superroute.getMembersCount()-1; + } + clonedParentRelation.addMember(index, new RelationMember("", extractedRelation)); + commands.add(new ChangeCommand(superroute, clonedParentRelation)); + break; + } + index++; + } } } @@ -149,12 +288,13 @@ public boolean isExpertOnly() { protected void updateEnabledState() { final boolean newEnabledState = !editorAccess.getSelectionTableModel().getSelection().isEmpty() && Optional.ofNullable(editorAccess.getTagModel().get("type")).filter(it -> it.getValue().matches("route|superroute")).isPresent(); + // && !editorAccess.getEditor().isDirtyRelation(); // This seems to cause a problem - putValue(SHORT_DESCRIPTION, ( - newEnabledState - ? I18n.tr("Extract part of the route into new relation") - : I18n.tr("Extract into new relation (needs type=route tag and at least one selected relation member)") - )); + if (newEnabledState) { + putValue(SHORT_DESCRIPTION, I18n.tr("Extract selected part of the route into new relation")); + } else { + putValue(SHORT_DESCRIPTION, I18n.tr("Extract into new relation (needs type=route/superroute tag and at least one selected relation member)")); + } setEnabled(newEnabledState); } } From 10955a9b11f3752e3fa18bbb966fb2f8e2791929 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Tue, 15 Sep 2020 13:43:31 +0200 Subject: [PATCH 12/52] It worked almost the way I wanted it at some point. Trying to iron out the last bugs, created a lot more complexity. I'm saving this snapshot and then I'll do lots of undo. --- ...actRelationMembersToNewRelationAction.java | 331 ++++++++++++++---- 1 file changed, 262 insertions(+), 69 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 390f099a..ddc75af5 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -18,8 +18,6 @@ import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; -import org.openstreetmap.josm.plugins.pt_assistant.data.PTStop; -import org.openstreetmap.josm.plugins.pt_assistant.data.PTWay; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import org.openstreetmap.josm.tools.*; @@ -111,19 +109,21 @@ public void actionPerformed(ActionEvent actionEvent) { final Relation extractedRelation = extractMembersForIndicesAndSubstitute( clonedRelation, selectedIndices, substituteWaysWithRelation); if (extractedRelation != null) { - if (cbConvertToSuperroute.isSelected()) { - clonedRelation.put("type", "superroute"); - } - extractedRelation.put("name", tfNameTag.getText()); - if (cbProposed.isSelected()) { - extractedRelation.put("state", "proposed"); - extractedRelation.put("name", tfNameTag.getText() + " (wenslijn)"); - } - if (cbDeviation.isSelected()) { - extractedRelation.put("name", tfNameTag.getText() + " (omleiding)"); + if (extractedRelation.getId() <= 0) { + if (cbConvertToSuperroute.isSelected()) { + clonedRelation.put("type", "superroute"); + } + extractedRelation.put("name", tfNameTag.getText()); + if (cbProposed.isSelected()) { + extractedRelation.put("state", "proposed"); + extractedRelation.put("name", tfNameTag.getText() + " (wenslijn)"); + } + if (cbDeviation.isSelected()) { + extractedRelation.put("name", tfNameTag.getText() + " (omleiding)"); + } + DataSet activeDataSet = getLayerManager().getActiveDataSet(); + commands.add(new AddCommand(activeDataSet, extractedRelation)); } - DataSet activeDataSet = getLayerManager().getActiveDataSet(); - commands.add(new AddCommand(activeDataSet, extractedRelation)); commands.add(new ChangeCommand(originalRelation, clonedRelation)); addExtractedRelationToParentSuperrouteRelations(originalRelation, commands, parentRelations, selectedIndices, extractedRelation); UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); @@ -149,19 +149,104 @@ public void actionPerformed(ActionEvent actionEvent) { final Relation clonedRelation = new Relation(originalRelation); DataSet activeDataSet = getLayerManager().getActiveDataSet(); String previousLineIdentifiersSignature = ""; - List selectedIndices = new ArrayList<>(); List members = clonedRelation.getMembers(); List streetNamesList = new ArrayList<>(); + List selectedIndices = new ArrayList<>(); + Way nextWay = new Way(); + boolean startNewSegment = false; + boolean firstWayWasReached = false; for (int i = members.size()-1; i>=0; i--) { RelationMember rm = members.get(i); - if (rm.getType().equals(OsmPrimitiveType.WAY)) { + selectedIndices.add(0, i); + if (RouteUtils.isPTWay(rm)) { final Way rmWay = rm.getWay(); List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(rmWay.getReferrers(), Relation.class)); List lineIdentifiersList = new ArrayList<>(); + String ref = clonedRelation.get("ref"); + if (ref != null) { + lineIdentifiersList.add(ref); + } + startNewSegment = false; + if (i==0) { + // make sure we process the last segment + // since we're working backwards, it's actually the first segment + startNewSegment = true; + } else { + // also make sure to reset startNewSegment flag + + } for (Relation pr : parentRouteRelations) { - final String ref = pr.get("ref"); - if (ref != null && !lineIdentifiersList.contains(ref)) { - lineIdentifiersList.add(ref); + if (RouteUtils.isVersionTwoPTRoute(pr) && pr.getId() != clonedRelation.getId()) { + // todo code is needed to detect way sequences that are in the route relation twice + List> prevAndNext = findPreviousAndNextWayInRoute(pr.getMembers(), rmWay); + Way previousWayInParentRoute = null; + Way nextWayInParentRoute = null; + for (int j=prevAndNext.size()-1; j>0; j--) { +// if (j pan = prevAndNext.get(j); + previousWayInParentRoute = pan.a; + nextWayInParentRoute = pan.b; + + /* + We are not interested in route relations that describe vehicles + traveling in the opposite direction + */ + Way previousWay = findPreviousWay(members, i); + String currentWayName = rmWay.get("name"); + String previousWayName = previousWay.get("name"); + String previousWayInParentName = previousWayInParentRoute.get("name"); + if (nextWayInParentRoute != null) { + String nextWayInParentName = nextWayInParentRoute.get("name"); + } + String nextWayName = nextWay.get("name"); + if (currentWayName == "006 Burchtstraat") { + currentWayName = rmWay.get("name"); + } + final long previousWayId = previousWay.getId(); + if (nextWayInParentRoute != null && + (previousWayId == nextWayInParentRoute.getId() || + nextWay.getId() == previousWayInParentRoute.getId())) { + // this parent relation describes an itinerary in the opposite direction + // so we don't need it + } else { + if (!startNewSegment && previousWayId != previousWayInParentRoute.getId()) { + // if one of the parent relations has a different previous way + // it's time to start a new segment + startNewSegment = true; + } + // If the next way after the previous way's in one of the parent + // routes isn't the same as the way we're looking at right now + // a split is also needed + if (!startNewSegment) { + // no need to check for this if a new segment will be created anyway already + List parentRoutesOfPreviousWay = new ArrayList<>(Utils.filteredCollection(previousWay.getReferrers(), Relation.class)); + for (Relation prOfPreviousWay : parentRoutesOfPreviousWay) { + if (RouteUtils.isVersionTwoPTRoute(prOfPreviousWay)) { + List> prevAndNextParent = findPreviousAndNextWayInRoute(prOfPreviousWay.getMembers(), previousWay); + Way nextWayInParentRouteOfPreviousWay = null; + for (int k = prevAndNextParent.size()-1; k>0; k--) { +// if (k panParent = prevAndNext.get(k); + nextWayInParentRouteOfPreviousWay = panParent.b; + if (nextWayInParentRouteOfPreviousWay != null + && nextWayInParentRouteOfPreviousWay != rmWay) { + startNewSegment = true; + break; + } + } + } + } + } + String lineIdentifier = pr.get("ref"); + if (lineIdentifier != null && !lineIdentifiersList.contains(lineIdentifier)) { + lineIdentifiersList.add(lineIdentifier); + } + } + } } } sort(lineIdentifiersList); @@ -171,64 +256,135 @@ public void actionPerformed(ActionEvent actionEvent) { if (streetName == null) { streetName = rmWay.get("ref"); } - // check if we need to start a new segment - if (!lineIdentifiersSignature.equals(previousLineIdentifiersSignature)) { - if (!"".equals(previousLineIdentifiersSignature)) { - // todo check if a similar sub route relation already exists - String streetNamesSignature = String.join(";", streetNamesList); - Relation extractedRelation = extractMembersForIndicesAndSubstitute( - clonedRelation, selectedIndices, true); - if (extractedRelation != null) { - if (!streetNamesSignature.isEmpty()) { - extractedRelation.put("street_names", streetNamesSignature); - } - String fromToStreet = ""; - if (streetNamesList.size() > 0) { - fromToStreet = streetNamesList.get(0).concat(" "); - if (streetNamesList.size() > 1) { - fromToStreet = String.format("%s- %s ", fromToStreet, streetNamesList.get(streetNamesList.size() - 1)); - } - } - String name = String.format("%s(%s)",fromToStreet, previousLineIdentifiersSignature); - extractedRelation.put("name", name); - extractedRelation.put("route_ref", previousLineIdentifiersSignature); - extractedRelation.remove("bus"); - extractedRelation.remove("colour"); - extractedRelation.remove("from"); - extractedRelation.remove("network"); - extractedRelation.remove("network:wikidata"); - extractedRelation.remove("operator"); - extractedRelation.remove("operator:wikidata"); - extractedRelation.remove("ref"); - extractedRelation.remove("to"); - extractedRelation.remove("via"); - extractedRelation.remove("wikidata"); - commands.add(new AddCommand(activeDataSet, extractedRelation)); - RelationEditor extraEditor = RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, emptyList()); - extraEditor.setVisible(true); - // extraEditor.setAlwaysOnTop(true); - } - streetNamesList = new ArrayList<>(); - selectedIndices = new ArrayList<>(); + addStreetName(streetNamesList, streetName); + if (startNewSegment) { + ArrayList allButLastStreetNames = new ArrayList<>(); + for (int j = 0; j < streetNamesList.size()-1; j++) { + String element = streetNamesList.get(j); + allButLastStreetNames.add(element); + } + String streetNamesSignature = String.join(";", allButLastStreetNames); + Relation extractedRelation = extractMembersForIndicesAndSubstitute( + clonedRelation, selectedIndices, true); + if (extractedRelation != null && extractedRelation.getId() <= 0) { + updateTags(lineIdentifiersSignature, allButLastStreetNames, streetNamesSignature, extractedRelation); + commands.add(new AddCommand(activeDataSet, extractedRelation)); } - previousLineIdentifiersSignature = lineIdentifiersSignature; + String lastStreetName = ""; + if (streetNamesList.size()>0) { + lastStreetName = streetNamesList.get(0); // streetNamesList.size() - 1); + } + streetNamesList = new ArrayList<>(); + if (!"".equals(lastStreetName)) { + streetNamesList.add(lastStreetName); + } + selectedIndices = new ArrayList<>(); } - if (streetName != null && !streetNamesList.contains(streetName)) { - streetNamesList.add(0,streetName); + nextWay = rmWay; + if (firstWayWasReached == true) { + break; } - selectedIndices.add(0,i); + } else { + firstWayWasReached = true; } } commands.add(new ChangeCommand(originalRelation, clonedRelation)); UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); + editor.reloadDataFromRelation(); } } } + private Way findPreviousWay(List members, int i) { + if (i < 1) { + return new Way(); + } + final RelationMember potentialWayMember = members.get(i - 1); + if (potentialWayMember.isWay()) { + return potentialWayMember.getWay(); + } else { + return new Way(); + } +// Way previousWay; +// if (i < members.size() - 1 && members.get(i + 1).isWay()) { +// previousWay = members.get(i + 1).getWay(); +// } else { +// previousWay = new Way(); +// } +// return previousWay; + } + + private void addStreetName(List streetNamesList, String streetName) { + if (streetName != null && !streetNamesList.contains(streetName)) { + streetNamesList.add(0, streetName); + } + } + + private void updateTags(String previousLineIdentifiersSignature, List streetNamesList, String streetNamesSignature, Relation extractedRelation) { + if (!streetNamesSignature.isEmpty()) { + extractedRelation.put("street_names", streetNamesSignature); + } + String fromToStreet = ""; + if (streetNamesList.size() > 0) { + fromToStreet = streetNamesList.get(0).concat(" "); + if (streetNamesList.size() > 1) { + fromToStreet = String.format("%s- %s ", fromToStreet, streetNamesList.get(streetNamesList.size() - 1)); + } + } + String name = String.format("%s(%s)", fromToStreet, previousLineIdentifiersSignature); + extractedRelation.put("name", name); + extractedRelation.put("route_ref", previousLineIdentifiersSignature); + // todo make a list of the ones we want to keep and remove the others + extractedRelation.remove("bus"); + extractedRelation.remove("colour"); + extractedRelation.remove("from"); + extractedRelation.remove("network"); + extractedRelation.remove("network:wikidata"); + extractedRelation.remove("operator"); + extractedRelation.remove("operator:wikidata"); + extractedRelation.remove("ref"); + extractedRelation.remove("to"); + extractedRelation.remove("via"); + extractedRelation.remove("wikidata"); + } + + private List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + Way previousWay; + Way nextWay = null; + boolean foundWay = false; + List> pairsList = new ArrayList<>(); + for (int j = members.size() - 1; j >= 0; j--) { + RelationMember rm = members.get(j); + if (rm.isWay()) { + previousWay = rm.getWay(); + if (foundWay) { + pairsList.add(new Pair(previousWay,nextWay)); + nextWay = null; + foundWay = false; + continue; + } + if (previousWay.getId() == wayToLocate.getId()) { + foundWay = true; + } else { + nextWay = previousWay; + } + } + } + return pairsList; + } + /** This method modifies clonedRelation in place if substituteWaysWithRelation is true + * and if ways are extracted into a new relation + * It takes a list of (preferably) consecutive indices + * If there is already a relation with the same members in the same order + * it returns a pointer to that relation + * otherwise it returns a new relation with a negative id, + * which still needs to be added using addCommand()*/ + public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, List selectedIndices, boolean substituteWaysWithRelation) { - final Relation extractedRelation = new Relation(); + List> parentRouteRelationsCandidates = new ArrayList<>(); + Relation extractedRelation = new Relation(); extractedRelation.setKeys(clonedRelation.getKeys()); extractedRelation.put("type", "route"); @@ -239,14 +395,46 @@ public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, index = selectedIndices.get(i); RelationMember relationMember = clonedRelation.removeMember(index); extractedRelation.addMember(0, relationMember); + // check if a similar sub route relation already exists +// if (relationMember.getType().equals(OsmPrimitiveType.WAY)) { +// final Way rmWay = relationMember.getWay(); +// for (Pair candidateForRemoval : parentRouteRelationsCandidates) { +// if (candidateForRemoval.a > 1) { +// final RelationMember wayBefore = candidateForRemoval.b.getMember(candidateForRemoval.a - 1); +// parentRouteRelationsCandidates.remove(candidateForRemoval); +// if (wayBefore.isWay() && wayBefore.getWay().equals(rmWay)) { +// Pair candidate = Pair.create(candidateForRemoval.a -1, candidateForRemoval.b); +// parentRouteRelationsCandidates.add(candidate); +// } +// } +// } +// for (Relation wayParent : Utils.filteredCollection(rmWay.getReferrers(), Relation.class)) { +// if (!wayParent.equals(clonedRelation)) { +// final int indexInParent = wayParent.getMembersCount() - 1; +// final RelationMember wayParentMember = wayParent.getMember(indexInParent); +// if (wayParentMember.isWay()) { +// Way lastWayOfParent = wayParentMember.getWay(); +// if (rmWay.equals(lastWayOfParent)) { +// Pair candidate = Pair.create(indexInParent, wayParent); +// parentRouteRelationsCandidates.add(candidate); +// break; +// } +// } +// } +// } +// } + } + int membersCount = extractedRelation.getMembersCount(); + for (Pair candidate : parentRouteRelationsCandidates) { + if (membersCount == candidate.b.getMembersCount()) { + extractedRelation = candidate.b; + } } if (atLeast1MemberAddedToExtractedRelation) { if (substituteWaysWithRelation) { // replace removed members with the extracted relation - if (index >= clonedRelation.getMembersCount()) { - index = clonedRelation.getMembersCount() - 1; - } + index = limitIntegerTo(index, clonedRelation.getMembersCount()); clonedRelation.addMember(index, new RelationMember("", extractedRelation)); } } else { @@ -255,6 +443,13 @@ public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, return extractedRelation; } + private int limitIntegerTo(int index, int limit) { + if (index > limit) { + index = limit; + } + return index; + } + private void addExtractedRelationToParentSuperrouteRelations(Relation originalRelation, List commands, List parentRelations, List selectedIndices, Relation extractedRelation) { for (Relation superroute : parentRelations) { int index = 0; @@ -267,9 +462,7 @@ private void addExtractedRelationToParentSuperrouteRelations(Relation originalRe // the position where this relation was in the parent index++; } - if (index >= superroute.getMembersCount()) { - index = superroute.getMembersCount()-1; - } + index = limitIntegerTo(index, superroute.getMembersCount()); clonedParentRelation.addMember(index, new RelationMember("", extractedRelation)); commands.add(new ChangeCommand(superroute, clonedParentRelation)); break; From f96c6de042d8f97ac8be1b5ed6735178b0686ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Tue, 15 Sep 2020 18:01:07 +0200 Subject: [PATCH 13/52] Add custom icon for the extract relation action --- .../ExtractRelationMembersToNewRelationAction.java | 2 +- .../images/dialogs/relation/extract_relation.svg | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/images/dialogs/relation/extract_relation.svg diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index ddc75af5..73b6e468 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -36,7 +36,7 @@ public ExtractRelationMembersToNewRelationAction(IRelationEditorActionAccess edi super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.TAG_CHANGE); - new ImageProvider("bus").getResource().attachImageIcon(this); + new ImageProvider("dialogs/relation", "extract_relation").getResource().attachImageIcon(this); } @Override diff --git a/src/main/resources/images/dialogs/relation/extract_relation.svg b/src/main/resources/images/dialogs/relation/extract_relation.svg new file mode 100644 index 00000000..d1b814fe --- /dev/null +++ b/src/main/resources/images/dialogs/relation/extract_relation.svg @@ -0,0 +1,8 @@ + + + + + + + + From da27d281cd7b4efd9e1221451cb778af1c64ab6d Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Thu, 17 Sep 2020 17:46:51 +0200 Subject: [PATCH 14/52] I got it back to a point that I'm almost happy with the result. Some splits are not happening where I would expect them. Also, the first segment is not put into a separate relation. So it either stops too early, or it's not processing the last segment (they are processed backwards, to avoid problems with removing ways) It is still bugged by an index out of bounds exception. I created my very first Java Class! So quite proud of myself :-) I copied from Darya's code, so privyet, Darya! --- ...actRelationMembersToNewRelationAction.java | 344 +++++++++--------- .../pt_assistant/data/PTSegmentToExtract.java | 169 +++++++++ 2 files changed, 340 insertions(+), 173 deletions(-) create mode 100644 src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 73b6e468..6e5729b4 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -18,6 +18,7 @@ import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; +import org.openstreetmap.josm.plugins.pt_assistant.data.PTSegmentToExtract; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import org.openstreetmap.josm.tools.*; @@ -91,7 +92,7 @@ public void actionPerformed(ActionEvent actionEvent) { paramsList.add(cbFindAllSegmentsAutomatically); } paramsList.add(cbConvertToSuperroute); - Object[] params = paramsList.toArray(new Object[paramsList.size()]); + Object[] params = paramsList.toArray(new Object[0]); // paramsList.size()]); if ( JOptionPane.showConfirmDialog( getMemberTable(), @@ -146,194 +147,184 @@ public void actionPerformed(ActionEvent actionEvent) { } } } else { - final Relation clonedRelation = new Relation(originalRelation); - DataSet activeDataSet = getLayerManager().getActiveDataSet(); - String previousLineIdentifiersSignature = ""; - List members = clonedRelation.getMembers(); - List streetNamesList = new ArrayList<>(); - List selectedIndices = new ArrayList<>(); - Way nextWay = new Way(); - boolean startNewSegment = false; - boolean firstWayWasReached = false; - for (int i = members.size()-1; i>=0; i--) { - RelationMember rm = members.get(i); - selectedIndices.add(0, i); - if (RouteUtils.isPTWay(rm)) { - final Way rmWay = rm.getWay(); - List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(rmWay.getReferrers(), Relation.class)); - List lineIdentifiersList = new ArrayList<>(); - String ref = clonedRelation.get("ref"); - if (ref != null) { - lineIdentifiersList.add(ref); - } - startNewSegment = false; - if (i==0) { - // make sure we process the last segment - // since we're working backwards, it's actually the first segment - startNewSegment = true; - } else { - // also make sure to reset startNewSegment flag + splitInSegments(originalRelation); + editor.reloadDataFromRelation(); + } + } + } - } - for (Relation pr : parentRouteRelations) { - if (RouteUtils.isVersionTwoPTRoute(pr) && pr.getId() != clonedRelation.getId()) { - // todo code is needed to detect way sequences that are in the route relation twice - List> prevAndNext = findPreviousAndNextWayInRoute(pr.getMembers(), rmWay); - Way previousWayInParentRoute = null; - Way nextWayInParentRoute = null; - for (int j=prevAndNext.size()-1; j>0; j--) { -// if (j pan = prevAndNext.get(j); - previousWayInParentRoute = pan.a; - nextWayInParentRoute = pan.b; + public void splitInSegments(Relation originalRelation) { + final DataSet activeDataSet = getLayerManager().getActiveDataSet(); + final Relation clonedRelation = new Relation(originalRelation); + final long clonedRelationId = clonedRelation.getId(); + final List members = clonedRelation.getMembers(); + List segments = new ArrayList<>(); + RelationMember previousWayMember = null; + RelationMember currentWayMember = null; + RelationMember nextWayMember = null; + boolean startNewSegment = false; + PTSegmentToExtract segment = null; + for (int i = members.size()-1; i>=0; i--) { + RelationMember rm = members.get(i); + if (RouteUtils.isPTWay(rm)) { + previousWayMember = rm; + if (currentWayMember == null) { + currentWayMember = previousWayMember; + continue; + } else if (nextWayMember == null) { + nextWayMember = currentWayMember; + currentWayMember = previousWayMember; + segment = new PTSegmentToExtract(clonedRelation); + continue; + } + // now previousWayMember, currentWayMember and nextWayMember all have values + // how to decide whether currentWayMember is in the same segment as nextWayMember? + // it is if for all the parent route relations of currentWayMember + // that go in the same direction, the nextWayMember is the same as the nextWayMember of this route + // to exclude route that go in the opposite direction it's necessary to compare + // previousWayMember with their nextWayMember and nextWayMember with their previousWayMember + final Way previousWay = previousWayMember.getWay(); + final Way currentWay = currentWayMember.getWay(); + final Way nextWay = nextWayMember.getWay(); + List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(currentWay.getReferrers(), Relation.class)); + if (segment != null) { + segment.addPTWay(nextWayMember, i+2, + clonedRelation.get("ref"), clonedRelation.get("colour")); + } + if (startNewSegment) { + segments.add(segment); - /* - We are not interested in route relations that describe vehicles - traveling in the opposite direction - */ - Way previousWay = findPreviousWay(members, i); - String currentWayName = rmWay.get("name"); - String previousWayName = previousWay.get("name"); - String previousWayInParentName = previousWayInParentRoute.get("name"); - if (nextWayInParentRoute != null) { - String nextWayInParentName = nextWayInParentRoute.get("name"); - } - String nextWayName = nextWay.get("name"); - if (currentWayName == "006 Burchtstraat") { - currentWayName = rmWay.get("name"); - } - final long previousWayId = previousWay.getId(); - if (nextWayInParentRoute != null && - (previousWayId == nextWayInParentRoute.getId() || - nextWay.getId() == previousWayInParentRoute.getId())) { - // this parent relation describes an itinerary in the opposite direction - // so we don't need it - } else { - if (!startNewSegment && previousWayId != previousWayInParentRoute.getId()) { - // if one of the parent relations has a different previous way - // it's time to start a new segment - startNewSegment = true; - } - // If the next way after the previous way's in one of the parent - // routes isn't the same as the way we're looking at right now - // a split is also needed - if (!startNewSegment) { - // no need to check for this if a new segment will be created anyway already - List parentRoutesOfPreviousWay = new ArrayList<>(Utils.filteredCollection(previousWay.getReferrers(), Relation.class)); - for (Relation prOfPreviousWay : parentRoutesOfPreviousWay) { - if (RouteUtils.isVersionTwoPTRoute(prOfPreviousWay)) { - List> prevAndNextParent = findPreviousAndNextWayInRoute(prOfPreviousWay.getMembers(), previousWay); - Way nextWayInParentRouteOfPreviousWay = null; - for (int k = prevAndNextParent.size()-1; k>0; k--) { -// if (k panParent = prevAndNext.get(k); - nextWayInParentRouteOfPreviousWay = panParent.b; - if (nextWayInParentRouteOfPreviousWay != null - && nextWayInParentRouteOfPreviousWay != rmWay) { - startNewSegment = true; - break; - } - } - } - } - } - String lineIdentifier = pr.get("ref"); - if (lineIdentifier != null && !lineIdentifiersList.contains(lineIdentifier)) { - lineIdentifiersList.add(lineIdentifier); - } - } - } - } - } - sort(lineIdentifiersList); - String lineIdentifiersSignature = String.join(";", lineIdentifiersList); + Relation extractedRelation = extractMembersForIndicesAndSubstitute( + clonedRelation, segment.getIndices(), true); - String streetName = rmWay.get("name"); - if (streetName == null) { - streetName = rmWay.get("ref"); - } - addStreetName(streetNamesList, streetName); - if (startNewSegment) { - ArrayList allButLastStreetNames = new ArrayList<>(); - for (int j = 0; j < streetNamesList.size()-1; j++) { - String element = streetNamesList.get(j); - allButLastStreetNames.add(element); - } - String streetNamesSignature = String.join(";", allButLastStreetNames); - Relation extractedRelation = extractMembersForIndicesAndSubstitute( - clonedRelation, selectedIndices, true); - if (extractedRelation != null && extractedRelation.getId() <= 0) { - updateTags(lineIdentifiersSignature, allButLastStreetNames, streetNamesSignature, extractedRelation); - commands.add(new AddCommand(activeDataSet, extractedRelation)); + if (extractedRelation != null && extractedRelation.getId() <= 0) { + updateTags(segment.getLineIdentifiersSignature(), + segment.getFirstAndLastStreetNameOrRef(), + segment.getStreetNamesSignature(), + segment.getColoursSignature(), + extractedRelation); + UndoRedoHandler.getInstance().add(new AddCommand(activeDataSet, extractedRelation)); + } + segment = new PTSegmentToExtract(clonedRelation); + startNewSegment = false; + } + String previousWayName = previousWay.get("name"); + String currentWayName = currentWay.get("name"); + String nextWayName = nextWay.get("name"); + final long previousWayId = previousWay.getId(); + for (Relation parentRoute : parentRouteRelations) { + if (parentRoute.getId() != clonedRelationId && RouteUtils.isVersionTwoPTRoute(parentRoute)) { + List> prevAndNext = findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay); + Way previousWayInParentRoute = null; + Way nextWayInParentRoute = null; + for (int k = 0; k < prevAndNext.size(); k++) { + Pair wayPair = prevAndNext.get(k); + previousWayInParentRoute = wayPair.a; + nextWayInParentRoute = wayPair.b; + /* + We are not interested in route relations that describe vehicles + traveling in the opposite direction + */ + long previousWayInParentRouteId = 0; + if (previousWayInParentRoute != null) { + String previousWayInParentName = previousWayInParentRoute.get("name"); + previousWayInParentRouteId = previousWayInParentRoute.getId(); } - String lastStreetName = ""; - if (streetNamesList.size()>0) { - lastStreetName = streetNamesList.get(0); // streetNamesList.size() - 1); + if (nextWayInParentRoute != null) { + String nextWayInParentName = nextWayInParentRoute.get("name"); } - streetNamesList = new ArrayList<>(); - if (!"".equals(lastStreetName)) { - streetNamesList.add(lastStreetName); +// if (currentWayName == "006 Burchtstraat") { } + if (isItineraryInSameDirection(nextWay, nextWayInParentRoute, previousWayId, previousWayInParentRouteId)) { + if (!startNewSegment && + previousWayInParentRouteId != 0 && previousWayId != previousWayInParentRouteId) { + // if one of the parent relations has a different previous way + // it's time to start a new segment + startNewSegment = true; + } + // If the next way after the previous way's parent + // routes isn't the same as currentWay + // a split is also needed + if (!startNewSegment) { + startNewSegment = isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(previousWay, currentWay); + } } - selectedIndices = new ArrayList<>(); - } - nextWay = rmWay; - if (firstWayWasReached == true) { - break; + if (startNewSegment == true) { break; } } - } else { - firstWayWasReached = true; + segment.addLineIdentifier(parentRoute.get("ref")); + segment.addColour(parentRoute.get("colour")); } } - commands.add(new ChangeCommand(originalRelation, clonedRelation)); - UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); - editor.reloadDataFromRelation(); } + nextWayMember = currentWayMember; + currentWayMember = previousWayMember; } + UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); } - private Way findPreviousWay(List members, int i) { - if (i < 1) { - return new Way(); - } - final RelationMember potentialWayMember = members.get(i - 1); - if (potentialWayMember.isWay()) { - return potentialWayMember.getWay(); - } else { - return new Way(); + public boolean isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(Way previousWay, Way currentWay) { + List parentRoutesOfPreviousWay = new ArrayList<>(Utils.filteredCollection(previousWay.getReferrers(), Relation.class)); + for (Relation parentRouteOfPreviousWay : parentRoutesOfPreviousWay) { + if (RouteUtils.isVersionTwoPTRoute(parentRouteOfPreviousWay)) { + List> prevAndNextParent = findPreviousAndNextWayInRoute(parentRouteOfPreviousWay.getMembers(), previousWay); + Way nextWayInParentRouteOfPreviousWay = null; + if (prevAndNextParent.size() > 0) { + // todo what if the way occurs more than once in the parent + // route of the previous way? + nextWayInParentRouteOfPreviousWay = prevAndNextParent.get(0).b; + if (nextWayInParentRouteOfPreviousWay != null) { + String nextWayInParentRouteOfPreviousWayName = nextWayInParentRouteOfPreviousWay.get("name"); + } + } + if (nextWayInParentRouteOfPreviousWay != null + && nextWayInParentRouteOfPreviousWay.getId() != currentWay.getId()) { + return true; + } + } } -// Way previousWay; -// if (i < members.size() - 1 && members.get(i + 1).isWay()) { -// previousWay = members.get(i + 1).getWay(); -// } else { -// previousWay = new Way(); -// } -// return previousWay; + return false; } - private void addStreetName(List streetNamesList, String streetName) { - if (streetName != null && !streetNamesList.contains(streetName)) { - streetNamesList.add(0, streetName); - } + public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParentRoute, long previousWayId, long previousWayInParentRouteId) { + return !(nextWayInParentRoute != null && previousWayId == nextWayInParentRoute.getId() || + previousWayInParentRouteId != 0 && nextWayMember.getId() == previousWayInParentRouteId); } - private void updateTags(String previousLineIdentifiersSignature, List streetNamesList, String streetNamesSignature, Relation extractedRelation) { +// private Way findPreviousWay(List members, int i) { +// if (i < 1) { +// return new Way(); +// } +// final RelationMember potentialWayMember = members.get(i - 1); +// if (potentialWayMember.isWay()) { +// return potentialWayMember.getWay(); +// } else { +// return new Way(); +// } +//// Way previousWay; +//// if (i < members.size() - 1 && members.get(i + 1).isWay()) { +//// previousWay = members.get(i + 1).getWay(); +//// } else { +//// previousWay = new Way(); +//// } +//// return previousWay; +// } +// +// private void addStreetName(List streetNamesList, String streetName) { +// if (streetName != null && !streetNamesList.contains(streetName)) { +// streetNamesList.add(0, streetName); +// } +// } + + private void updateTags(String lineIdentifiersSignature, String firstAndLastStreetNameOrRef, String streetNamesSignature, String colours, Relation extractedRelation) { if (!streetNamesSignature.isEmpty()) { extractedRelation.put("street_names", streetNamesSignature); } - String fromToStreet = ""; - if (streetNamesList.size() > 0) { - fromToStreet = streetNamesList.get(0).concat(" "); - if (streetNamesList.size() > 1) { - fromToStreet = String.format("%s- %s ", fromToStreet, streetNamesList.get(streetNamesList.size() - 1)); - } + if (!colours.isEmpty()) { + extractedRelation.put("colour", colours); } - String name = String.format("%s(%s)", fromToStreet, previousLineIdentifiersSignature); - extractedRelation.put("name", name); - extractedRelation.put("route_ref", previousLineIdentifiersSignature); + extractedRelation.put("name", String.format("%s(%s)", + firstAndLastStreetNameOrRef, + lineIdentifiersSignature)); + extractedRelation.put("route_ref", lineIdentifiersSignature); // todo make a list of the ones we want to keep and remove the others extractedRelation.remove("bus"); extractedRelation.remove("colour"); @@ -348,29 +339,36 @@ private void updateTags(String previousLineIdentifiersSignature, List st extractedRelation.remove("wikidata"); } + /** + * for all occurences of wayToLocate this method returns the way before it and the way after it + * @param members The members list of the relation + * @param wayToLocate The way to locate in the list + * @return a list of way pairs + */ private List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + final long wayToLocateId = wayToLocate.getId(); Way previousWay; Way nextWay = null; boolean foundWay = false; - List> pairsList = new ArrayList<>(); - for (int j = members.size() - 1; j >= 0; j--) { + List> wayPairs = new ArrayList<>(); + for (int j = members.size() - 1; j>=0 ; j--) { RelationMember rm = members.get(j); - if (rm.isWay()) { + if (rm.isWay() && RouteUtils.isPTWay(rm)) { previousWay = rm.getWay(); if (foundWay) { - pairsList.add(new Pair(previousWay,nextWay)); + wayPairs.add(0, new Pair(previousWay,nextWay)); nextWay = null; foundWay = false; continue; } - if (previousWay.getId() == wayToLocate.getId()) { + if (previousWay.getId() == wayToLocateId) { foundWay = true; } else { nextWay = previousWay; } } } - return pairsList; + return wayPairs; } /** This method modifies clonedRelation in place if substituteWaysWithRelation is true * and if ways are extracted into a new relation diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java new file mode 100644 index 00000000..41249585 --- /dev/null +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -0,0 +1,169 @@ +// License: GPL. For details, see LICENSE file. +package org.openstreetmap.josm.plugins.pt_assistant.data; + +import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.data.osm.RelationMember; + +import java.util.ArrayList; +import java.util.List; + +import static java.util.Collections.sort; + +/** + * Represents a piece of a route that includes all the ways + * belonging to the same bundle of itineraries of vehicles + * traveling in the same direction + * + * @author Polyglot + * + */ +public class PTSegmentToExtract { + private final Relation relation; + + private final ArrayList ptWays; + private List indices; + private List lineIdentifiers; + private List colours; + private List streetNames; + + /** + * Constructor + * @param relation The route or superroute relation for which this route segment is created + * ptWays The list of PTWay members to extract + * indices The indices corresponding to the ways + * lineIdentifiers The ref tag of the route parent route relations of the ways + * colours The colours of the public transport lines of this line bundle + */ + + public PTSegmentToExtract(Relation relation) { + this.relation = relation; + + this.ptWays = new ArrayList<>(); + this.indices = new ArrayList<>(); + this.lineIdentifiers = new ArrayList<>(); + this.colours = new ArrayList<>(); + this.streetNames = null; + } + + /** + * Returns the PTWays of this route segment + * @return the PTWays of this route segment + */ + public List getPTWays() { + return this.ptWays; + } + + /** + * Sets the PTWays of this route segment to the given list + * @param ptWay the Way Member to add + * @param index its index in the relation specified in the constructor + * @param lineIdentifier The ref tag of the relation + * @param colour The colour tag of the relation + */ + public void addPTWay(RelationMember ptWay, Integer index, String lineIdentifier, String colour) { + this.ptWays.add(0, ptWay); + this.indices.add(0, index); + addLineIdentifier(lineIdentifier); + addColour(colour); + this.streetNames = null; + } + + /** + * Adds a line identifier to the list of line identifiers + * @param lineIdentifier The ref tag of the way's parent relation + */ + public void addLineIdentifier(String lineIdentifier) { + if (lineIdentifier != null && !lineIdentifiers.contains(lineIdentifier)) { + this.lineIdentifiers.add(lineIdentifier); + } + } + + /** + * Adds the colour to the list of colours + * @param colour The colour tag of the way's parent relation + */ + public void addColour(String colour) { + if (colour != null && !colours.contains(colour)) { + this.colours.add(colour); + } + } + + public List getLineIdentifiers() { + sort(this.lineIdentifiers); + return this.lineIdentifiers; + } + + public String getLineIdentifiersSignature() { + return String.join(";", getLineIdentifiers()); + } + + public List getColours() { + sort(this.colours); + return this.colours; + } + + public String getColoursSignature() { + return String.join(";", getColours()); + } + + /** + * determines the distinct street names or refs of the Way members + * @return All the distinct street names or refs of the Way members + */ + public List getStreetNames() { + if (this.streetNames == null) { + this.streetNames = new ArrayList<>(); + String streetName; + for (RelationMember rm : this.ptWays) { + streetName = rm.getWay().get("name"); + if (streetName == null) { + streetName = rm.getWay().get("ref"); + } + if (streetName != null) { + this.streetNames.add(streetName); + } + } + } + return this.streetNames; + } + + /** + * @return All the distinct street names or refs of the Way members as a ; delimited string + */ + public String getStreetNamesSignature() { + return String.join(";", getStreetNames()); + } + + /** + * @return The first and the last street name, separated by " - " + * or only one of them, followed by a space + * + * or an empty string + */ + public String getFirstAndLastStreetNameOrRef() { + List streetNames = getStreetNames(); + String first = ""; + String last = ""; + if (streetNames.size() > 0) { + first = streetNames.get(0); + if (streetNames.size() > 1) { + last = streetNames.get(streetNames.size() - 1); + } + } + String names; + if (!"".equals(first) && !"".equals(last)) { + names = String.join(" - ", first, last); + } else if (!"".equals(first)) { + names = first; + } else if (!"".equals(last)) { + names = last; + } else { + return ""; + } + return names + " "; + } + + public List getIndices() { + return this.indices; + } +} From 01d9ea24bb2d965fa75c02d9367fd69d102ebc86 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 18 Sep 2020 15:07:48 +0200 Subject: [PATCH 15/52] it's somewhat stable now, although there are still many things that don't work exactly the way I want. A commit before I'm going to apply Florian's suggestions --- ...actRelationMembersToNewRelationAction.java | 140 ++++------------ .../pt_assistant/data/PTSegmentToExtract.java | 155 +++++++++++++++--- 2 files changed, 160 insertions(+), 135 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 6e5729b4..daf8bee7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -24,6 +24,7 @@ import static java.util.Collections.*; import static org.openstreetmap.josm.gui.MainApplication.*; +import static org.openstreetmap.josm.plugins.pt_assistant.data.PTStop.isPTStop; /* Extracts selected members to a new route relation @@ -154,7 +155,6 @@ public void actionPerformed(ActionEvent actionEvent) { } public void splitInSegments(Relation originalRelation) { - final DataSet activeDataSet = getLayerManager().getActiveDataSet(); final Relation clonedRelation = new Relation(originalRelation); final long clonedRelationId = clonedRelation.getId(); final List members = clonedRelation.getMembers(); @@ -192,20 +192,7 @@ public void splitInSegments(Relation originalRelation) { clonedRelation.get("ref"), clonedRelation.get("colour")); } if (startNewSegment) { - segments.add(segment); - - Relation extractedRelation = extractMembersForIndicesAndSubstitute( - clonedRelation, segment.getIndices(), true); - - if (extractedRelation != null && extractedRelation.getId() <= 0) { - updateTags(segment.getLineIdentifiersSignature(), - segment.getFirstAndLastStreetNameOrRef(), - segment.getStreetNamesSignature(), - segment.getColoursSignature(), - extractedRelation); - UndoRedoHandler.getInstance().add(new AddCommand(activeDataSet, extractedRelation)); - } - segment = new PTSegmentToExtract(clonedRelation); + segment = createNewSegment(clonedRelation, segments, segment); startNewSegment = false; } String previousWayName = previousWay.get("name"); @@ -254,6 +241,19 @@ public void splitInSegments(Relation originalRelation) { segment.addColour(parentRoute.get("colour")); } } + } else { + if (isPTStop(rm)) { + // This only works if the presumption of stops being added + // before way members in the route relation is true + assert currentWayMember != null; + if (RouteUtils.isPTWay(currentWayMember)) { + assert nextWayMember != null; + if (RouteUtils.isPTWay(nextWayMember)) { + createNewSegment(clonedRelation, segments, segment); + break; + } + } + } } nextWayMember = currentWayMember; currentWayMember = previousWayMember; @@ -261,6 +261,18 @@ public void splitInSegments(Relation originalRelation) { UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); } + public PTSegmentToExtract createNewSegment(Relation clonedRelation, List segments, PTSegmentToExtract segment) { + segments.add(segment); + ArrayList tagsToKeep = new ArrayList<>(); + for (String s : Arrays.asList("type", "route", "public_transport:version")) { + tagsToKeep.add(s); + } + Relation extractedRelation = segment.extractToRelation(tagsToKeep, true); + + segment = new PTSegmentToExtract(clonedRelation); + return segment; + } + public boolean isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(Way previousWay, Way currentWay) { List parentRoutesOfPreviousWay = new ArrayList<>(Utils.filteredCollection(previousWay.getReferrers(), Relation.class)); for (Relation parentRouteOfPreviousWay : parentRoutesOfPreviousWay) { @@ -289,56 +301,6 @@ public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParent previousWayInParentRouteId != 0 && nextWayMember.getId() == previousWayInParentRouteId); } -// private Way findPreviousWay(List members, int i) { -// if (i < 1) { -// return new Way(); -// } -// final RelationMember potentialWayMember = members.get(i - 1); -// if (potentialWayMember.isWay()) { -// return potentialWayMember.getWay(); -// } else { -// return new Way(); -// } -//// Way previousWay; -//// if (i < members.size() - 1 && members.get(i + 1).isWay()) { -//// previousWay = members.get(i + 1).getWay(); -//// } else { -//// previousWay = new Way(); -//// } -//// return previousWay; -// } -// -// private void addStreetName(List streetNamesList, String streetName) { -// if (streetName != null && !streetNamesList.contains(streetName)) { -// streetNamesList.add(0, streetName); -// } -// } - - private void updateTags(String lineIdentifiersSignature, String firstAndLastStreetNameOrRef, String streetNamesSignature, String colours, Relation extractedRelation) { - if (!streetNamesSignature.isEmpty()) { - extractedRelation.put("street_names", streetNamesSignature); - } - if (!colours.isEmpty()) { - extractedRelation.put("colour", colours); - } - extractedRelation.put("name", String.format("%s(%s)", - firstAndLastStreetNameOrRef, - lineIdentifiersSignature)); - extractedRelation.put("route_ref", lineIdentifiersSignature); - // todo make a list of the ones we want to keep and remove the others - extractedRelation.remove("bus"); - extractedRelation.remove("colour"); - extractedRelation.remove("from"); - extractedRelation.remove("network"); - extractedRelation.remove("network:wikidata"); - extractedRelation.remove("operator"); - extractedRelation.remove("operator:wikidata"); - extractedRelation.remove("ref"); - extractedRelation.remove("to"); - extractedRelation.remove("via"); - extractedRelation.remove("wikidata"); - } - /** * for all occurences of wayToLocate this method returns the way before it and the way after it * @param members The members list of the relation @@ -356,7 +318,7 @@ private List> findPreviousAndNextWayInRoute(List m if (rm.isWay() && RouteUtils.isPTWay(rm)) { previousWay = rm.getWay(); if (foundWay) { - wayPairs.add(0, new Pair(previousWay,nextWay)); + wayPairs.add(0, new Pair<>(previousWay,nextWay)); nextWay = null; foundWay = false; continue; @@ -381,7 +343,6 @@ private List> findPreviousAndNextWayInRoute(List m public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, List selectedIndices, boolean substituteWaysWithRelation) { - List> parentRouteRelationsCandidates = new ArrayList<>(); Relation extractedRelation = new Relation(); extractedRelation.setKeys(clonedRelation.getKeys()); extractedRelation.put("type", "route"); @@ -393,46 +354,12 @@ public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, index = selectedIndices.get(i); RelationMember relationMember = clonedRelation.removeMember(index); extractedRelation.addMember(0, relationMember); - // check if a similar sub route relation already exists -// if (relationMember.getType().equals(OsmPrimitiveType.WAY)) { -// final Way rmWay = relationMember.getWay(); -// for (Pair candidateForRemoval : parentRouteRelationsCandidates) { -// if (candidateForRemoval.a > 1) { -// final RelationMember wayBefore = candidateForRemoval.b.getMember(candidateForRemoval.a - 1); -// parentRouteRelationsCandidates.remove(candidateForRemoval); -// if (wayBefore.isWay() && wayBefore.getWay().equals(rmWay)) { -// Pair candidate = Pair.create(candidateForRemoval.a -1, candidateForRemoval.b); -// parentRouteRelationsCandidates.add(candidate); -// } -// } -// } -// for (Relation wayParent : Utils.filteredCollection(rmWay.getReferrers(), Relation.class)) { -// if (!wayParent.equals(clonedRelation)) { -// final int indexInParent = wayParent.getMembersCount() - 1; -// final RelationMember wayParentMember = wayParent.getMember(indexInParent); -// if (wayParentMember.isWay()) { -// Way lastWayOfParent = wayParentMember.getWay(); -// if (rmWay.equals(lastWayOfParent)) { -// Pair candidate = Pair.create(indexInParent, wayParent); -// parentRouteRelationsCandidates.add(candidate); -// break; -// } -// } -// } -// } -// } - } - int membersCount = extractedRelation.getMembersCount(); - for (Pair candidate : parentRouteRelationsCandidates) { - if (membersCount == candidate.b.getMembersCount()) { - extractedRelation = candidate.b; - } } if (atLeast1MemberAddedToExtractedRelation) { if (substituteWaysWithRelation) { // replace removed members with the extracted relation - index = limitIntegerTo(index, clonedRelation.getMembersCount()); + index = PTSegmentToExtract.limitIntegerTo(index, clonedRelation.getMembersCount()); clonedRelation.addMember(index, new RelationMember("", extractedRelation)); } } else { @@ -441,13 +368,6 @@ public Relation extractMembersForIndicesAndSubstitute(Relation clonedRelation, return extractedRelation; } - private int limitIntegerTo(int index, int limit) { - if (index > limit) { - index = limit; - } - return index; - } - private void addExtractedRelationToParentSuperrouteRelations(Relation originalRelation, List commands, List parentRelations, List selectedIndices, Relation extractedRelation) { for (Relation superroute : parentRelations) { int index = 0; @@ -460,7 +380,7 @@ private void addExtractedRelationToParentSuperrouteRelations(Relation originalRe // the position where this relation was in the parent index++; } - index = limitIntegerTo(index, superroute.getMembersCount()); + index = PTSegmentToExtract.limitIntegerTo(index, superroute.getMembersCount()); clonedParentRelation.addMember(index, new RelationMember("", extractedRelation)); commands.add(new ChangeCommand(superroute, clonedParentRelation)); break; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 41249585..6f8d5949 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -1,13 +1,18 @@ // License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.pt_assistant.data; +import org.openstreetmap.josm.command.AddCommand; +import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor; +import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; -import java.util.ArrayList; -import java.util.List; +import java.util.*; import static java.util.Collections.sort; +import static org.openstreetmap.josm.gui.MainApplication.getLayerManager; +import static org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor.*; /** * Represents a piece of a route that includes all the ways @@ -18,13 +23,23 @@ * */ public class PTSegmentToExtract { + /** + * + */ + private static Map ptSegments; private final Relation relation; + private Relation extractedRelation; private final ArrayList ptWays; private List indices; private List lineIdentifiers; private List colours; private List streetNames; + private List streetIds; + + static { + PTSegmentToExtract.ptSegments = new HashMap<>(); + } /** * Constructor @@ -37,12 +52,14 @@ public class PTSegmentToExtract { public PTSegmentToExtract(Relation relation) { this.relation = relation; + extractedRelation = null; - this.ptWays = new ArrayList<>(); - this.indices = new ArrayList<>(); - this.lineIdentifiers = new ArrayList<>(); - this.colours = new ArrayList<>(); - this.streetNames = null; + ptWays = new ArrayList<>(); + indices = new ArrayList<>(); + lineIdentifiers = new ArrayList<>(); + colours = new ArrayList<>(); + streetNames = null; + streetIds = null; } /** @@ -50,7 +67,7 @@ public PTSegmentToExtract(Relation relation) { * @return the PTWays of this route segment */ public List getPTWays() { - return this.ptWays; + return ptWays; } /** @@ -61,11 +78,29 @@ public List getPTWays() { * @param colour The colour tag of the relation */ public void addPTWay(RelationMember ptWay, Integer index, String lineIdentifier, String colour) { - this.ptWays.add(0, ptWay); - this.indices.add(0, index); + ptWays.add(0, ptWay); + indices.add(0, index); addLineIdentifier(lineIdentifier); addColour(colour); - this.streetNames = null; + streetNames = null; + streetIds = null; + } + + public List getWayIds() { + if (streetIds == null) { + streetIds = new ArrayList<>(); + for (RelationMember rm : ptWays) { + streetIds.add(rm.getWay().getId()); + } + } + return streetIds; + } + + /** + * @return All the Way member's ids as a ; delimited string + */ + public String getWayIdsSignature() { + return String.join(";", getWayIds().toString()); } /** @@ -74,7 +109,7 @@ public void addPTWay(RelationMember ptWay, Integer index, String lineIdentifier, */ public void addLineIdentifier(String lineIdentifier) { if (lineIdentifier != null && !lineIdentifiers.contains(lineIdentifier)) { - this.lineIdentifiers.add(lineIdentifier); + lineIdentifiers.add(lineIdentifier); } } @@ -83,14 +118,17 @@ public void addLineIdentifier(String lineIdentifier) { * @param colour The colour tag of the way's parent relation */ public void addColour(String colour) { - if (colour != null && !colours.contains(colour)) { - this.colours.add(colour); + if (colour != null) { + String colourUppercase = colour.toUpperCase(); + if (!colours.contains(colourUppercase)) { + colours.add(colourUppercase); + } } } public List getLineIdentifiers() { - sort(this.lineIdentifiers); - return this.lineIdentifiers; + lineIdentifiers.sort(new RefTagComparator()); + return lineIdentifiers; } public String getLineIdentifiersSignature() { @@ -98,12 +136,17 @@ public String getLineIdentifiersSignature() { } public List getColours() { - sort(this.colours); - return this.colours; + sort(colours); + return colours; } public String getColoursSignature() { - return String.join(";", getColours()); + String signature = String.join(";", getColours()); + if (signature.isEmpty()) { + return null; + } else { + return signature; + } } /** @@ -111,20 +154,20 @@ public String getColoursSignature() { * @return All the distinct street names or refs of the Way members */ public List getStreetNames() { - if (this.streetNames == null) { - this.streetNames = new ArrayList<>(); + if (streetNames == null) { + streetNames = new ArrayList<>(); String streetName; - for (RelationMember rm : this.ptWays) { + for (RelationMember rm : ptWays) { streetName = rm.getWay().get("name"); if (streetName == null) { streetName = rm.getWay().get("ref"); } if (streetName != null) { - this.streetNames.add(streetName); + streetNames.add(streetName); } } } - return this.streetNames; + return streetNames; } /** @@ -150,6 +193,9 @@ public String getFirstAndLastStreetNameOrRef() { last = streetNames.get(streetNames.size() - 1); } } + if (first == last) { + last = ""; + } String names; if (!"".equals(first) && !"".equals(last)) { names = String.join(" - ", first, last); @@ -164,6 +210,65 @@ public String getFirstAndLastStreetNameOrRef() { } public List getIndices() { - return this.indices; + return indices; + } + + public Relation extractToRelation(ArrayList tagsToTransfer, Boolean substituteWaysWithRelation) { + boolean extractedRelationAlreadyExists = false; + if (ptSegments.containsKey(getWayIdsSignature())) { + extractedRelation = ptSegments.get(getWayIdsSignature()); + extractedRelationAlreadyExists = true; + } else { + extractedRelation = new Relation(); + for (String tag : tagsToTransfer) { + extractedRelation.put(tag, relation.get(tag)); + } + extractedRelation.put("type", "route"); + } + int index = 0; + boolean atLeast1MemberAddedToExtractedRelation = false; + for (int i = indices.size() - 1; i >= 0; i--) { + index = indices.get(i); + RelationMember relationMember = relation.removeMember(index); + if (!extractedRelationAlreadyExists && RouteUtils.isPTWay(relationMember)) { + extractedRelation.addMember(0, relationMember); + atLeast1MemberAddedToExtractedRelation = true; + } + } + + if (atLeast1MemberAddedToExtractedRelation) { + if (extractedRelation.getId() <= 0 && !ptSegments.containsKey(getWayIdsSignature())) { + final String lineIdentifiersSignature = getLineIdentifiersSignature(); + extractedRelation.put("note", + String.format("%s(%s)", getFirstAndLastStreetNameOrRef(), lineIdentifiersSignature)); + extractedRelation.put("route_ref", lineIdentifiersSignature); + // extractedRelation.put("street_names", getStreetNamesSignature()); + extractedRelation.put("colour", getColoursSignature()); + UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), + extractedRelation)); + addPtSegment(); + } + if (substituteWaysWithRelation) { + // replace removed members with the extracted relation + relation.addMember(limitIntegerTo(index, relation.getMembersCount()-1), + new RelationMember("", extractedRelation)); + } + } else { + return null; + } + return extractedRelation; + } + + private void addPtSegment() { + if (extractedRelation != null) { + PTSegmentToExtract.ptSegments.put(getWayIdsSignature(), extractedRelation); + } + } + + public static int limitIntegerTo(int index, int limit) { + if (index > limit) { + index = limit; + } + return index; } } From ec66b9d210d0b4e496e7efcae4052a2b0f1a2cf2 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 20 Sep 2020 02:07:00 +0200 Subject: [PATCH 16/52] I didn't like the nondescript A and B from Pair, so I created a new Class WayTriplet. It almost works the way I want it to, now. It should also split if the first or last way in one of the parents is reached in case the line currently processed continues on a stop that is a terminus for other lines. An odd bug is that the way that ends up in previousWay in the first iteration, stays in the original relation. One regression is that identical relations are created multiple times, instead of being created once and then reused in the superroute --- ...actRelationMembersToNewRelationAction.java | 173 ++++++------------ .../pt_assistant/data/PTSegmentToExtract.java | 88 ++++++--- .../plugins/pt_assistant/data/WayTriplet.java | 16 ++ 3 files changed, 137 insertions(+), 140 deletions(-) create mode 100644 src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WayTriplet.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index daf8bee7..8e022352 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -19,12 +19,12 @@ import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; import org.openstreetmap.josm.plugins.pt_assistant.data.PTSegmentToExtract; +import org.openstreetmap.josm.plugins.pt_assistant.data.WayTriplet; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import org.openstreetmap.josm.tools.*; import static java.util.Collections.*; import static org.openstreetmap.josm.gui.MainApplication.*; -import static org.openstreetmap.josm.plugins.pt_assistant.data.PTStop.isPTStop; /* Extracts selected members to a new route relation @@ -157,135 +157,84 @@ public void actionPerformed(ActionEvent actionEvent) { public void splitInSegments(Relation originalRelation) { final Relation clonedRelation = new Relation(originalRelation); final long clonedRelationId = clonedRelation.getId(); - final List members = clonedRelation.getMembers(); - List segments = new ArrayList<>(); - RelationMember previousWayMember = null; - RelationMember currentWayMember = null; - RelationMember nextWayMember = null; boolean startNewSegment = false; - PTSegmentToExtract segment = null; - for (int i = members.size()-1; i>=0; i--) { - RelationMember rm = members.get(i); - if (RouteUtils.isPTWay(rm)) { - previousWayMember = rm; - if (currentWayMember == null) { - currentWayMember = previousWayMember; - continue; - } else if (nextWayMember == null) { - nextWayMember = currentWayMember; - currentWayMember = previousWayMember; - segment = new PTSegmentToExtract(clonedRelation); - continue; - } - // now previousWayMember, currentWayMember and nextWayMember all have values - // how to decide whether currentWayMember is in the same segment as nextWayMember? - // it is if for all the parent route relations of currentWayMember - // that go in the same direction, the nextWayMember is the same as the nextWayMember of this route - // to exclude route that go in the opposite direction it's necessary to compare - // previousWayMember with their nextWayMember and nextWayMember with their previousWayMember - final Way previousWay = previousWayMember.getWay(); - final Way currentWay = currentWayMember.getWay(); - final Way nextWay = nextWayMember.getWay(); - List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(currentWay.getReferrers(), Relation.class)); - if (segment != null) { - segment.addPTWay(nextWayMember, i+2, - clonedRelation.get("ref"), clonedRelation.get("colour")); - } - if (startNewSegment) { - segment = createNewSegment(clonedRelation, segments, segment); - startNewSegment = false; - } - String previousWayName = previousWay.get("name"); - String currentWayName = currentWay.get("name"); - String nextWayName = nextWay.get("name"); - final long previousWayId = previousWay.getId(); - for (Relation parentRoute : parentRouteRelations) { - if (parentRoute.getId() != clonedRelationId && RouteUtils.isVersionTwoPTRoute(parentRoute)) { - List> prevAndNext = findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay); - Way previousWayInParentRoute = null; - Way nextWayInParentRoute = null; - for (int k = 0; k < prevAndNext.size(); k++) { - Pair wayPair = prevAndNext.get(k); - previousWayInParentRoute = wayPair.a; - nextWayInParentRoute = wayPair.b; + final List members = clonedRelation.getMembers(); + PTSegmentToExtract segment = new PTSegmentToExtract(clonedRelation); + segment.addPTWay(members.size() - 1); + for (int i = members.size() - 2; i >= 1; i--) { + final Way previousWay = getIfWay(members, i - 1); + final Way currentWay = getIfWay(members, i); + if (currentWay == null) { + // Going backward through all the ways, the stop members were reached + segment.extractToRelation(new ArrayList(Arrays.asList("type", "route")), + true); + break; + } + final Way nextWay = getIfWay(members, i + 1); + + if (startNewSegment) { + segment.extractToRelation(new ArrayList(Arrays.asList("type", "route")), + true); + segment = new PTSegmentToExtract(clonedRelation); + startNewSegment = false; + } + segment.addPTWay(i); + + long previousWayId = 0; + if (previousWay != null) {previousWayId = previousWay.getId();} + List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(currentWay.getReferrers(), Relation.class)); + for (Relation parentRoute : parentRouteRelations) { + if (parentRoute.getId() != clonedRelationId && RouteUtils.isVersionTwoPTRoute(parentRoute)) { + for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay)) { + long previousWayInParentRouteId = 0; + if (waysInParentRoute.previousWay != null) { + previousWayInParentRouteId = waysInParentRoute.previousWay.getId(); + } + if (isItineraryInSameDirection(nextWay, waysInParentRoute.nextWay, previousWayId, previousWayInParentRouteId)) { + if (!startNewSegment && previousWayInParentRouteId != 0 + && previousWayId != previousWayInParentRouteId) { + // if one of the parent relations has a different previous way + // it's time to start a new segment + startNewSegment = true; + } /* - We are not interested in route relations that describe vehicles - traveling in the opposite direction + If the next way after the previous way's parent + routes isn't the same as currentWay a split is also needed */ - long previousWayInParentRouteId = 0; - if (previousWayInParentRoute != null) { - String previousWayInParentName = previousWayInParentRoute.get("name"); - previousWayInParentRouteId = previousWayInParentRoute.getId(); - } - if (nextWayInParentRoute != null) { - String nextWayInParentName = nextWayInParentRoute.get("name"); + if (!startNewSegment) { + startNewSegment = isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(previousWay, currentWay); } -// if (currentWayName == "006 Burchtstraat") { } - if (isItineraryInSameDirection(nextWay, nextWayInParentRoute, previousWayId, previousWayInParentRouteId)) { - if (!startNewSegment && - previousWayInParentRouteId != 0 && previousWayId != previousWayInParentRouteId) { - // if one of the parent relations has a different previous way - // it's time to start a new segment - startNewSegment = true; - } - // If the next way after the previous way's parent - // routes isn't the same as currentWay - // a split is also needed - if (!startNewSegment) { - startNewSegment = isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(previousWay, currentWay); - } - } - if (startNewSegment == true) { break; } + segment.addLineIdentifier(parentRoute.get("ref")); + segment.addColour(parentRoute.get("colour")); } - segment.addLineIdentifier(parentRoute.get("ref")); - segment.addColour(parentRoute.get("colour")); - } - } - } else { - if (isPTStop(rm)) { - // This only works if the presumption of stops being added - // before way members in the route relation is true - assert currentWayMember != null; - if (RouteUtils.isPTWay(currentWayMember)) { - assert nextWayMember != null; - if (RouteUtils.isPTWay(nextWayMember)) { - createNewSegment(clonedRelation, segments, segment); + if (startNewSegment) { break; } } } } - nextWayMember = currentWayMember; - currentWayMember = previousWayMember; } UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); } - public PTSegmentToExtract createNewSegment(Relation clonedRelation, List segments, PTSegmentToExtract segment) { - segments.add(segment); - ArrayList tagsToKeep = new ArrayList<>(); - for (String s : Arrays.asList("type", "route", "public_transport:version")) { - tagsToKeep.add(s); - } - Relation extractedRelation = segment.extractToRelation(tagsToKeep, true); - - segment = new PTSegmentToExtract(clonedRelation); - return segment; + public Way getIfWay(List members, int index) { + RelationMember member = members.get(index); + if (member.isWay()) return member.getWay(); + return null; } public boolean isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(Way previousWay, Way currentWay) { List parentRoutesOfPreviousWay = new ArrayList<>(Utils.filteredCollection(previousWay.getReferrers(), Relation.class)); for (Relation parentRouteOfPreviousWay : parentRoutesOfPreviousWay) { if (RouteUtils.isVersionTwoPTRoute(parentRouteOfPreviousWay)) { - List> prevAndNextParent = findPreviousAndNextWayInRoute(parentRouteOfPreviousWay.getMembers(), previousWay); + List> prevAndNextParent = findPreviousAndNextWayInRoute(parentRouteOfPreviousWay.getMembers(), previousWay); Way nextWayInParentRouteOfPreviousWay = null; if (prevAndNextParent.size() > 0) { - // todo what if the way occurs more than once in the parent - // route of the previous way? - nextWayInParentRouteOfPreviousWay = prevAndNextParent.get(0).b; - if (nextWayInParentRouteOfPreviousWay != null) { - String nextWayInParentRouteOfPreviousWayName = nextWayInParentRouteOfPreviousWay.get("name"); - } + // todo what if the way occurs more than once in the parent route of the previous way? + nextWayInParentRouteOfPreviousWay = prevAndNextParent.get(0).nextWay; +// if (nextWayInParentRouteOfPreviousWay != null) { +// String nextWayInParentRouteOfPreviousWayName = nextWayInParentRouteOfPreviousWay.get("name"); +// } } if (nextWayInParentRouteOfPreviousWay != null && nextWayInParentRouteOfPreviousWay.getId() != currentWay.getId()) { @@ -307,18 +256,18 @@ public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParent * @param wayToLocate The way to locate in the list * @return a list of way pairs */ - private List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + private List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { final long wayToLocateId = wayToLocate.getId(); Way previousWay; Way nextWay = null; boolean foundWay = false; - List> wayPairs = new ArrayList<>(); + List> wayTriplets = new ArrayList<>(); for (int j = members.size() - 1; j>=0 ; j--) { RelationMember rm = members.get(j); if (rm.isWay() && RouteUtils.isPTWay(rm)) { previousWay = rm.getWay(); if (foundWay) { - wayPairs.add(0, new Pair<>(previousWay,nextWay)); + wayTriplets.add(0, new WayTriplet<>(previousWay,wayToLocate,nextWay)); nextWay = null; foundWay = false; continue; @@ -330,7 +279,7 @@ private List> findPreviousAndNextWayInRoute(List m } } } - return wayPairs; + return wayTriplets; } /** This method modifies clonedRelation in place if substituteWaysWithRelation is true * and if ways are extracted into a new relation diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 6f8d5949..2b3c12b8 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -5,14 +5,17 @@ import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; -import org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import static java.util.Collections.sort; import static org.openstreetmap.josm.gui.MainApplication.getLayerManager; -import static org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor.*; +import static org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor.RefTagComparator; /** * Represents a piece of a route that includes all the ways @@ -30,17 +33,19 @@ public class PTSegmentToExtract { private final Relation relation; private Relation extractedRelation; - private final ArrayList ptWays; - private List indices; - private List lineIdentifiers; - private List colours; + private ArrayList ptWays; + private final List indices; + private final List lineIdentifiers; + private final List colours; private List streetNames; private List streetIds; static { - PTSegmentToExtract.ptSegments = new HashMap<>(); + ptSegments = new HashMap<>(); } + private Boolean updateTags; + /** * Constructor * @param relation The route or superroute relation for which this route segment is created @@ -49,7 +54,6 @@ public class PTSegmentToExtract { * lineIdentifiers The ref tag of the route parent route relations of the ways * colours The colours of the public transport lines of this line bundle */ - public PTSegmentToExtract(Relation relation) { this.relation = relation; extractedRelation = null; @@ -62,6 +66,27 @@ public PTSegmentToExtract(Relation relation) { streetIds = null; } + public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { + this.relation = null; + extractedRelation = existingRelation; + + ptWays = new ArrayList<>(); + indices = new ArrayList<>(); + lineIdentifiers = new ArrayList<>(); + colours = new ArrayList<>(); + streetNames = null; + streetIds = null; + + this.ptWays = (ArrayList) existingRelation.getMembers().stream() + .filter(RelationMember::isWay) + .filter(RouteUtils::isPTWay) + .collect(Collectors.toList()); + if (updateTags) { + updateTags(); + } + ptSegments.put(getWayIdsSignature(), extractedRelation); + } + /** * Returns the PTWays of this route segment * @return the PTWays of this route segment @@ -72,18 +97,19 @@ public List getPTWays() { /** * Sets the PTWays of this route segment to the given list - * @param ptWay the Way Member to add - * @param index its index in the relation specified in the constructor - * @param lineIdentifier The ref tag of the relation - * @param colour The colour tag of the relation + * @param index its index in the relation specified in the constructor */ - public void addPTWay(RelationMember ptWay, Integer index, String lineIdentifier, String colour) { - ptWays.add(0, ptWay); - indices.add(0, index); - addLineIdentifier(lineIdentifier); - addColour(colour); - streetNames = null; - streetIds = null; + public void addPTWay(Integer index) { + assert relation != null; + final RelationMember member = relation.getMember(index); + if(member.isWay()) { + indices.add(0, index); + ptWays.add(0, member); + addLineIdentifier(relation.get("ref")); + addColour(relation.get("colour")); + streetNames = null; + streetIds = null; + } } public List getWayIds() { @@ -193,7 +219,7 @@ public String getFirstAndLastStreetNameOrRef() { last = streetNames.get(streetNames.size() - 1); } } - if (first == last) { + if (first.equals(last)) { last = ""; } String names; @@ -221,6 +247,7 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs } else { extractedRelation = new Relation(); for (String tag : tagsToTransfer) { + assert relation != null; extractedRelation.put(tag, relation.get(tag)); } extractedRelation.put("type", "route"); @@ -229,6 +256,7 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs boolean atLeast1MemberAddedToExtractedRelation = false; for (int i = indices.size() - 1; i >= 0; i--) { index = indices.get(i); + assert relation != null; RelationMember relationMember = relation.removeMember(index); if (!extractedRelationAlreadyExists && RouteUtils.isPTWay(relationMember)) { extractedRelation.addMember(0, relationMember); @@ -238,12 +266,7 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs if (atLeast1MemberAddedToExtractedRelation) { if (extractedRelation.getId() <= 0 && !ptSegments.containsKey(getWayIdsSignature())) { - final String lineIdentifiersSignature = getLineIdentifiersSignature(); - extractedRelation.put("note", - String.format("%s(%s)", getFirstAndLastStreetNameOrRef(), lineIdentifiersSignature)); - extractedRelation.put("route_ref", lineIdentifiersSignature); - // extractedRelation.put("street_names", getStreetNamesSignature()); - extractedRelation.put("colour", getColoursSignature()); + updateTags(); UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); addPtSegment(); @@ -259,9 +282,18 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs return extractedRelation; } + public void updateTags() { + final String lineIdentifiersSignature = getLineIdentifiersSignature(); + extractedRelation.put("note", + String.format("%s(%s)", getFirstAndLastStreetNameOrRef(), lineIdentifiersSignature)); + extractedRelation.put("route_ref", lineIdentifiersSignature); + // extractedRelation.put("street_names", getStreetNamesSignature()); + extractedRelation.put("colour", getColoursSignature()); + } + private void addPtSegment() { if (extractedRelation != null) { - PTSegmentToExtract.ptSegments.put(getWayIdsSignature(), extractedRelation); + ptSegments.put(getWayIdsSignature(), extractedRelation); } } diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WayTriplet.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WayTriplet.java new file mode 100644 index 00000000..2e360d34 --- /dev/null +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WayTriplet.java @@ -0,0 +1,16 @@ +package org.openstreetmap.josm.plugins.pt_assistant.data; + +import org.openstreetmap.josm.data.osm.OsmPrimitive; +import org.openstreetmap.josm.data.osm.Way; + +public final class WayTriplet { + public Way previousWay; + public Way currentWay; + public Way nextWay; + + public WayTriplet(Way previousWay, Way currentWay, Way nextWay) { + this.previousWay = previousWay; + this.currentWay = currentWay; + this.nextWay = nextWay; + } +} From d36c864aa4609d3db89956aae3e7354a9d35cba6 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 20 Sep 2020 10:12:30 +0200 Subject: [PATCH 17/52] Changed colours and lineIdentifiers to TreeSet. lineIdentifiers need to be sorted using a specialised Comparator --- .../pt_assistant/data/PTSegmentToExtract.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 2b3c12b8..120d23f0 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -7,10 +7,7 @@ import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import static java.util.Collections.sort; @@ -35,8 +32,8 @@ public class PTSegmentToExtract { private ArrayList ptWays; private final List indices; - private final List lineIdentifiers; - private final List colours; + private final TreeSet lineIdentifiers; + private final TreeSet colours; private List streetNames; private List streetIds; @@ -60,8 +57,8 @@ public PTSegmentToExtract(Relation relation) { ptWays = new ArrayList<>(); indices = new ArrayList<>(); - lineIdentifiers = new ArrayList<>(); - colours = new ArrayList<>(); + lineIdentifiers = new TreeSet<>(new RefTagComparator()); + colours = new TreeSet<>(); streetNames = null; streetIds = null; } @@ -72,8 +69,8 @@ public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { ptWays = new ArrayList<>(); indices = new ArrayList<>(); - lineIdentifiers = new ArrayList<>(); - colours = new ArrayList<>(); + lineIdentifiers = new TreeSet<>(); + colours = new TreeSet<>(); streetNames = null; streetIds = null; @@ -152,8 +149,7 @@ public void addColour(String colour) { } } - public List getLineIdentifiers() { - lineIdentifiers.sort(new RefTagComparator()); + public TreeSet getLineIdentifiers() { return lineIdentifiers; } @@ -161,8 +157,7 @@ public String getLineIdentifiersSignature() { return String.join(";", getLineIdentifiers()); } - public List getColours() { - sort(colours); + public TreeSet getColours() { return colours; } From 1feb68cb4a601c74de20242aefb242613c7aa37c Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 20 Sep 2020 10:15:45 +0200 Subject: [PATCH 18/52] No need to user .contains anymore, now that it's using TreeSet --- .../josm/plugins/pt_assistant/data/PTSegmentToExtract.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 120d23f0..c99f4e0c 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -131,7 +131,7 @@ public String getWayIdsSignature() { * @param lineIdentifier The ref tag of the way's parent relation */ public void addLineIdentifier(String lineIdentifier) { - if (lineIdentifier != null && !lineIdentifiers.contains(lineIdentifier)) { + if (lineIdentifier != null) { lineIdentifiers.add(lineIdentifier); } } @@ -143,9 +143,7 @@ public void addLineIdentifier(String lineIdentifier) { public void addColour(String colour) { if (colour != null) { String colourUppercase = colour.toUpperCase(); - if (!colours.contains(colourUppercase)) { - colours.add(colourUppercase); - } + colours.add(colourUppercase); } } From 1443a9adb64abf9726adcd3576f8934d1e257560 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 20 Sep 2020 11:47:32 +0200 Subject: [PATCH 19/52] I fixed the problem where identical sub route relations where created twice. Now it notices it already had a relation with that ways sequence in it and reuses the sub relation created previously. --- ...actRelationMembersToNewRelationAction.java | 13 ++++++-- .../pt_assistant/data/PTSegmentToExtract.java | 31 ++++++++++--------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 8e022352..3fd114a7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -187,9 +187,13 @@ public void splitInSegments(Relation originalRelation) { if (parentRoute.getId() != clonedRelationId && RouteUtils.isVersionTwoPTRoute(parentRoute)) { for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay)) { long previousWayInParentRouteId = 0; - if (waysInParentRoute.previousWay != null) { - previousWayInParentRouteId = waysInParentRoute.previousWay.getId(); + if (waysInParentRoute.previousWay == null || waysInParentRoute.nextWay == null) { + // If there is no way before or a way after in the parent route + // this was the first or the last way in the parent route + // so a split is needed + startNewSegment = true; } + previousWayInParentRouteId = waysInParentRoute.previousWay.getId(); if (isItineraryInSameDirection(nextWay, waysInParentRoute.nextWay, previousWayId, previousWayInParentRouteId)) { if (!startNewSegment && previousWayInParentRouteId != 0 && previousWayId != previousWayInParentRouteId) { @@ -251,7 +255,7 @@ public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParent } /** - * for all occurences of wayToLocate this method returns the way before it and the way after it + * for all occurrences of wayToLocate this method returns the way before it and the way after it * @param members The members list of the relation * @param wayToLocate The way to locate in the list * @return a list of way pairs @@ -267,6 +271,9 @@ private List> findPreviousAndNextWayInRoute(List(previousWay,wayToLocate,nextWay)); nextWay = null; foundWay = false; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index c99f4e0c..1ff2cabb 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -35,7 +35,8 @@ public class PTSegmentToExtract { private final TreeSet lineIdentifiers; private final TreeSet colours; private List streetNames; - private List streetIds; + private List wayIds; + private String wayIdsSignature; static { ptSegments = new HashMap<>(); @@ -60,7 +61,7 @@ public PTSegmentToExtract(Relation relation) { lineIdentifiers = new TreeSet<>(new RefTagComparator()); colours = new TreeSet<>(); streetNames = null; - streetIds = null; + wayIds = null; } public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { @@ -72,7 +73,7 @@ public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { lineIdentifiers = new TreeSet<>(); colours = new TreeSet<>(); streetNames = null; - streetIds = null; + wayIds = null; this.ptWays = (ArrayList) existingRelation.getMembers().stream() .filter(RelationMember::isWay) @@ -105,25 +106,27 @@ public void addPTWay(Integer index) { addLineIdentifier(relation.get("ref")); addColour(relation.get("colour")); streetNames = null; - streetIds = null; + wayIds = null; } } - public List getWayIds() { - if (streetIds == null) { - streetIds = new ArrayList<>(); + public List getWayIds() { + if (wayIds == null) { + wayIds = new ArrayList<>(); for (RelationMember rm : ptWays) { - streetIds.add(rm.getWay().getId()); + wayIds.add(String.valueOf(rm.getWay().getId())); } } - return streetIds; + wayIdsSignature = String.join(";", wayIds); + return wayIds; } /** * @return All the Way member's ids as a ; delimited string */ public String getWayIdsSignature() { - return String.join(";", getWayIds().toString()); + getWayIds(); + return wayIdsSignature; } /** @@ -235,7 +238,7 @@ public List getIndices() { public Relation extractToRelation(ArrayList tagsToTransfer, Boolean substituteWaysWithRelation) { boolean extractedRelationAlreadyExists = false; if (ptSegments.containsKey(getWayIdsSignature())) { - extractedRelation = ptSegments.get(getWayIdsSignature()); + extractedRelation = ptSegments.get(wayIdsSignature); extractedRelationAlreadyExists = true; } else { extractedRelation = new Relation(); @@ -257,8 +260,8 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs } } - if (atLeast1MemberAddedToExtractedRelation) { - if (extractedRelation.getId() <= 0 && !ptSegments.containsKey(getWayIdsSignature())) { + if (atLeast1MemberAddedToExtractedRelation || extractedRelationAlreadyExists) { + if (extractedRelation.getId() <= 0 && !extractedRelationAlreadyExists) { updateTags(); UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); @@ -286,7 +289,7 @@ public void updateTags() { private void addPtSegment() { if (extractedRelation != null) { - ptSegments.put(getWayIdsSignature(), extractedRelation); + ptSegments.put(wayIdsSignature, extractedRelation); } } From 74b0e754e302bbf40a0964687fc0cbfc22574e24 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 20 Sep 2020 15:20:47 +0200 Subject: [PATCH 20/52] some reshuffling and minor changes --- ...actRelationMembersToNewRelationAction.java | 45 ++++++++----------- .../pt_assistant/data/PTSegmentToExtract.java | 5 +-- 2 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 3fd114a7..8146b136 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -103,13 +103,14 @@ public void actionPerformed(ActionEvent actionEvent) { JOptionPane.QUESTION_MESSAGE ) == JOptionPane.OK_OPTION ) { - if (!cbFindAllSegmentsAutomatically.isSelected()) { + if (cbFindAllSegmentsAutomatically.isSelected()) { + splitInSegments(originalRelation, cbConvertToSuperroute.isSelected()); + } else { final Relation clonedRelation = new Relation(originalRelation); - boolean substituteWaysWithRelation = !cbReplaceInSuperrouteRelations.isSelected(); List selectedIndices = Arrays.stream(memberTableModel.getSelectedIndices()) .boxed().collect(Collectors.toList()); final Relation extractedRelation = extractMembersForIndicesAndSubstitute( - clonedRelation, selectedIndices, substituteWaysWithRelation); + clonedRelation, selectedIndices, !cbReplaceInSuperrouteRelations.isSelected()); if (extractedRelation != null) { if (extractedRelation.getId() <= 0) { if (cbConvertToSuperroute.isSelected()) { @@ -132,29 +133,13 @@ public void actionPerformed(ActionEvent actionEvent) { RelationEditor extraEditor = RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, emptyList()); extraEditor.setVisible(true); extraEditor.setAlwaysOnTop(true); - - try { - editor.reloadDataFromRelation(); - // todo this often gives index out of bounds exception - // I can't figure out why. - // catching it here causes the exception to occur when - // the user presses the update button, so not really a solution - // The update button appears if I remove 1 or 2 members before extracting - // so when the relation editor is 'dirty'. - // using memberTableModel.applyToRelation(originalRelation); - // at the beginning doesn't seem to actually save the relation - } catch (Exception e) { - Logging.error(e); - } } - } else { - splitInSegments(originalRelation); - editor.reloadDataFromRelation(); } + editor.reloadDataFromRelation(); } } - public void splitInSegments(Relation originalRelation) { + public void splitInSegments(Relation originalRelation, Boolean convertToSuperroute) { final Relation clonedRelation = new Relation(originalRelation); final long clonedRelationId = clonedRelation.getId(); boolean startNewSegment = false; @@ -166,14 +151,14 @@ public void splitInSegments(Relation originalRelation) { final Way currentWay = getIfWay(members, i); if (currentWay == null) { // Going backward through all the ways, the stop members were reached - segment.extractToRelation(new ArrayList(Arrays.asList("type", "route")), + segment.extractToRelation(new ArrayList<>(Arrays.asList("type", "route")), true); break; } final Way nextWay = getIfWay(members, i + 1); if (startNewSegment) { - segment.extractToRelation(new ArrayList(Arrays.asList("type", "route")), + segment.extractToRelation(new ArrayList<>(Arrays.asList("type", "route")), true); segment = new PTSegmentToExtract(clonedRelation); startNewSegment = false; @@ -186,14 +171,14 @@ public void splitInSegments(Relation originalRelation) { for (Relation parentRoute : parentRouteRelations) { if (parentRoute.getId() != clonedRelationId && RouteUtils.isVersionTwoPTRoute(parentRoute)) { for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay)) { - long previousWayInParentRouteId = 0; if (waysInParentRoute.previousWay == null || waysInParentRoute.nextWay == null) { // If there is no way before or a way after in the parent route // this was the first or the last way in the parent route // so a split is needed + // todo this doesn't work as intended yet startNewSegment = true; } - previousWayInParentRouteId = waysInParentRoute.previousWay.getId(); + long previousWayInParentRouteId = waysInParentRoute.previousWay != null ? waysInParentRoute.previousWay.getId() : 0; if (isItineraryInSameDirection(nextWay, waysInParentRoute.nextWay, previousWayId, previousWayInParentRouteId)) { if (!startNewSegment && previousWayInParentRouteId != 0 && previousWayId != previousWayInParentRouteId) { @@ -206,7 +191,10 @@ public void splitInSegments(Relation originalRelation) { routes isn't the same as currentWay a split is also needed */ if (!startNewSegment) { - startNewSegment = isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(previousWay, currentWay); + if (previousWay != null) { + startNewSegment = isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay( + previousWay, currentWay); + } } segment.addLineIdentifier(parentRoute.get("ref")); segment.addColour(parentRoute.get("colour")); @@ -218,6 +206,9 @@ public void splitInSegments(Relation originalRelation) { } } } + if (convertToSuperroute) { + clonedRelation.put("type", "superroute"); + } UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); } @@ -258,7 +249,7 @@ public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParent * for all occurrences of wayToLocate this method returns the way before it and the way after it * @param members The members list of the relation * @param wayToLocate The way to locate in the list - * @return a list of way pairs + * @return a list of way triplets */ private List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { final long wayToLocateId = wayToLocate.getId(); diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 1ff2cabb..e0c0ee3d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -10,7 +10,6 @@ import java.util.*; import java.util.stream.Collectors; -import static java.util.Collections.sort; import static org.openstreetmap.josm.gui.MainApplication.getLayerManager; import static org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor.RefTagComparator; @@ -26,7 +25,7 @@ public class PTSegmentToExtract { /** * */ - private static Map ptSegments; + private static final Map ptSegments; private final Relation relation; private Relation extractedRelation; @@ -42,8 +41,6 @@ public class PTSegmentToExtract { ptSegments = new HashMap<>(); } - private Boolean updateTags; - /** * Constructor * @param relation The route or superroute relation for which this route segment is created From acec22f32779211b656c6c6f1355369a01fa0c31 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 21 Sep 2020 10:07:08 +0200 Subject: [PATCH 21/52] removed some code duplication --- ...actRelationMembersToNewRelationAction.java | 78 +++++++------------ .../pt_assistant/data/PTSegmentToExtract.java | 50 ++++++++++-- 2 files changed, 69 insertions(+), 59 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 8146b136..bfd4010a 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -6,7 +6,6 @@ import javax.swing.*; -import org.openstreetmap.josm.command.AddCommand; import org.openstreetmap.josm.command.ChangeCommand; import org.openstreetmap.josm.command.Command; import org.openstreetmap.josm.command.SequenceCommand; @@ -24,7 +23,6 @@ import org.openstreetmap.josm.tools.*; import static java.util.Collections.*; -import static org.openstreetmap.josm.gui.MainApplication.*; /* Extracts selected members to a new route relation @@ -107,30 +105,32 @@ public void actionPerformed(ActionEvent actionEvent) { splitInSegments(originalRelation, cbConvertToSuperroute.isSelected()); } else { final Relation clonedRelation = new Relation(originalRelation); - List selectedIndices = Arrays.stream(memberTableModel.getSelectedIndices()) - .boxed().collect(Collectors.toList()); - final Relation extractedRelation = extractMembersForIndicesAndSubstitute( - clonedRelation, selectedIndices, !cbReplaceInSuperrouteRelations.isSelected()); + PTSegmentToExtract segment = new PTSegmentToExtract(clonedRelation, + Arrays.stream(memberTableModel.getSelectedIndices()).boxed().collect(Collectors.toList())); + segment.put("name", tfNameTag.getText()); + if (cbProposed.isSelected()) { + segment.put("state", "proposed"); + segment.put("name", tfNameTag.getText() + " (wenslijn)"); + } + if (cbDeviation.isSelected()) { + segment.put("name", tfNameTag.getText() + " (omleiding)"); + } + Relation extractedRelation = segment.extractToRelation( + new ArrayList<>(Arrays.asList("type", "route", "cycle_network", "network", "operator", "ref")), + true); +// todo cbReplaceInSuperrouteRelations.isSelected()); if (extractedRelation != null) { - if (extractedRelation.getId() <= 0) { - if (cbConvertToSuperroute.isSelected()) { - clonedRelation.put("type", "superroute"); - } - extractedRelation.put("name", tfNameTag.getText()); - if (cbProposed.isSelected()) { - extractedRelation.put("state", "proposed"); - extractedRelation.put("name", tfNameTag.getText() + " (wenslijn)"); - } - if (cbDeviation.isSelected()) { - extractedRelation.put("name", tfNameTag.getText() + " (omleiding)"); - } - DataSet activeDataSet = getLayerManager().getActiveDataSet(); - commands.add(new AddCommand(activeDataSet, extractedRelation)); + if (extractedRelation.getId() <= 0 && cbConvertToSuperroute.isSelected()) { + clonedRelation.put("type", "superroute"); } commands.add(new ChangeCommand(originalRelation, clonedRelation)); - addExtractedRelationToParentSuperrouteRelations(originalRelation, commands, parentRelations, selectedIndices, extractedRelation); - UndoRedoHandler.getInstance().add(new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); - RelationEditor extraEditor = RelationEditor.getEditor(getEditor().getLayer(), extractedRelation, emptyList()); + addExtractedRelationToParentSuperrouteRelations(originalRelation, commands, + parentRelations, segment.getIndices(), extractedRelation); + UndoRedoHandler.getInstance().add( + new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); + + RelationEditor extraEditor = RelationEditor.getEditor( + getEditor().getLayer(), extractedRelation, emptyList()); extraEditor.setVisible(true); extraEditor.setAlwaysOnTop(true); } @@ -177,6 +177,10 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou // so a split is needed // todo this doesn't work as intended yet startNewSegment = true; + String route_ref = parentRoute.get("route_ref"); + if (waysInParentRoute.nextWay == null && route_ref != null) { + new PTSegmentToExtract(parentRoute, false); + } } long previousWayInParentRouteId = waysInParentRoute.previousWay != null ? waysInParentRoute.previousWay.getId() : 0; if (isItineraryInSameDirection(nextWay, waysInParentRoute.nextWay, previousWayId, previousWayInParentRouteId)) { @@ -287,34 +291,6 @@ private List> findPreviousAndNextWayInRoute(List selectedIndices, - boolean substituteWaysWithRelation) { - Relation extractedRelation = new Relation(); - extractedRelation.setKeys(clonedRelation.getKeys()); - extractedRelation.put("type", "route"); - - int index = 0; - boolean atLeast1MemberAddedToExtractedRelation = false; - for (int i = selectedIndices.size() - 1; i >= 0; i--) { - atLeast1MemberAddedToExtractedRelation = true; - index = selectedIndices.get(i); - RelationMember relationMember = clonedRelation.removeMember(index); - extractedRelation.addMember(0, relationMember); - } - - if (atLeast1MemberAddedToExtractedRelation) { - if (substituteWaysWithRelation) { - // replace removed members with the extracted relation - index = PTSegmentToExtract.limitIntegerTo(index, clonedRelation.getMembersCount()); - clonedRelation.addMember(index, new RelationMember("", extractedRelation)); - } - } else { - return null; - } - return extractedRelation; - } - private void addExtractedRelationToParentSuperrouteRelations(Relation originalRelation, List commands, List parentRelations, List selectedIndices, Relation extractedRelation) { for (Relation superroute : parentRelations) { int index = 0; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index e0c0ee3d..31090eee 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -5,6 +5,7 @@ import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.data.osm.TagMap; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import java.util.*; @@ -36,6 +37,7 @@ public class PTSegmentToExtract { private List streetNames; private List wayIds; private String wayIdsSignature; + private TagMap tags; static { ptSegments = new HashMap<>(); @@ -61,6 +63,11 @@ public PTSegmentToExtract(Relation relation) { wayIds = null; } + /** + * Constructor + * @param existingRelation to be used when a potential sub route relation is encountered + * @param updateTags update the tags automatically? + */ public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { this.relation = null; extractedRelation = existingRelation; @@ -82,6 +89,23 @@ public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { ptSegments.put(getWayIdsSignature(), extractedRelation); } + public PTSegmentToExtract(Relation relation, List selectedIndices) { + this.relation = relation; + extractedRelation = null; + + ptWays = new ArrayList<>(); + indices = selectedIndices; + lineIdentifiers = new TreeSet<>(new RefTagComparator()); + colours = new TreeSet<>(); + tags = new TagMap(); + streetNames = null; + wayIds = null; + + for (Integer index : indices) { + addPTWay(index, false); + } + } + /** * Returns the PTWays of this route segment * @return the PTWays of this route segment @@ -95,10 +119,15 @@ public List getPTWays() { * @param index its index in the relation specified in the constructor */ public void addPTWay(Integer index) { + this.addPTWay(index, true); + } + public void addPTWay(Integer index, boolean updateIndices) { assert relation != null; final RelationMember member = relation.getMember(index); if(member.isWay()) { - indices.add(0, index); + if (updateIndices) { + indices.add(0, index); + } ptWays.add(0, member); addLineIdentifier(relation.get("ref")); addColour(relation.get("colour")); @@ -142,8 +171,7 @@ public void addLineIdentifier(String lineIdentifier) { */ public void addColour(String colour) { if (colour != null) { - String colourUppercase = colour.toUpperCase(); - colours.add(colourUppercase); + colours.add(colour.toUpperCase()); } } @@ -233,23 +261,23 @@ public List getIndices() { } public Relation extractToRelation(ArrayList tagsToTransfer, Boolean substituteWaysWithRelation) { + assert relation != null; boolean extractedRelationAlreadyExists = false; if (ptSegments.containsKey(getWayIdsSignature())) { extractedRelation = ptSegments.get(wayIdsSignature); extractedRelationAlreadyExists = true; } else { extractedRelation = new Relation(); + extractedRelation.setKeys(tags); for (String tag : tagsToTransfer) { - assert relation != null; extractedRelation.put(tag, relation.get(tag)); } extractedRelation.put("type", "route"); } - int index = 0; boolean atLeast1MemberAddedToExtractedRelation = false; + int index = 0; for (int i = indices.size() - 1; i >= 0; i--) { index = indices.get(i); - assert relation != null; RelationMember relationMember = relation.removeMember(index); if (!extractedRelationAlreadyExists && RouteUtils.isPTWay(relationMember)) { extractedRelation.addMember(0, relationMember); @@ -259,7 +287,9 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs if (atLeast1MemberAddedToExtractedRelation || extractedRelationAlreadyExists) { if (extractedRelation.getId() <= 0 && !extractedRelationAlreadyExists) { - updateTags(); + if (relation.hasTag("public_transport:version", "2")) { + updateTags(); + } UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), extractedRelation)); addPtSegment(); @@ -286,7 +316,7 @@ public void updateTags() { private void addPtSegment() { if (extractedRelation != null) { - ptSegments.put(wayIdsSignature, extractedRelation); + ptSegments.put(getWayIdsSignature(), extractedRelation); } } @@ -296,4 +326,8 @@ public static int limitIntegerTo(int index, int limit) { } return index; } + + public void put(String key, String value) { + tags.put(key, value); + } } From 2b6b7f42ddca9532fc830c06b8edf87104de94bc Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 21 Sep 2020 10:37:46 +0200 Subject: [PATCH 22/52] removed code duplication in those 3 constructors. Now there are 4 of them --- .../pt_assistant/data/PTSegmentToExtract.java | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 31090eee..53492024 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -27,17 +27,17 @@ public class PTSegmentToExtract { * */ private static final Map ptSegments; - private final Relation relation; + private Relation relation; private Relation extractedRelation; private ArrayList ptWays; - private final List indices; + private List indices; private final TreeSet lineIdentifiers; private final TreeSet colours; - private List streetNames; + private List streetNames = null; private List wayIds; private String wayIdsSignature; - private TagMap tags; + private final TagMap tags = new TagMap(); static { ptSegments = new HashMap<>(); @@ -45,39 +45,56 @@ public class PTSegmentToExtract { /** * Constructor - * @param relation The route or superroute relation for which this route segment is created * ptWays The list of PTWay members to extract * indices The indices corresponding to the ways * lineIdentifiers The ref tag of the route parent route relations of the ways * colours The colours of the public transport lines of this line bundle */ + private PTSegmentToExtract() { + ptWays = new ArrayList<>(); + lineIdentifiers = new TreeSet<>(new RefTagComparator()); + colours = new TreeSet<>(); + wayIds = null; + } + /** + * Constructor + * @param relation The route or superroute relation for which this route segment is created + * use addPTWay() to add ways one by one + */ public PTSegmentToExtract(Relation relation) { + this(); this.relation = relation; extractedRelation = null; - ptWays = new ArrayList<>(); indices = new ArrayList<>(); - lineIdentifiers = new TreeSet<>(new RefTagComparator()); - colours = new TreeSet<>(); - streetNames = null; - wayIds = null; + } + + /** + * Constructor + * @param relation The route or superroute relation for which this route segment is created + * @param selectedIndices ways will be added for these indices + */ + public PTSegmentToExtract(Relation relation, List selectedIndices) { + this(relation); + + indices = selectedIndices; + + for (Integer index : indices) { + addPTWay(index, false); + } } /** * Constructor * @param existingRelation to be used when a potential sub route relation is encountered - * @param updateTags update the tags automatically? + * @param updateTags update the tags automatically or not? */ public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { + this(); this.relation = null; extractedRelation = existingRelation; - ptWays = new ArrayList<>(); indices = new ArrayList<>(); - lineIdentifiers = new TreeSet<>(); - colours = new TreeSet<>(); - streetNames = null; - wayIds = null; this.ptWays = (ArrayList) existingRelation.getMembers().stream() .filter(RelationMember::isWay) @@ -89,23 +106,6 @@ public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { ptSegments.put(getWayIdsSignature(), extractedRelation); } - public PTSegmentToExtract(Relation relation, List selectedIndices) { - this.relation = relation; - extractedRelation = null; - - ptWays = new ArrayList<>(); - indices = selectedIndices; - lineIdentifiers = new TreeSet<>(new RefTagComparator()); - colours = new TreeSet<>(); - tags = new TagMap(); - streetNames = null; - wayIds = null; - - for (Integer index : indices) { - addPTWay(index, false); - } - } - /** * Returns the PTWays of this route segment * @return the PTWays of this route segment From 69f8bddee96481dcd1c5cb7169ddd5332e7cb49e Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 21 Sep 2020 11:00:11 +0200 Subject: [PATCH 23/52] added some Javadoc --- .../pt_assistant/data/PTSegmentToExtract.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java index 53492024..80b46eee 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java @@ -17,7 +17,14 @@ /** * Represents a piece of a route that includes all the ways * belonging to the same bundle of itineraries of vehicles - * traveling in the same direction + * traveling in the same direction in the case of public transport + * + * In case of 'personal' transport it contains all the ways for + * both directions of travel + * + * It is meant to help with extracting segments of ways from + * route relations so that these can be converted to superroute relations + * in a convenient way * * @author Polyglot * @@ -121,7 +128,14 @@ public List getPTWays() { public void addPTWay(Integer index) { this.addPTWay(index, true); } - public void addPTWay(Integer index, boolean updateIndices) { + + /** + * Sets the PTWays of this route segment to the given list + * @param index its index in the relation specified in the constructor + * @param updateIndices when the list of indices was set in the constructor + * don't update it anymore + */ + private void addPTWay(Integer index, boolean updateIndices) { assert relation != null; final RelationMember member = relation.getMember(index); if(member.isWay()) { @@ -260,6 +274,11 @@ public List getIndices() { return indices; } + /** + * @param tagsToTransfer list of tags to transfer from relation this segment will be extracted from + * @param substituteWaysWithRelation add the extracted relation where the ways were removed? + * @return the relation that contains the extracted ways, or null if an empty relation would have been created + */ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean substituteWaysWithRelation) { assert relation != null; boolean extractedRelationAlreadyExists = false; From 68654bf139457aeb5e50be68cb9a108d73e84ad1 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 21 Sep 2020 13:37:20 +0200 Subject: [PATCH 24/52] Create unit test for extracting PT segment --- ...actRelationMembersToNewRelationAction.java | 2 +- test/data/buses_before_splitting.osm | 20367 ++++++++++++++++ .../plugins/pt_assistant/AbstractTest.java | 2 + .../data/PTSegmentToExtractTest.java | 45 + 4 files changed, 20415 insertions(+), 1 deletion(-) create mode 100644 test/data/buses_before_splitting.osm create mode 100644 test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index bfd4010a..e735551e 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -120,7 +120,7 @@ public void actionPerformed(ActionEvent actionEvent) { true); // todo cbReplaceInSuperrouteRelations.isSelected()); if (extractedRelation != null) { - if (extractedRelation.getId() <= 0 && cbConvertToSuperroute.isSelected()) { + if (extractedRelation.isNew() && cbConvertToSuperroute.isSelected()) { clonedRelation.put("type", "superroute"); } commands.add(new ChangeCommand(originalRelation, clonedRelation)); diff --git a/test/data/buses_before_splitting.osm b/test/data/buses_before_splitting.osm new file mode 100644 index 00000000..2d6d59cd --- /dev/null +++ b/test/data/buses_before_splitting.osm @@ -0,0 +1,20367 @@ + + + +The data included in this document is from www.openstreetmap.org. The data is made available under ODbL. + +It was generated using this query on 2020-10-27: +[out:xml]; +( + relation(6695469); + relation(1606056); + relation(955908); + relation(3612781); + relation(3297543); + relation(2815); + relation(1583303); + relation(3297278); + relation(5451452); +); +out meta; +>; +out meta qt; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java index f2bfb053..05de4d9c 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java @@ -65,6 +65,8 @@ public abstract class AbstractTest { public static final String PATH_TO_BICYCLE_LOOP_BACK_TEST = "test/data/map4.osm"; + public static final String PATH_TO_PT_BEFORE_SPLITTING_TEST = "test/data/buses_before_splitting.osm"; + /** * Initiates the basic parts of JOSM. */ diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java new file mode 100644 index 00000000..792199c6 --- /dev/null +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java @@ -0,0 +1,45 @@ +package org.openstreetmap.josm.plugins.pt_assistant.data; + +import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.data.osm.DataSet; +import org.openstreetmap.josm.data.osm.Node; +import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.io.IllegalDataException; +import org.openstreetmap.josm.io.OsmReader; +import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.Collection; +import java.util.Collections; + +import static org.junit.jupiter.api.Assertions.*; + +class PTSegmentToExtractTest { + + private DataSet ds; + + @Before + public void init() throws FileNotFoundException, IllegalDataException { + ds = OsmReader.parseDataSet(new FileInputStream(AbstractTest.PATH_TO_PT_BEFORE_SPLITTING_TEST), null); + } + + @BeforeEach + void setUp() { + + } + + @Test + void someTest() { + Collection allRelations = ds.getRelations(); + Relation bus601RouteRelation = allRelations.stream().filter(relation -> relation.hasTag("ref", "601")).findFirst().get(); + PTSegmentToExtract segment = new PTSegmentToExtract(bus601RouteRelation); + assertEquals("601", segment.getLineIdentifiersSignature()); + segment.addLineIdentifier("600"); + assertEquals("600;601", segment.getLineIdentifiersSignature()); + assertEquals("", segment.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment.getPTWays()); + } +} From 0c178a8f1df7fef5e8650f40a30602a882a61c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Tue, 27 Oct 2020 16:33:57 +0100 Subject: [PATCH 25/52] Rename PTSegmentToExtract to RouteSegmentToExtract --- .../ExtractRelationMembersToNewRelationAction.java | 12 ++++++------ ...mentToExtract.java => RouteSegmentToExtract.java} | 10 +++++----- .../pt_assistant/data/PTSegmentToExtractTest.java | 3 +-- 3 files changed, 12 insertions(+), 13 deletions(-) rename src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/{PTSegmentToExtract.java => RouteSegmentToExtract.java} (97%) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index e735551e..74bba240 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -17,7 +17,7 @@ import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; -import org.openstreetmap.josm.plugins.pt_assistant.data.PTSegmentToExtract; +import org.openstreetmap.josm.plugins.pt_assistant.data.RouteSegmentToExtract; import org.openstreetmap.josm.plugins.pt_assistant.data.WayTriplet; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import org.openstreetmap.josm.tools.*; @@ -105,7 +105,7 @@ public void actionPerformed(ActionEvent actionEvent) { splitInSegments(originalRelation, cbConvertToSuperroute.isSelected()); } else { final Relation clonedRelation = new Relation(originalRelation); - PTSegmentToExtract segment = new PTSegmentToExtract(clonedRelation, + RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation, Arrays.stream(memberTableModel.getSelectedIndices()).boxed().collect(Collectors.toList())); segment.put("name", tfNameTag.getText()); if (cbProposed.isSelected()) { @@ -144,7 +144,7 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou final long clonedRelationId = clonedRelation.getId(); boolean startNewSegment = false; final List members = clonedRelation.getMembers(); - PTSegmentToExtract segment = new PTSegmentToExtract(clonedRelation); + RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); segment.addPTWay(members.size() - 1); for (int i = members.size() - 2; i >= 1; i--) { final Way previousWay = getIfWay(members, i - 1); @@ -160,7 +160,7 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou if (startNewSegment) { segment.extractToRelation(new ArrayList<>(Arrays.asList("type", "route")), true); - segment = new PTSegmentToExtract(clonedRelation); + segment = new RouteSegmentToExtract(clonedRelation); startNewSegment = false; } segment.addPTWay(i); @@ -179,7 +179,7 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou startNewSegment = true; String route_ref = parentRoute.get("route_ref"); if (waysInParentRoute.nextWay == null && route_ref != null) { - new PTSegmentToExtract(parentRoute, false); + new RouteSegmentToExtract(parentRoute, false); } } long previousWayInParentRouteId = waysInParentRoute.previousWay != null ? waysInParentRoute.previousWay.getId() : 0; @@ -303,7 +303,7 @@ private void addExtractedRelationToParentSuperrouteRelations(Relation originalRe // the position where this relation was in the parent index++; } - index = PTSegmentToExtract.limitIntegerTo(index, superroute.getMembersCount()); + index = RouteSegmentToExtract.limitIntegerTo(index, superroute.getMembersCount()); clonedParentRelation.addMember(index, new RelationMember("", extractedRelation)); commands.add(new ChangeCommand(superroute, clonedParentRelation)); break; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java similarity index 97% rename from src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java rename to src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 80b46eee..718c826e 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -29,7 +29,7 @@ * @author Polyglot * */ -public class PTSegmentToExtract { +public class RouteSegmentToExtract { /** * */ @@ -57,7 +57,7 @@ public class PTSegmentToExtract { * lineIdentifiers The ref tag of the route parent route relations of the ways * colours The colours of the public transport lines of this line bundle */ - private PTSegmentToExtract() { + private RouteSegmentToExtract() { ptWays = new ArrayList<>(); lineIdentifiers = new TreeSet<>(new RefTagComparator()); colours = new TreeSet<>(); @@ -68,7 +68,7 @@ private PTSegmentToExtract() { * @param relation The route or superroute relation for which this route segment is created * use addPTWay() to add ways one by one */ - public PTSegmentToExtract(Relation relation) { + public RouteSegmentToExtract(Relation relation) { this(); this.relation = relation; extractedRelation = null; @@ -81,7 +81,7 @@ public PTSegmentToExtract(Relation relation) { * @param relation The route or superroute relation for which this route segment is created * @param selectedIndices ways will be added for these indices */ - public PTSegmentToExtract(Relation relation, List selectedIndices) { + public RouteSegmentToExtract(Relation relation, List selectedIndices) { this(relation); indices = selectedIndices; @@ -96,7 +96,7 @@ public PTSegmentToExtract(Relation relation, List selectedIndices) { * @param existingRelation to be used when a potential sub route relation is encountered * @param updateTags update the tags automatically or not? */ - public PTSegmentToExtract(Relation existingRelation, Boolean updateTags) { + public RouteSegmentToExtract(Relation existingRelation, Boolean updateTags) { this(); this.relation = null; extractedRelation = existingRelation; diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java index 792199c6..05882ec2 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java @@ -4,7 +4,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openstreetmap.josm.data.osm.DataSet; -import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.io.OsmReader; @@ -35,7 +34,7 @@ void setUp() { void someTest() { Collection allRelations = ds.getRelations(); Relation bus601RouteRelation = allRelations.stream().filter(relation -> relation.hasTag("ref", "601")).findFirst().get(); - PTSegmentToExtract segment = new PTSegmentToExtract(bus601RouteRelation); + RouteSegmentToExtract segment = new RouteSegmentToExtract(bus601RouteRelation); assertEquals("601", segment.getLineIdentifiersSignature()); segment.addLineIdentifier("600"); assertEquals("600;601", segment.getLineIdentifiersSignature()); From ccf71f505c08e8a676ed52f3a9a8dcc8b5b9bec5 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 27 Sep 2020 10:09:21 +0200 Subject: [PATCH 26/52] created unit test for bus line 601. It's a circular line, which reuses 3 segments --- ...actRelationMembersToNewRelationAction.java | 10 +- .../data/RouteSegmentToExtract.java | 285 ++++++- .../data/PTSegmentToExtractTest.java | 3 +- .../data/RouteSegmentToExtractTest.java | 716 ++++++++++++++++++ 4 files changed, 976 insertions(+), 38 deletions(-) create mode 100644 test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 74bba240..73aa68aa 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -116,7 +116,7 @@ public void actionPerformed(ActionEvent actionEvent) { segment.put("name", tfNameTag.getText() + " (omleiding)"); } Relation extractedRelation = segment.extractToRelation( - new ArrayList<>(Arrays.asList("type", "route", "cycle_network", "network", "operator", "ref")), + Arrays.asList("type", "route", "cycle_network", "network", "operator", "ref"), true); // todo cbReplaceInSuperrouteRelations.isSelected()); if (extractedRelation != null) { @@ -145,13 +145,13 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou boolean startNewSegment = false; final List members = clonedRelation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); - segment.addPTWay(members.size() - 1); + segment.addWay(members.size() - 1); for (int i = members.size() - 2; i >= 1; i--) { final Way previousWay = getIfWay(members, i - 1); final Way currentWay = getIfWay(members, i); if (currentWay == null) { // Going backward through all the ways, the stop members were reached - segment.extractToRelation(new ArrayList<>(Arrays.asList("type", "route")), + segment.extractToRelation(Arrays.asList("type", "route"), true); break; } @@ -163,7 +163,7 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou segment = new RouteSegmentToExtract(clonedRelation); startNewSegment = false; } - segment.addPTWay(i); + segment.addWay(i); long previousWayId = 0; if (previousWay != null) {previousWayId = previousWay.getId();} @@ -255,7 +255,7 @@ public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParent * @param wayToLocate The way to locate in the list * @return a list of way triplets */ - private List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + private static List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { final long wayToLocateId = wayToLocate.getId(); Way previousWay; Way nextWay = null; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 718c826e..522ac3be 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -2,17 +2,19 @@ package org.openstreetmap.josm.plugins.pt_assistant.data; import org.openstreetmap.josm.command.AddCommand; -import org.openstreetmap.josm.data.UndoRedoHandler; -import org.openstreetmap.josm.data.osm.Relation; -import org.openstreetmap.josm.data.osm.RelationMember; -import org.openstreetmap.josm.data.osm.TagMap; +import org.openstreetmap.josm.command.Command; +import org.openstreetmap.josm.command.SequenceCommand; +import org.openstreetmap.josm.data.osm.*; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; +import org.openstreetmap.josm.tools.Utils; import java.util.*; import java.util.stream.Collectors; import static org.openstreetmap.josm.gui.MainApplication.getLayerManager; import static org.openstreetmap.josm.plugins.pt_assistant.gui.PTAssistantPaintVisitor.RefTagComparator; +import static org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils.isPTWay; +import static org.openstreetmap.josm.tools.I18n.tr; /** * Represents a piece of a route that includes all the ways @@ -30,14 +32,12 @@ * */ public class RouteSegmentToExtract { - /** - * - */ private static final Map ptSegments; + private DataSet activeDataSet; private Relation relation; private Relation extractedRelation; - private ArrayList ptWays; + private ArrayList wayMembers; private List indices; private final TreeSet lineIdentifiers; private final TreeSet colours; @@ -58,10 +58,11 @@ public class RouteSegmentToExtract { * colours The colours of the public transport lines of this line bundle */ private RouteSegmentToExtract() { - ptWays = new ArrayList<>(); + wayMembers = new ArrayList<>(); lineIdentifiers = new TreeSet<>(new RefTagComparator()); colours = new TreeSet<>(); wayIds = null; + activeDataSet = getLayerManager().getActiveDataSet(); } /** * Constructor @@ -74,11 +75,25 @@ public RouteSegmentToExtract(Relation relation) { extractedRelation = null; indices = new ArrayList<>(); + addLineIdentifier(relation.get("ref")); + addColour(relation.get("colour")); } /** * Constructor * @param relation The route or superroute relation for which this route segment is created + * use addPTWay() to add ways one by one + * @param ds for the unit tests the dataset is the one of the file loaded + * if it's determined automatically it weirdly uses another DataSet + */ + public RouteSegmentToExtract(Relation relation, DataSet ds) { + this(relation); + activeDataSet = ds; + } + + /** + * Constructor for use with non PT route relations + * @param relation The route or superroute relation for which this route segment is created * @param selectedIndices ways will be added for these indices */ public RouteSegmentToExtract(Relation relation, List selectedIndices) { @@ -87,13 +102,14 @@ public RouteSegmentToExtract(Relation relation, List selectedIndices) { indices = selectedIndices; for (Integer index : indices) { - addPTWay(index, false); + addWay(index, false); } } /** * Constructor * @param existingRelation to be used when a potential sub route relation is encountered + * while processing a PT route relation * @param updateTags update the tags automatically or not? */ public RouteSegmentToExtract(Relation existingRelation, Boolean updateTags) { @@ -103,7 +119,7 @@ public RouteSegmentToExtract(Relation existingRelation, Boolean updateTags) { indices = new ArrayList<>(); - this.ptWays = (ArrayList) existingRelation.getMembers().stream() + this.wayMembers = (ArrayList) existingRelation.getMembers().stream() .filter(RelationMember::isWay) .filter(RouteUtils::isPTWay) .collect(Collectors.toList()); @@ -114,46 +130,244 @@ public RouteSegmentToExtract(Relation existingRelation, Boolean updateTags) { } /** - * Returns the PTWays of this route segment - * @return the PTWays of this route segment + * @return the WayMembers of this route segment */ - public List getPTWays() { - return ptWays; + public List getWayMembers() { + return wayMembers; } /** - * Sets the PTWays of this route segment to the given list + * Sets the WayMembers of this route segment to the given list * @param index its index in the relation specified in the constructor */ - public void addPTWay(Integer index) { - this.addPTWay(index, true); + public void addWay(Integer index) { + this.addWay(index, true); } /** - * Sets the PTWays of this route segment to the given list + * Sets the WayMembers of this route segment to the given list * @param index its index in the relation specified in the constructor - * @param updateIndices when the list of indices was set in the constructor + * @param updateIndices when the list of indices was set by the constructor * don't update it anymore */ - private void addPTWay(Integer index, boolean updateIndices) { + private void addWay(Integer index, boolean updateIndices) { assert relation != null; final RelationMember member = relation.getMember(index); if(member.isWay()) { if (updateIndices) { indices.add(0, index); } - ptWays.add(0, member); - addLineIdentifier(relation.get("ref")); - addColour(relation.get("colour")); + wayMembers.add(0, member); streetNames = null; wayIds = null; } } + public RouteSegmentToExtract addPTWayMember(Integer index) { + assert relation != null; + final RelationMember member = relation.getMember(index); + RelationMember previousMember; + Way previousWay = null; + if (member.isWay() && isPTWay(member)) { + boolean startNewSegment = false; + if (index > 1) { + previousMember = relation.getMember(index - 1); + if (isPTWay(previousMember)) { + previousWay = previousMember.getWay(); + } + } + Way currentWay = member.getWay(); + Way nextWay = null; + if (index < relation.getMembersCount()-1) { + final RelationMember nextMember = relation.getMember(index + 1); + if (nextMember.isWay()) { + nextWay = nextMember.getWay(); + } + } + Way wayAfterNextWay = null; + if (index < relation.getMembersCount()-2) { + final RelationMember nextNextMember = relation.getMember(index + 2); + if (nextNextMember.isWay()) { + wayAfterNextWay = nextNextMember.getWay(); + } else if (nextNextMember.isRelation()) { + wayAfterNextWay = nextNextMember.getRelation().getMember(0).getWay(); + } + } + if (wayMembers.size() == 0) { + addWay(index, true); + } else { + List parentRouteRelations = + Utils.filteredCollection(currentWay.getReferrers(), Relation.class).stream() + .filter(r -> r.getId() != relation.getId()) + .filter(RouteUtils::isVersionTwoPTRoute) + .collect(Collectors.toList()); + ArrayList itinerariesInSameDirection = new ArrayList<>(); + for (Relation parentRoute : parentRouteRelations) { + final List parentRouteMembers = parentRoute.getMembers(); + List ways = new ArrayList<>(); + for (RelationMember rm : parentRouteMembers) { + if (rm.isWay()) { + ways.add(rm.getWay()); + } + } + if (ways.contains(currentWay)) { + for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRouteMembers, currentWay)) { + if (isItineraryInSameDirection(previousWay, nextWay, waysInParentRoute)) { + itinerariesInSameDirection.add(parentRoute); + } + } + } + } + for (Relation parentRoute : itinerariesInSameDirection) { + boolean addToLineIdentifier = true; + Way lastWayInParentRoute = null; + List members = parentRoute.getMembers(); + for (int j = members.size() - 1; j>=0 ; j--) { + RelationMember rm = members.get(j); + if (rm.isWay() && RouteUtils.isPTWay(rm)) { + lastWayInParentRoute = rm.getWay(); + break; + } + } + if (currentWay == lastWayInParentRoute) { + startNewSegment = true; + } + + for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay)) { + if (waysInParentRoute.nextWay != null) { + if (!nextWay.equals(waysInParentRoute.nextWay)){ + // if one of the parent relations has a different next way + // it's time to start a new segment + startNewSegment = true; + addToLineIdentifier = false; + } else { + addLineIdentifier(parentRoute.get("ref")); + addColour(parentRoute.get("colour")); + } + } + } + /* + If the previous way before the next way's parent + routes isn't the same as currentWay a split is also needed + */ + if (isPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfNextWay( + currentWay, nextWay, wayAfterNextWay)) { + startNewSegment = true; + } else if (addToLineIdentifier) { + addLineIdentifier(parentRoute.get("ref")); + addColour(parentRoute.get("colour")); + } + } + + boolean currentWayIsFirstWayInOneOfTheParentWays = false; + Way firstWayInParent = null; + for (Relation prRel : parentRouteRelations) { + for (RelationMember rm : prRel.getMembers()) { + if (rm.isWay() && isPTWay(rm)) { + if (firstWayInParent == null) { + firstWayInParent = rm.getWay(); + } else { + if (rm.getWay() == nextWay && firstWayInParent == currentWay) { + currentWayIsFirstWayInOneOfTheParentWays = true; + addLineIdentifier(prRel.get("ref")); + addColour(prRel.get("colour")); + } + break; + } + } + } + } + if (itinerariesInSameDirection.isEmpty() && index < relation.getMembersCount() - 2) { + final RelationMember nextMember = relation.getMember(index + 2); + if (nextMember.isRelation()) { + Relation previousRelation = nextMember.getRelation(); + if (!lineIdentifiers.first().equals(previousRelation.get("route_ref"))) { + startNewSegment = true; + } + } + } + if (startNewSegment + || itinerariesInSameDirection.isEmpty() && lineIdentifiers.size() > 1 + || currentWayIsFirstWayInOneOfTheParentWays) { + RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation, activeDataSet); + newSegment.addPTWayMember(index); + return newSegment; + } else { + addWay(index); + } + } + } + return null; + } + + private boolean isPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfNextWay( + Way currentWay, Way nextWay, Way wayAfterNextWay) { + List parentRoutesOfNextWay = + Utils.filteredCollection(nextWay.getReferrers(), Relation.class).stream() + .filter(RouteUtils::isVersionTwoPTRoute) + .collect(Collectors.toList()); + + for (Relation parentRouteOfNextWay : parentRoutesOfNextWay) { + for (WayTriplet waysInParentRouteOfNextWay : findPreviousAndNextWayInRoute(parentRouteOfNextWay.getMembers(), nextWay)) { + if (isItineraryInSameDirection(currentWay, wayAfterNextWay, waysInParentRouteOfNextWay)) { + if (waysInParentRouteOfNextWay.previousWay != null + && !waysInParentRouteOfNextWay.previousWay.equals(currentWay)) { + return true; + } + } + } + } + return false; + } + + private boolean isItineraryInSameDirection(Way previousWay, Way nextWay, + WayTriplet waysInParentRoute) { + if (previousWay != null && nextWay != null) { + return !(previousWay.equals(waysInParentRoute.nextWay) || + nextWay.equals(waysInParentRoute.previousWay)); + } + return false; + } + + /** + * for all occurrences of wayToLocate this method returns the way before it and the way after it + * @param members The members list of the relation + * @param wayToLocate The way to locate in the list + * @return a list of way triplets + */ + private static List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + final long wayToLocateId = wayToLocate.getId(); + Way previousWay; + Way nextWay = null; + boolean foundWay = false; + List> wayTriplets = new ArrayList<>(); + for (int j = members.size() - 1; j>=0 ; j--) { + RelationMember rm = members.get(j); + if (rm.isWay() && RouteUtils.isPTWay(rm)) { + previousWay = rm.getWay(); + if (foundWay) { + if (previousWay == wayToLocate) { + previousWay = null; + } + wayTriplets.add(0, new WayTriplet<>(previousWay,wayToLocate,nextWay)); + nextWay = null; + foundWay = false; + continue; + } + if (previousWay.getId() == wayToLocateId) { + foundWay = true; + } else { + nextWay = previousWay; + } + } + } + return wayTriplets; + } + public List getWayIds() { if (wayIds == null) { wayIds = new ArrayList<>(); - for (RelationMember rm : ptWays) { + for (RelationMember rm : wayMembers) { wayIds.add(String.valueOf(rm.getWay().getId())); } } @@ -218,7 +432,7 @@ public List getStreetNames() { if (streetNames == null) { streetNames = new ArrayList<>(); String streetName; - for (RelationMember rm : ptWays) { + for (RelationMember rm : wayMembers) { streetName = rm.getWay().get("name"); if (streetName == null) { streetName = rm.getWay().get("ref"); @@ -279,7 +493,7 @@ public List getIndices() { * @param substituteWaysWithRelation add the extracted relation where the ways were removed? * @return the relation that contains the extracted ways, or null if an empty relation would have been created */ - public Relation extractToRelation(ArrayList tagsToTransfer, Boolean substituteWaysWithRelation) { + public Relation extractToRelation(List tagsToTransfer, Boolean substituteWaysWithRelation) { assert relation != null; boolean extractedRelationAlreadyExists = false; if (ptSegments.containsKey(getWayIdsSignature())) { @@ -298,8 +512,9 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs for (int i = indices.size() - 1; i >= 0; i--) { index = indices.get(i); RelationMember relationMember = relation.removeMember(index); - if (!extractedRelationAlreadyExists && RouteUtils.isPTWay(relationMember)) { - extractedRelation.addMember(0, relationMember); + if (!extractedRelationAlreadyExists && isPTWay(relationMember)) { + extractedRelation.addMember(0, + new RelationMember("", relationMember.getMember())); atLeast1MemberAddedToExtractedRelation = true; } } @@ -309,13 +524,12 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs if (relation.hasTag("public_transport:version", "2")) { updateTags(); } - UndoRedoHandler.getInstance().add(new AddCommand(getLayerManager().getActiveDataSet(), - extractedRelation)); + getExtractRelationCommand().executeCommand(); addPtSegment(); } if (substituteWaysWithRelation) { // replace removed members with the extracted relation - relation.addMember(limitIntegerTo(index, relation.getMembersCount()-1), + relation.addMember(limitIntegerTo(index, relation.getMembersCount()), new RelationMember("", extractedRelation)); } } else { @@ -324,6 +538,13 @@ public Relation extractToRelation(ArrayList tagsToTransfer, Boolean subs return extractedRelation; } + public Command getExtractRelationCommand() { + List commands = new ArrayList<>(); + commands.add(new AddCommand(activeDataSet, extractedRelation)); + + return new SequenceCommand(tr("Extract sub relation"), commands); + } + public void updateTags() { final String lineIdentifiersSignature = getLineIdentifiersSignature(); extractedRelation.put("note", diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java index 05882ec2..792199c6 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openstreetmap.josm.data.osm.DataSet; +import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.io.OsmReader; @@ -34,7 +35,7 @@ void setUp() { void someTest() { Collection allRelations = ds.getRelations(); Relation bus601RouteRelation = allRelations.stream().filter(relation -> relation.hasTag("ref", "601")).findFirst().get(); - RouteSegmentToExtract segment = new RouteSegmentToExtract(bus601RouteRelation); + PTSegmentToExtract segment = new PTSegmentToExtract(bus601RouteRelation); assertEquals("601", segment.getLineIdentifiersSignature()); segment.addLineIdentifier("600"); assertEquals("600;601", segment.getLineIdentifiersSignature()); diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java new file mode 100644 index 00000000..6254e3f1 --- /dev/null +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -0,0 +1,716 @@ +package org.openstreetmap.josm.plugins.pt_assistant.data; + +import org.junit.BeforeClass; +import org.junit.Test; +import org.openstreetmap.josm.data.osm.DataSet; +import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.data.osm.Way; +import org.openstreetmap.josm.io.IllegalDataException; +import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.*; + +import static org.junit.Assert.*; +import static org.openstreetmap.josm.io.OsmReader.parseDataSet; + +@SuppressWarnings("NonAsciiCharacters") +public class RouteSegmentToExtractTest { + + private static DataSet ds; + + @BeforeClass + public static void init() throws FileNotFoundException, IllegalDataException { + ds = parseDataSet(new FileInputStream(AbstractTest.PATH_TO_PT_BEFORE_SPLITTING_TEST), null); + } + + @Test + public void bus601Test() { + Collection allRelations = ds.getRelations(); + + Relation bus601RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 3612781) + .findFirst().orElse(null); + + assertNotNull(bus601RouteRelation); + Relation cloneOfBus601RouteRelation = new Relation(bus601RouteRelation); + assertNotNull(cloneOfBus601RouteRelation); + RouteSegmentToExtract segment1 = new RouteSegmentToExtract(cloneOfBus601RouteRelation, ds); + assertEquals(cloneOfBus601RouteRelation.get("ref"), segment1.getLineIdentifiersSignature()); + assertEquals(cloneOfBus601RouteRelation.get("colour"), segment1.getColoursSignature()); + + assertNull(segment1.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment1.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment1.getWayMembers()); + + final int W_158_perron1and2terminus_78579065_B = 78579065; + final int W_157_perron1and2_377814547_A = 377814547; + + final int W_156_TiensevestToPerron1_79596986_A = 79596986; + + RouteSegmentToExtract returnValueNull = segment1.addPTWayMember(158); + assertNull(returnValueNull); + returnValueNull = segment1.addPTWayMember(157); + assertNull(returnValueNull); + RouteSegmentToExtract segment2 = segment1.addPTWayMember(156); + + final Way veryLastWay = segment1.getWayMembers().get(1).getWay(); + assertEquals("perron 1 & 2", veryLastWay.get("ref")); + assertEquals(W_158_perron1and2terminus_78579065_B, veryLastWay.getId()); + final Way beforeLastWay = segment1.getWayMembers().get(0).getWay(); + assertEquals("perron 1 & 2", beforeLastWay.get("ref")); + assertEquals(W_157_perron1and2_377814547_A, beforeLastWay.getId()); + + // segment2 was created, extract segment1 to its own relation + extractAndAssertValues(156, segment1, segment2, cloneOfBus601RouteRelation, + W_157_perron1and2_377814547_A, W_158_perron1and2terminus_78579065_B, + W_156_TiensevestToPerron1_79596986_A, null, + "#1199DD;#229922;#771133;#77CCAA;#8899AA;#991199;#995511;#BB0022;#BBDD00;#C5AA77;#DD0077;#DD5555;#FF88AA;#FFCC11", + "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658" + ); + + final int W_155_Tiensevest_5_79211473_A = 79211473; + RouteSegmentToExtract segment3 = segment2.addPTWayMember(155); + + // segment3 was created, verify segment2 + extractAndAssertValues(155, segment2, segment3, cloneOfBus601RouteRelation, + W_156_TiensevestToPerron1_79596986_A, W_156_TiensevestToPerron1_79596986_A, + W_155_Tiensevest_5_79211473_A, "Tiensevest", + null, + "305;306;310;318;358;410;433;475;485;601;658" + ); + + final int W_154_Tiensevest_4_79211472_A = 79211472; + RouteSegmentToExtract segment4 = segment3.addPTWayMember(154); + + // segment4 was created, verify segment3 + extractAndAssertValues(154, segment3, segment4, cloneOfBus601RouteRelation, + W_155_Tiensevest_5_79211473_A, W_155_Tiensevest_5_79211473_A, + W_154_Tiensevest_4_79211472_A, "Tiensevest", + null, + "1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" + ); + + final int W_153_Tiensevest_3_79211472_A = 79175435; + RouteSegmentToExtract segment5 = segment4.addPTWayMember(153); + + // segment5 was created, verify segment4 + extractAndAssertValues(153, segment4, segment5, cloneOfBus601RouteRelation, + W_154_Tiensevest_4_79211472_A, W_154_Tiensevest_4_79211472_A, + W_153_Tiensevest_3_79211472_A, "Tiensevest", + null, + "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;658" + ); + + final int W_152_Tiensevest_2_80458208_A = 80458208; + RouteSegmentToExtract segment6 = segment5.addPTWayMember(152); + + // segment6 was created, verify segment5 + extractAndAssertValues(152, segment5, segment6, cloneOfBus601RouteRelation, + W_153_Tiensevest_3_79211472_A, W_153_Tiensevest_3_79211472_A, + W_152_Tiensevest_2_80458208_A, "Tiensevest", + null, + "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;651;652;658" + ); + + final int W_33_151_Tiensevest_1_19793164_A = 19793164; + RouteSegmentToExtract segment7 = segment6.addPTWayMember(151); + + // segment7 was created, verify segment6 + extractAndAssertValues(151, segment6, segment7, cloneOfBus601RouteRelation, + W_152_Tiensevest_2_80458208_A, W_152_Tiensevest_2_80458208_A, + W_33_151_Tiensevest_1_19793164_A, "Tiensevest", + null, + "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658" + ); + + final int W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D = 6184898; +// final int W_31_149_Diestsevest_3_81457878_C = 81457878; +// final int W_30_148_Diestsevest_2_4003924_B = 4003924; + final int W_29_147_Diestsevest_1_8133608_A = 8133608; + + final int W_28_146_Artoisplein_2_254800931_A = 254800931; + + RouteSegmentToExtract segment8 = segment7.addPTWayMember(150); + Relation rel8 = extractAndAssertValues(150, segment7, segment8, cloneOfBus601RouteRelation, + W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, + W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", + null, + "305;318;334;335;358;410;513;601;630;651;652;658" + ); + + for (int n = 149; n >= 147; n--) returnValueNull = segment8.addPTWayMember(n); assertNull(returnValueNull); + + final int W_145_Artoisplein_1_23691158_E = 23691158; +// final int W_144_Lüdenscheidsingel_5_254800932_D = 254800932; +// final int W_143_Lüdenscheidsingel_4_44932921_C = 44932921; +// final int W_142_Lüdenscheidsingel_3_3993388_B = 3993388; + final int W_141_Lüdenscheidsingel_2_109267417_A = 109267417; + RouteSegmentToExtract segment9 = segment8.addPTWayMember(146); + + Relation rel9 = extractAndAssertValues(146, segment8, segment9, cloneOfBus601RouteRelation, + W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, + W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", + null, + "305;318;334;335;358;410;513;601;630;651;652;658" + ); + + RouteSegmentToExtract segment10 = segment9.addPTWayMember(145); + Relation rel10 = extractAndAssertValues(145, segment9, segment10, cloneOfBus601RouteRelation, + W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, + W_145_Artoisplein_1_23691158_E, "Joanna-Maria Artoisplein", + null, + "178;305;318;358;410;601;651;652;658" + ); + for (int n = 144; n >= 141; n--) returnValueNull = segment10.addPTWayMember(n); assertNull(returnValueNull); + + final int W_140_Lüdenscheidsingel_1_3993387_E = 3993387; +// final int W_139_R23_2_8131125_D = 8131125; +// final int W_138_R23_1_3877105_C = 3877105; +// final int W_137_Den_Boschsingel_1_146171871_B = 146171871; + final int W_136_Den_Boschsingel_2_23837544_A = 23837544; + final int W_135_Den_Boschsingel_3_225605630_E = 225605630; + RouteSegmentToExtract segment11 = segment10.addPTWayMember(140); + extractAndAssertValues(140, segment10, segment11, cloneOfBus601RouteRelation, + W_141_Lüdenscheidsingel_2_109267417_A, W_145_Artoisplein_1_23691158_E, + W_140_Lüdenscheidsingel_1_3993387_E, "Lüdenscheidsingel", + null, + "178;305;318;358;410;601;651;652;658" + ); + for (int n = 139; n >= 136; n--) returnValueNull = segment11.addPTWayMember(n); assertNull(returnValueNull); + + RouteSegmentToExtract segment12 = segment11.addPTWayMember(135); + + extractAndAssertValues(135, segment11, segment12, cloneOfBus601RouteRelation, + W_136_Den_Boschsingel_2_23837544_A, W_140_Lüdenscheidsingel_1_3993387_E, + W_135_Den_Boschsingel_3_225605630_E, "Den Boschsingel", + null, + "318;358;410;601;651;658" + ); + for (int n = 134; n >= 131; n--) returnValueNull = segment12.addPTWayMember(n); assertNull(returnValueNull); + +// final int W_134_Den_Boschsingel_4_8131121_D = 8131121; +// final int W_133_Rennes_Singel_3_3680456_C = 3680456; +// final int W_132_Rennes_Singel_2_3994257_B = 3994257; + final int W_131_Rennes_Singel_1_249333185_A = 249333185; + + final int W_99_130_Herestraat_1_249333184_AC = 249333184; +// final int W_100_129_Herestraat_2_813970231_BB = 813970231; + final int W_128_Herestraat_11_681081951_A = 681081951; + RouteSegmentToExtract segment13 = segment12.addPTWayMember(130); + + extractAndAssertValues(130, segment12, segment13, cloneOfBus601RouteRelation, + W_131_Rennes_Singel_1_249333185_A, W_135_Den_Boschsingel_3_225605630_E, + W_99_130_Herestraat_1_249333184_AC, "Herestraat", + null, + "318;410;601" + ); + + returnValueNull = segment13.addPTWayMember(129); + assertNull(returnValueNull); + returnValueNull = segment13.addPTWayMember(128); + assertNull(returnValueNull); + final int W_127_Herestraat_10_813970227_C = 813970227; +// final int W_126_Herestraat_9_41403544_B = 41403544; + final int W_125_Herestraat_8_8079995_A = 8079995; + RouteSegmentToExtract segment14 = segment13.addPTWayMember(127); + + extractAndAssertValues(127, segment13, segment14, cloneOfBus601RouteRelation, + W_128_Herestraat_11_681081951_A, W_99_130_Herestraat_1_249333184_AC, + W_127_Herestraat_10_813970227_C, "Herestraat", + null, + "410;601" + ); + for (int n = 126; n >= 125; n--) returnValueNull = segment14.addPTWayMember(n); assertNull(returnValueNull); + + final int W_124_Rotonde_Het_Teken_41403538_B = 41403538; + final int W_123_Ring_Zuid_79340950_A = 79340950; + RouteSegmentToExtract segment15 = segment14.addPTWayMember(124); + + extractAndAssertValues(124, segment14, segment15, cloneOfBus601RouteRelation, + W_125_Herestraat_8_8079995_A, W_127_Herestraat_10_813970227_C, + W_124_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", + null, + "410;600;601" + ); + + returnValueNull = segment15.addPTWayMember(123); assertNull(returnValueNull); + + final int W_122_Ring_Zuid_11369123_A = 11369123; + RouteSegmentToExtract segment16 = segment15.addPTWayMember(122); + + extractAndAssertValues(122, segment15, segment16, cloneOfBus601RouteRelation, + W_123_Ring_Zuid_79340950_A, W_124_Rotonde_Het_Teken_41403538_B, + W_122_Ring_Zuid_11369123_A, "Ring Zuid", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + final int W_121__159949154_A = 159949154; + final int W_120__332258104_B = 332258104; + final int W_119_GHB_ingang_78852604_A = 78852604; + RouteSegmentToExtract segment17 = segment16.addPTWayMember(121); + + extractAndAssertValues(121, segment16, segment17, cloneOfBus601RouteRelation, + W_122_Ring_Zuid_11369123_A, W_122_Ring_Zuid_11369123_A, + W_121__159949154_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + final int W_118_GHB_p5_377918641_B = 377918641; + final int W_117_GHB_p5_14508736_A = 14508736; + RouteSegmentToExtract segment18 = segment17.addPTWayMember(120); + + extractAndAssertValues(120, segment17, segment18, cloneOfBus601RouteRelation, + W_121__159949154_A, W_121__159949154_A, + W_120__332258104_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + returnValueNull = segment18.addPTWayMember(119); assertNull(returnValueNull); + + final int W_116_Ring_Zuid_p45_109267436_A = 109267436; + RouteSegmentToExtract segment19 = segment18.addPTWayMember(118); + + extractAndAssertValues(118, segment18, segment19, cloneOfBus601RouteRelation, + W_119_GHB_ingang_78852604_A, W_120__332258104_B, + W_118_GHB_p5_377918641_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + returnValueNull = segment19.addPTWayMember(117); assertNull(returnValueNull); + + final int W_115_Ring_Zuid_p3_14508739_A = 14508739; + RouteSegmentToExtract segment20 = segment19.addPTWayMember(116); + + extractAndAssertValues(116, segment19, segment20, cloneOfBus601RouteRelation, + W_117_GHB_p5_14508736_A, W_118_GHB_p5_377918641_B, + W_116_Ring_Zuid_p45_109267436_A, "Ring Zuid", + null, + "3;317;395;410;601" + ); + final int W_114_Ring_Zuid_p2_14508740_A = 14508740; + RouteSegmentToExtract segment21 = segment20.addPTWayMember(115); + + extractAndAssertValues(115, segment20, segment21, cloneOfBus601RouteRelation, + W_116_Ring_Zuid_p45_109267436_A, W_116_Ring_Zuid_p45_109267436_A, + W_115_Ring_Zuid_p3_14508739_A, "Ring Zuid", + null, + "3;317;395;410;600;601" + ); + + final int W_113_Ring_Zuid_p1_502328838_D = 502328838; + final int W_112_Ring_Zuid_502328837_C = 502328837; + final int W_111_Ring_Zuid_8080023_B = 8080023; + final int W_110_Rotonde_Het_Teken_78568660_A = 78568660; + + RouteSegmentToExtract segment22 = segment21.addPTWayMember(114); + extractAndAssertValues(114, segment21, segment22, cloneOfBus601RouteRelation, + W_115_Ring_Zuid_p3_14508739_A, W_115_Ring_Zuid_p3_14508739_A, + W_114_Ring_Zuid_p2_14508740_A, "Ring Zuid", + null, + "3;317;334;335;395;410;600;601" + ); + + RouteSegmentToExtract segment23 = segment22.addPTWayMember(113); + extractAndAssertValues(113, segment22, segment23, cloneOfBus601RouteRelation, + W_114_Ring_Zuid_p2_14508740_A, W_114_Ring_Zuid_p2_14508740_A, + W_113_Ring_Zuid_p1_502328838_D, "Ring Zuid", + null, + "3;317;334;335;380;395;410;600;601" + ); + for (int n = 112; n >= 110; n--) returnValueNull = segment23.addPTWayMember(n); assertNull(returnValueNull); + + final int W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A = 78873921; + + RouteSegmentToExtract segment24 = segment23.addPTWayMember(109); + extractAndAssertValues(109, segment23, segment24, cloneOfBus601RouteRelation, + W_110_Rotonde_Het_Teken_78568660_A, W_113_Ring_Zuid_p1_502328838_D, + W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601" + ); + + final int W_108_Rotonde_Het_Teken_3752557_A = 3752557; + + RouteSegmentToExtract segment25 = segment24.addPTWayMember(108); + extractAndAssertValues(108, segment24, segment25, cloneOfBus601RouteRelation, + W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, + W_108_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601" + ); + + final int W_107_Rotonde_Het_Teken_VWBln_249333188_A = 249333188; + + RouteSegmentToExtract segment26 = segment25.addPTWayMember(107); + extractAndAssertValues(107, segment25, segment26, cloneOfBus601RouteRelation, + W_108_Rotonde_Het_Teken_3752557_A, W_108_Rotonde_Het_Teken_3752557_A, + W_107_Rotonde_Het_Teken_VWBln_249333188_A, "Rotonde Het Teken", + null, + "3;410;600;601" + ); + final int W_106_Rotonde_Het_Teken_249333187_A = 249333187; + + RouteSegmentToExtract segment27 = segment26.addPTWayMember(106); + extractAndAssertValues(106, segment26, segment27, cloneOfBus601RouteRelation, + W_107_Rotonde_Het_Teken_VWBln_249333188_A, W_107_Rotonde_Het_Teken_VWBln_249333188_A, + W_106_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", + null, + "3;410;600;601" + ); + + final int W_105_Herestraat_7_13067134_D = 13067134; + final int W_104_Herestraat_6_813970232_C = 813970232; + final int W_103_Herestraat_5_813970226_B = 813970226; + final int W_102_Herestraat_4_813970228_A = 813970228; + + RouteSegmentToExtract segment28 = segment27.addPTWayMember(105); + extractAndAssertValues(105, segment27, segment28, cloneOfBus601RouteRelation, + W_106_Rotonde_Het_Teken_249333187_A, W_106_Rotonde_Het_Teken_249333187_A, + W_105_Herestraat_7_13067134_D, "Herestraat", + null, + "410;600;601" + ); + + final int W_101_Herestraat_3_813970229_C = 813970229; + // 99 and 100 are defined as 129 and 130 + + for (int n = 104; n >= 102; n--) returnValueNull = segment28.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment29 = segment28.addPTWayMember(101); + extractAndAssertValues(101, segment28, segment29, cloneOfBus601RouteRelation, + W_102_Herestraat_4_813970228_A, W_105_Herestraat_7_13067134_D, + W_101_Herestraat_3_813970229_C, "Herestraat", + null, + "410;600;601" + ); + + final int W_98_Rennes_Singel_249333186_H = 249333186; + final int W_97_Rennes_Singel_192559628_G = 192559628; + final int W_96_Rennes_Singel_161166589_F = 161166589; + final int W_95_Rennes_Singel_813979470_E = 813979470; + final int W_94_Rennes_Singel_79289746_D = 79289746; + final int W_93_Rennes_Singel_813979472_C = 813979472; + final int W_92_Rennes_Singel_8131120_B = 8131120; + final int W_91_Rennes_Singel_429706864_A = 429706864; + + for (int n = 100; n >= 99; n--) returnValueNull = segment29.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment30 = segment29.addPTWayMember(98); + extractAndAssertValues(98, segment29, segment30, cloneOfBus601RouteRelation, + W_99_130_Herestraat_1_249333184_AC, W_101_Herestraat_3_813970229_C, + W_98_Rennes_Singel_249333186_H, "Rennes-Singel", + null, + "601" + ); + + final int W_90_Tervuursevest_99583853_K = 99583853; + final int W_89_Tervuursevest_521193379_J = 521193379; + final int W_88_Tervuursevest_521193380_I = 521193380; + final int W_87_Tervuursevest_813979465_H = 813979465; + final int W_86_Tervuursevest_174338458_G = 174338458; + final int W_85_Tervuursevest_608715520_F = 608715520; + final int W_84_Tervuursevest_608715521_E = 608715521; + final int W_83_Tervuursevest_3677944_D = 3677944; + final int W_82_Tervuursevest_174338459_C = 174338459; + final int W_81_Tervuursevest_429706866_B = 429706866; + final int W_80_Tervuursevest_88361317_A = 88361317; + for (int n = 97; n >= 91; n--) returnValueNull = segment30.addPTWayMember(n); assertNull(returnValueNull); + + RouteSegmentToExtract segment31 = segment30.addPTWayMember(90); + + extractAndAssertValues(90, segment30, segment31, cloneOfBus601RouteRelation, + W_91_Rennes_Singel_429706864_A, W_98_Rennes_Singel_249333186_H, + W_90_Tervuursevest_99583853_K, "Tervuursevest", + null, + "318;601" + ); + final int W_79_Tervuursevest_Kapucijnenvoer_461159345_A = 461159345; + for (int n = 89; n >= 80; n--) returnValueNull = segment31.addPTWayMember(n); assertNull(returnValueNull); + + RouteSegmentToExtract segment32 = segment31.addPTWayMember(79); + + extractAndAssertValues(79, segment31, segment32, cloneOfBus601RouteRelation, + W_80_Tervuursevest_88361317_A, W_90_Tervuursevest_99583853_K, + W_79_Tervuursevest_Kapucijnenvoer_461159345_A, "Tervuursevest", + null, + "601" + ); + final int W_78_Tervuursevest_461159362_K = 461159362; + final int W_77_Tervuursevest_344507822_J = 344507822; + final int W_76_Tervuursevest_461159367_I = 461159367; + final int W_75_Tervuursevest_3677335_H = 3677335; + final int W_74_Tervuursevest_31474001_G = 31474001; + final int W_73_Tervuursevest_23237288_F = 23237288; + final int W_72_Tervuursevest_90168773_E = 90168773; + final int W_71_Tervuursevest_23237287_D = 23237287; + final int W_70_Tervuursevest_608715561_C = 608715561; + final int W_69_Tervuursevest_608715562_B = 608715562; + final int W_68_Tervuursevest_3677330_A = 3677330; + RouteSegmentToExtract segment33 = segment32.addPTWayMember(78); + + extractAndAssertValues(78, segment32, segment33, cloneOfBus601RouteRelation, + W_79_Tervuursevest_Kapucijnenvoer_461159345_A, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, + W_78_Tervuursevest_461159362_K, "Tervuursevest", + null, + "178;179;306 (student);601" + ); + + final int W_67_Naamsevest_86164005_G = 86164005; + final int W_66_Naamsevest_655251293_F = 655251293; + final int W_65_Naamsevest_131571763_E = 131571763; + final int W_64_Naamsevest_661733369_D = 661733369; + final int W_63_Naamsevest_655251292_C = 655251292; + final int W_62_Naamsevest_3677823_B = 3677823; + final int W_61_Geldenaaksevest_24905257_A = 24905257; + + final int W_60_Geldenaaksevest_608715605_H = 608715605; + final int W_59_Geldenaaksevest_608715606_G = 608715606; + final int W_58_Geldenaaksevest_79299303_F = 79299303; + final int W_57_Geldenaaksevest_10296368_E = 10296368; + final int W_56_Geldenaaksevest_521193607_D = 521193607; + final int W_55_Geldenaaksevest_94585453_C = 94585453; + final int W_54_Geldenaaksevest_586268893_B = 586268893; + final int W_53_Geldenaaksevest_8130906_A = 8130906; + + for (int n = 77; n >= 68; n--) returnValueNull = segment33.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment34 = segment33.addPTWayMember(67); + extractAndAssertValues(67, segment33, segment34, cloneOfBus601RouteRelation, + W_68_Tervuursevest_3677330_A, W_78_Tervuursevest_461159362_K, + W_67_Naamsevest_86164005_G, "Naamsevest", + null, + "178;179;306 (student);520;524;525;537;601" + ); + + final int W_52_Tiensepoort_16775171_D = 16775171; + final int W_51_Tiensevest_8131717_C = 8131717; + final int W_50_Tiensevest_12712557_B = 12712557; + final int W_49_Tiensevest_Oostertunnel_8590231_A = 8590231; + for (int n = 66; n >= 62; n--) returnValueNull = segment34.addPTWayMember(n); assertNull(returnValueNull); + + RouteSegmentToExtract segment35 = segment34.addPTWayMember(61); + extractAndAssertValues(61, segment34, segment35, cloneOfBus601RouteRelation, + W_62_Naamsevest_3677823_B, W_67_Naamsevest_86164005_G, + W_61_Geldenaaksevest_24905257_A, "Geldenaaksevest", + null, + "18;178;179;306 (student);337;601;616" + ); + for (int n = 60; n >= 53; n--) returnValueNull = segment35.addPTWayMember(n); assertNull(returnValueNull); + + RouteSegmentToExtract segment36 = segment35.addPTWayMember(52); + + extractAndAssertValues(52, segment35, segment36, cloneOfBus601RouteRelation, + W_53_Geldenaaksevest_8130906_A, W_61_Geldenaaksevest_24905257_A, + W_52_Tiensepoort_16775171_D, "Tiensepoort", + null, + "18;178;179;306 (student);337;601;616;630" + ); + final int W_48_Tiensevest_185988814_A = 185988814; + for (int n = 51; n >= 49; n--) returnValueNull = segment36.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment37 = segment36.addPTWayMember(48); + + extractAndAssertValues(48, segment36, segment37, cloneOfBus601RouteRelation, + W_49_Tiensevest_Oostertunnel_8590231_A, W_52_Tiensepoort_16775171_D, + W_48_Tiensevest_185988814_A, "Tiensevest", + null, + "7;8;9;18;178;179;306 (student);337;380;527;601;616;630" + ); + + final int W_47_Martelarenplein_76856823_D = 76856823; + final int W_46_Martelarenplein_459446598_C = 459446598; + final int W_45_Martelarenplein_459446600_B = 459446600; + final int W_44__78815533_A = 78815533; + + RouteSegmentToExtract segment38 = segment37.addPTWayMember(47); + extractAndAssertValues(47, segment37, segment38, cloneOfBus601RouteRelation, + W_48_Tiensevest_185988814_A, W_48_Tiensevest_185988814_A, + W_47_Martelarenplein_76856823_D, "Martelarenplein", + null, + "7;8;9;18;178;179;306 (student);337;380;527;601;630" + ); + + final int W_43__79264899_A = 79264899; + + for (int n = 46; n >= 44; n--) returnValueNull = segment38.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment39 = segment38.addPTWayMember(43); + extractAndAssertValues(43, segment38, segment39, cloneOfBus601RouteRelation, + W_44__78815533_A, W_47_Martelarenplein_76856823_D, + W_43__79264899_A, null, + null, + "7;8;9;18;178;179;306 (student);337;380;527;601;630" + ); + final int W_42__377918635_A = 377918635; + + RouteSegmentToExtract segment40 = segment39.addPTWayMember(42); + extractAndAssertValues(42, segment39, segment40, cloneOfBus601RouteRelation, + W_43__79264899_A, W_43__79264899_A, + W_42__377918635_A, null, + null, + "18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601" + ); + final int W_41__79264888_A = 79264888; + + RouteSegmentToExtract segment41 = segment40.addPTWayMember(41); + extractAndAssertValues(41, segment40, segment41, cloneOfBus601RouteRelation, + W_42__377918635_A, W_42__377918635_A, + W_41__79264888_A, null, + null, + "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601" + ); + final int W_40__79264897_A = 79264897; + + RouteSegmentToExtract segment42 = segment41.addPTWayMember(40); + extractAndAssertValues(40, segment41, segment42, cloneOfBus601RouteRelation, + W_41__79264888_A, W_41__79264888_A, + W_40__79264897_A, null, + null, + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601" + ); + final int W_39__71754927_A = 71754927; + + RouteSegmentToExtract segment43 = segment42.addPTWayMember(39); + extractAndAssertValues(39, segment42, segment43, cloneOfBus601RouteRelation, + W_40__79264897_A, W_40__79264897_A, + W_39__71754927_A, null, + null, + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601" + ); + final int W_38__377918638_A_TEC18 = 377918638; + + RouteSegmentToExtract segment44 = segment43.addPTWayMember(38); + extractAndAssertValues(38, segment43, segment44, cloneOfBus601RouteRelation, + W_39__71754927_A, W_39__71754927_A, + W_38__377918638_A_TEC18, null, + null, + "18;601" // TODO: this is odd, needs verification + ); + final int W_37__79264891_A = 79264891; + + RouteSegmentToExtract segment45 = segment44.addPTWayMember(37); + extractAndAssertValues(37, segment44, segment45, cloneOfBus601RouteRelation, + W_38__377918638_A_TEC18, W_38__377918638_A_TEC18, + W_37__79264891_A, null, + null, + "18;601" + ); + final int W_36_Tiensevest_78568409_A = 78568409; + + RouteSegmentToExtract segment46 = segment45.addPTWayMember(36); + extractAndAssertValues(36, segment45, segment46, cloneOfBus601RouteRelation, + W_37__79264891_A, W_37__79264891_A, + W_36_Tiensevest_78568409_A, "Tiensevest", + null, + "18;601" + ); + final int W_35_Tiensevest_79193579_A = 79193579; + + RouteSegmentToExtract segment47 = segment46.addPTWayMember(35); + extractAndAssertValues(35, segment46, segment47, cloneOfBus601RouteRelation, + W_36_Tiensevest_78568409_A, W_36_Tiensevest_78568409_A, + W_35_Tiensevest_79193579_A, "Tiensevest", + null, + "4;5;6;7;8;9;18;179;306 (student);334;335;337;380;601;616;658" + ); + final int W_34_Bend_19793394_A = 19793394; + // ways 28 to 33 are the same as 146 - 151 + final int W_27_Zoutstraat_3992548_A = 3992548; + + RouteSegmentToExtract segment48 = segment47.addPTWayMember(34); + + extractAndAssertValues(34, segment47, segment48, cloneOfBus601RouteRelation, + W_35_Tiensevest_79193579_A, W_35_Tiensevest_79193579_A, + W_34_Bend_19793394_A, null, + null, + "334;335;513;601" + ); + final int W_26_Havenkant_510790349_M = 510790349; + final int W_25_Havenkant_510790348_L = 510790348; + final int W_24_Havenkant_314635787_K = 314635787; + final int W_23_Havenkant_843534478_J = 843534478; + final int W_22_Havenkant_406205781_I = 406205781; + final int W_21_Havenkant_270181176_H = 270181176; + final int W_20_Havenkant_330300725_G = 330300725; + final int W_19_Burchtstraat_3869822_F = 3869822; + final int W_18_Achter_de_latten_330300723_E = 330300723; + final int W_17_Wolvengang_659297690_D = 659297690; + final int W_16_Wolvengang_25928482_C = 25928482; + final int W_15_Engels_Plein_3869812_B = 3869812; + final int W_14_Engels_Plein_338057820_A = 338057820; + + RouteSegmentToExtract segment49 = segment48.addPTWayMember(33); + extractAndAssertValues(33, segment48, segment49, cloneOfBus601RouteRelation, + W_34_Bend_19793394_A, W_34_Bend_19793394_A, + W_33_151_Tiensevest_1_19793164_A, "Tiensevest", + null, + "334;335;513;601" + ); + + RouteSegmentToExtract segment50 = segment49.addPTWayMember(32); + Relation rel50 = extractAndAssertValues(32, segment49, segment50, cloneOfBus601RouteRelation, + W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, + W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", + null, + "305;318;334;335;358;410;513;601;630;651;652;658" + ); + assertEquals(rel8.getId(), rel50.getId()); + + for (int n = 31; n >= 29; n--) returnValueNull = segment50.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment51 = segment50.addPTWayMember(28); + Relation rel51 = extractAndAssertValues(28, segment50, segment51, cloneOfBus601RouteRelation, + W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, + W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", + null, + "305;318;334;335;358;410;513;601;630;651;652;658" + ); + assertEquals(rel9.getId(), rel51.getId()); + + RouteSegmentToExtract segment52 = segment51.addPTWayMember(27); + Relation rel52 = extractAndAssertValues(27, segment51, segment52, cloneOfBus601RouteRelation, + W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, + W_27_Zoutstraat_3992548_A, "Zoutstraat", + null, + "334;335;513;601;630" + ); + assertEquals(rel10.getId(), rel52.getId()); + + RouteSegmentToExtract segment53 = segment52.addPTWayMember(26); + extractAndAssertValues(26, segment52, segment53, cloneOfBus601RouteRelation, + W_27_Zoutstraat_3992548_A, W_27_Zoutstraat_3992548_A, + W_26_Havenkant_510790349_M, "Havenkant", + null, + "601" + ); + + for (int n = 25; n >= 14; n--) returnValueNull = segment53.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment54 = segment53.addPTWayMember(13); + extractAndAssertValues(13, segment53, segment54, cloneOfBus601RouteRelation, + W_14_Engels_Plein_338057820_A, W_26_Havenkant_510790349_M, + 0, null, + null, + "601" + ); + } + + public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, + Relation superRouteRelation, int firstWayId, int lastWayId, int firstWayIdForNewSegment, + String nameOfNewWay, + String expectedColours, String expectedRouteRef) { + Relation extractedRelation = createdSegment.extractToRelation(Arrays.asList("type", "route"), true); + System.out.println(extractedRelation.get("note")); + assertEquals("first way not correct", firstWayId, extractedRelation.firstMember().getWay().getId()); + assertEquals("last way not correct", lastWayId, extractedRelation.lastMember().getWay().getId()); + if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); + assertEquals(expectedRouteRef, createdSegment.getLineIdentifiersSignature()); + + assertEquals("relation id not correct", extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); + // newSegment should have the last way we tried to add to this segment + if (firstWayIdForNewSegment != 0) { + assertEquals("name of last added way not correct", nameOfNewWay, newSegment.getWayMembers().get(0).getWay().get("name")); + assertEquals("id of first way not correct", firstWayIdForNewSegment, newSegment.getWayMembers().get(0).getWay().getId()); + } + return extractedRelation; + } +} From e4a522de6a7abbf11f3411e346682be75cfbd564 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 27 Sep 2020 14:58:11 +0200 Subject: [PATCH 27/52] I removed the code from the Action file, it's now in the RouteSegmentToExtract class. Some refactoring, the simpler tests in if go first and fixed a todo item. --- ...actRelationMembersToNewRelationAction.java | 148 ++---------------- .../data/RouteSegmentToExtract.java | 16 +- .../data/PTSegmentToExtractTest.java | 45 ------ 3 files changed, 20 insertions(+), 189 deletions(-) delete mode 100644 test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 73aa68aa..150cb5b9 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -118,14 +118,16 @@ public void actionPerformed(ActionEvent actionEvent) { Relation extractedRelation = segment.extractToRelation( Arrays.asList("type", "route", "cycle_network", "network", "operator", "ref"), true); -// todo cbReplaceInSuperrouteRelations.isSelected()); if (extractedRelation != null) { if (extractedRelation.isNew() && cbConvertToSuperroute.isSelected()) { clonedRelation.put("type", "superroute"); } commands.add(new ChangeCommand(originalRelation, clonedRelation)); - addExtractedRelationToParentSuperrouteRelations(originalRelation, commands, - parentRelations, segment.getIndices(), extractedRelation); + if (cbReplaceInSuperrouteRelations.isSelected()) { + addExtractedRelationToParentSuperrouteRelations( + originalRelation, commands, parentRelations, + segment.getIndices(), extractedRelation); + } UndoRedoHandler.getInstance().add( new SequenceCommand(I18n.tr("Extract ways to relation"), commands)); @@ -141,148 +143,22 @@ public void actionPerformed(ActionEvent actionEvent) { public void splitInSegments(Relation originalRelation, Boolean convertToSuperroute) { final Relation clonedRelation = new Relation(originalRelation); - final long clonedRelationId = clonedRelation.getId(); - boolean startNewSegment = false; final List members = clonedRelation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); - segment.addWay(members.size() - 1); - for (int i = members.size() - 2; i >= 1; i--) { - final Way previousWay = getIfWay(members, i - 1); - final Way currentWay = getIfWay(members, i); - if (currentWay == null) { - // Going backward through all the ways, the stop members were reached - segment.extractToRelation(Arrays.asList("type", "route"), - true); - break; - } - final Way nextWay = getIfWay(members, i + 1); - - if (startNewSegment) { - segment.extractToRelation(new ArrayList<>(Arrays.asList("type", "route")), - true); - segment = new RouteSegmentToExtract(clonedRelation); - startNewSegment = false; - } - segment.addWay(i); - - long previousWayId = 0; - if (previousWay != null) {previousWayId = previousWay.getId();} - List parentRouteRelations = new ArrayList<>(Utils.filteredCollection(currentWay.getReferrers(), Relation.class)); - for (Relation parentRoute : parentRouteRelations) { - if (parentRoute.getId() != clonedRelationId && RouteUtils.isVersionTwoPTRoute(parentRoute)) { - for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay)) { - if (waysInParentRoute.previousWay == null || waysInParentRoute.nextWay == null) { - // If there is no way before or a way after in the parent route - // this was the first or the last way in the parent route - // so a split is needed - // todo this doesn't work as intended yet - startNewSegment = true; - String route_ref = parentRoute.get("route_ref"); - if (waysInParentRoute.nextWay == null && route_ref != null) { - new RouteSegmentToExtract(parentRoute, false); - } - } - long previousWayInParentRouteId = waysInParentRoute.previousWay != null ? waysInParentRoute.previousWay.getId() : 0; - if (isItineraryInSameDirection(nextWay, waysInParentRoute.nextWay, previousWayId, previousWayInParentRouteId)) { - if (!startNewSegment && previousWayInParentRouteId != 0 - && previousWayId != previousWayInParentRouteId) { - // if one of the parent relations has a different previous way - // it's time to start a new segment - startNewSegment = true; - } - /* - If the next way after the previous way's parent - routes isn't the same as currentWay a split is also needed - */ - if (!startNewSegment) { - if (previousWay != null) { - startNewSegment = isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay( - previousWay, currentWay); - } - } - segment.addLineIdentifier(parentRoute.get("ref")); - segment.addColour(parentRoute.get("colour")); - } - if (startNewSegment) { - break; - } - } - } + RouteSegmentToExtract newSegment = null; + for (int i = members.size() - 1; i >= 1; i--) { + newSegment = segment.addPTWayMember(i); + if (newSegment != null) { + segment.extractToRelation(Arrays.asList("type", "route"), true); + segment = newSegment; } } + segment.extractToRelation(Arrays.asList("type", "route"), true); if (convertToSuperroute) { clonedRelation.put("type", "superroute"); } UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); } - - public Way getIfWay(List members, int index) { - RelationMember member = members.get(index); - if (member.isWay()) return member.getWay(); - return null; - } - - public boolean isNextWayOfPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfPreviousWay(Way previousWay, Way currentWay) { - List parentRoutesOfPreviousWay = new ArrayList<>(Utils.filteredCollection(previousWay.getReferrers(), Relation.class)); - for (Relation parentRouteOfPreviousWay : parentRoutesOfPreviousWay) { - if (RouteUtils.isVersionTwoPTRoute(parentRouteOfPreviousWay)) { - List> prevAndNextParent = findPreviousAndNextWayInRoute(parentRouteOfPreviousWay.getMembers(), previousWay); - Way nextWayInParentRouteOfPreviousWay = null; - if (prevAndNextParent.size() > 0) { - // todo what if the way occurs more than once in the parent route of the previous way? - nextWayInParentRouteOfPreviousWay = prevAndNextParent.get(0).nextWay; -// if (nextWayInParentRouteOfPreviousWay != null) { -// String nextWayInParentRouteOfPreviousWayName = nextWayInParentRouteOfPreviousWay.get("name"); -// } - } - if (nextWayInParentRouteOfPreviousWay != null - && nextWayInParentRouteOfPreviousWay.getId() != currentWay.getId()) { - return true; - } - } - } - return false; - } - - public boolean isItineraryInSameDirection(Way nextWayMember, Way nextWayInParentRoute, long previousWayId, long previousWayInParentRouteId) { - return !(nextWayInParentRoute != null && previousWayId == nextWayInParentRoute.getId() || - previousWayInParentRouteId != 0 && nextWayMember.getId() == previousWayInParentRouteId); - } - - /** - * for all occurrences of wayToLocate this method returns the way before it and the way after it - * @param members The members list of the relation - * @param wayToLocate The way to locate in the list - * @return a list of way triplets - */ - private static List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { - final long wayToLocateId = wayToLocate.getId(); - Way previousWay; - Way nextWay = null; - boolean foundWay = false; - List> wayTriplets = new ArrayList<>(); - for (int j = members.size() - 1; j>=0 ; j--) { - RelationMember rm = members.get(j); - if (rm.isWay() && RouteUtils.isPTWay(rm)) { - previousWay = rm.getWay(); - if (foundWay) { - if (previousWay == wayToLocate) { - previousWay = null; - } - wayTriplets.add(0, new WayTriplet<>(previousWay,wayToLocate,nextWay)); - nextWay = null; - foundWay = false; - continue; - } - if (previousWay.getId() == wayToLocateId) { - foundWay = true; - } else { - nextWay = previousWay; - } - } - } - return wayTriplets; - } /** This method modifies clonedRelation in place if substituteWaysWithRelation is true * and if ways are extracted into a new relation * It takes a list of (preferably) consecutive indices diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 522ac3be..4309bedb 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -251,7 +251,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { routes isn't the same as currentWay a split is also needed */ if (isPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfNextWay( - currentWay, nextWay, wayAfterNextWay)) { + currentWay, nextWay, wayAfterNextWay)) { startNewSegment = true; } else if (addToLineIdentifier) { addLineIdentifier(parentRoute.get("ref")); @@ -287,8 +287,9 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } } if (startNewSegment - || itinerariesInSameDirection.isEmpty() && lineIdentifiers.size() > 1 - || currentWayIsFirstWayInOneOfTheParentWays) { + || currentWayIsFirstWayInOneOfTheParentWays + || itinerariesInSameDirection.isEmpty() && lineIdentifiers.size() > 1 + ) { RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation, activeDataSet); newSegment.addPTWayMember(index); return newSegment; @@ -309,11 +310,10 @@ private boolean isPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfNe for (Relation parentRouteOfNextWay : parentRoutesOfNextWay) { for (WayTriplet waysInParentRouteOfNextWay : findPreviousAndNextWayInRoute(parentRouteOfNextWay.getMembers(), nextWay)) { - if (isItineraryInSameDirection(currentWay, wayAfterNextWay, waysInParentRouteOfNextWay)) { - if (waysInParentRouteOfNextWay.previousWay != null - && !waysInParentRouteOfNextWay.previousWay.equals(currentWay)) { - return true; - } + if (waysInParentRouteOfNextWay.previousWay != null + && !waysInParentRouteOfNextWay.previousWay.equals(currentWay) + && isItineraryInSameDirection(currentWay, wayAfterNextWay, waysInParentRouteOfNextWay)) { + return true; } } } diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java deleted file mode 100644 index 792199c6..00000000 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/PTSegmentToExtractTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openstreetmap.josm.plugins.pt_assistant.data; - -import org.junit.Before; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.openstreetmap.josm.data.osm.DataSet; -import org.openstreetmap.josm.data.osm.Node; -import org.openstreetmap.josm.data.osm.Relation; -import org.openstreetmap.josm.io.IllegalDataException; -import org.openstreetmap.josm.io.OsmReader; -import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.util.Collection; -import java.util.Collections; - -import static org.junit.jupiter.api.Assertions.*; - -class PTSegmentToExtractTest { - - private DataSet ds; - - @Before - public void init() throws FileNotFoundException, IllegalDataException { - ds = OsmReader.parseDataSet(new FileInputStream(AbstractTest.PATH_TO_PT_BEFORE_SPLITTING_TEST), null); - } - - @BeforeEach - void setUp() { - - } - - @Test - void someTest() { - Collection allRelations = ds.getRelations(); - Relation bus601RouteRelation = allRelations.stream().filter(relation -> relation.hasTag("ref", "601")).findFirst().get(); - PTSegmentToExtract segment = new PTSegmentToExtract(bus601RouteRelation); - assertEquals("601", segment.getLineIdentifiersSignature()); - segment.addLineIdentifier("600"); - assertEquals("600;601", segment.getLineIdentifiersSignature()); - assertEquals("", segment.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment.getPTWays()); - } -} From a1ef4f9fa51fae8d01c34abcc877a5a8c844df0e Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Thu, 1 Oct 2020 23:51:21 +0200 Subject: [PATCH 28/52] Wrote test cases for 1 complete itinerary and started on cases for another. Almost completely rewrote the addPtWay() method --- .../data/RouteSegmentToExtract.java | 265 +++++++++--------- .../data/RouteSegmentToExtractTest.java | 188 +++++++++++-- 2 files changed, 286 insertions(+), 167 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 4309bedb..b1ba73c8 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -6,6 +6,7 @@ import org.openstreetmap.josm.command.SequenceCommand; import org.openstreetmap.josm.data.osm.*; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; +import org.openstreetmap.josm.plugins.pt_assistant.utils.WayUtils; import org.openstreetmap.josm.tools.Utils; import java.util.*; @@ -33,12 +34,14 @@ */ public class RouteSegmentToExtract { private static final Map ptSegments; + private static final Map> parentRelationsForSameDirectionOfTravel; private DataSet activeDataSet; private Relation relation; private Relation extractedRelation; private ArrayList wayMembers; private List indices; + private List itinerariesInSameDirection; private final TreeSet lineIdentifiers; private final TreeSet colours; private List streetNames = null; @@ -48,6 +51,7 @@ public class RouteSegmentToExtract { static { ptSegments = new HashMap<>(); + parentRelationsForSameDirectionOfTravel = new HashMap<>(); } /** @@ -64,8 +68,10 @@ private RouteSegmentToExtract() { wayIds = null; activeDataSet = getLayerManager().getActiveDataSet(); } + /** * Constructor + * * @param relation The route or superroute relation for which this route segment is created * use addPTWay() to add ways one by one */ @@ -81,10 +87,11 @@ public RouteSegmentToExtract(Relation relation) { /** * Constructor + * * @param relation The route or superroute relation for which this route segment is created * use addPTWay() to add ways one by one - * @param ds for the unit tests the dataset is the one of the file loaded - * if it's determined automatically it weirdly uses another DataSet + * @param ds for the unit tests the dataset is the one of the file loaded + * if it's determined automatically it weirdly uses another DataSet */ public RouteSegmentToExtract(Relation relation, DataSet ds) { this(relation); @@ -93,7 +100,8 @@ public RouteSegmentToExtract(Relation relation, DataSet ds) { /** * Constructor for use with non PT route relations - * @param relation The route or superroute relation for which this route segment is created + * + * @param relation The route or superroute relation for which this route segment is created * @param selectedIndices ways will be added for these indices */ public RouteSegmentToExtract(Relation relation, List selectedIndices) { @@ -108,9 +116,10 @@ public RouteSegmentToExtract(Relation relation, List selectedIndices) { /** * Constructor + * * @param existingRelation to be used when a potential sub route relation is encountered * while processing a PT route relation - * @param updateTags update the tags automatically or not? + * @param updateTags update the tags automatically or not? */ public RouteSegmentToExtract(Relation existingRelation, Boolean updateTags) { this(); @@ -138,6 +147,7 @@ public List getWayMembers() { /** * Sets the WayMembers of this route segment to the given list + * * @param index its index in the relation specified in the constructor */ public void addWay(Integer index) { @@ -146,14 +156,15 @@ public void addWay(Integer index) { /** * Sets the WayMembers of this route segment to the given list - * @param index its index in the relation specified in the constructor + * + * @param index its index in the relation specified in the constructor * @param updateIndices when the list of indices was set by the constructor * don't update it anymore */ private void addWay(Integer index, boolean updateIndices) { assert relation != null; final RelationMember member = relation.getMember(index); - if(member.isWay()) { + if (member.isWay()) { if (updateIndices) { indices.add(0, index); } @@ -165,135 +176,52 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; - final RelationMember member = relation.getMember(index); - RelationMember previousMember; - Way previousWay = null; - if (member.isWay() && isPTWay(member)) { - boolean startNewSegment = false; - if (index > 1) { - previousMember = relation.getMember(index - 1); - if (isPTWay(previousMember)) { - previousWay = previousMember.getWay(); - } - } - Way currentWay = member.getWay(); - Way nextWay = null; - if (index < relation.getMembersCount()-1) { - final RelationMember nextMember = relation.getMember(index + 1); - if (nextMember.isWay()) { - nextWay = nextMember.getWay(); - } - } - Way wayAfterNextWay = null; - if (index < relation.getMembersCount()-2) { - final RelationMember nextNextMember = relation.getMember(index + 2); - if (nextNextMember.isWay()) { - wayAfterNextWay = nextNextMember.getWay(); - } else if (nextNextMember.isRelation()) { - wayAfterNextWay = nextNextMember.getRelation().getMember(0).getWay(); + WaySequence waysInCurrentRoute = new WaySequence<>(relation, index); + if (waysInCurrentRoute.currentWay != null) { + WaySequence nextWaysInCurrentRoute = new WaySequence<>(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay, waysInCurrentRoute.wayAfterNextWay); + + if (this.itinerariesInSameDirection == null && nextWaysInCurrentRoute.currentWay != null) { + ArrayList itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute); + if (itinerariesInSameDirection != null) { + this.itinerariesInSameDirection = itinerariesInSameDirection; + for (Relation relation : itinerariesInSameDirection) { + addLineIdentifier(relation.get("ref")); + addColour(relation.get("colour")); + } } } + boolean startNewSegment = false; if (wayMembers.size() == 0) { addWay(index, true); } else { List parentRouteRelations = - Utils.filteredCollection(currentWay.getReferrers(), Relation.class).stream() + Utils.filteredCollection(waysInCurrentRoute.currentWay.getReferrers(), Relation.class).stream() .filter(r -> r.getId() != relation.getId()) .filter(RouteUtils::isVersionTwoPTRoute) .collect(Collectors.toList()); - ArrayList itinerariesInSameDirection = new ArrayList<>(); - for (Relation parentRoute : parentRouteRelations) { - final List parentRouteMembers = parentRoute.getMembers(); - List ways = new ArrayList<>(); - for (RelationMember rm : parentRouteMembers) { - if (rm.isWay()) { - ways.add(rm.getWay()); - } - } - if (ways.contains(currentWay)) { - for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRouteMembers, currentWay)) { - if (isItineraryInSameDirection(previousWay, nextWay, waysInParentRoute)) { - itinerariesInSameDirection.add(parentRoute); - } - } - } - } - for (Relation parentRoute : itinerariesInSameDirection) { - boolean addToLineIdentifier = true; - Way lastWayInParentRoute = null; - List members = parentRoute.getMembers(); - for (int j = members.size() - 1; j>=0 ; j--) { - RelationMember rm = members.get(j); - if (rm.isWay() && RouteUtils.isPTWay(rm)) { - lastWayInParentRoute = rm.getWay(); - break; - } - } - if (currentWay == lastWayInParentRoute) { - startNewSegment = true; - } - - for (WayTriplet waysInParentRoute : findPreviousAndNextWayInRoute(parentRoute.getMembers(), currentWay)) { - if (waysInParentRoute.nextWay != null) { - if (!nextWay.equals(waysInParentRoute.nextWay)){ - // if one of the parent relations has a different next way - // it's time to start a new segment - startNewSegment = true; - addToLineIdentifier = false; - } else { - addLineIdentifier(parentRoute.get("ref")); - addColour(parentRoute.get("colour")); - } - } - } - /* - If the previous way before the next way's parent - routes isn't the same as currentWay a split is also needed - */ - if (isPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfNextWay( - currentWay, nextWay, wayAfterNextWay)) { - startNewSegment = true; - } else if (addToLineIdentifier) { - addLineIdentifier(parentRoute.get("ref")); - addColour(parentRoute.get("colour")); - } - } - - boolean currentWayIsFirstWayInOneOfTheParentWays = false; - Way firstWayInParent = null; - for (Relation prRel : parentRouteRelations) { - for (RelationMember rm : prRel.getMembers()) { - if (rm.isWay() && isPTWay(rm)) { - if (firstWayInParent == null) { - firstWayInParent = rm.getWay(); - } else { - if (rm.getWay() == nextWay && firstWayInParent == currentWay) { - currentWayIsFirstWayInOneOfTheParentWays = true; - addLineIdentifier(prRel.get("ref")); - addColour(prRel.get("colour")); - } - break; - } - } - } - } - if (itinerariesInSameDirection.isEmpty() && index < relation.getMembersCount() - 2) { - final RelationMember nextMember = relation.getMember(index + 2); - if (nextMember.isRelation()) { - Relation previousRelation = nextMember.getRelation(); - if (!lineIdentifiers.first().equals(previousRelation.get("route_ref"))) { + ArrayList itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); + if (this.itinerariesInSameDirection != null && + !itinerariesInSameDirection.equals(this.itinerariesInSameDirection)) { + startNewSegment = true; + } else { + this.itinerariesInSameDirection = itinerariesInSameDirection; + for (Relation parentRoute : itinerariesInSameDirection) { + if (waysInCurrentRoute.currentWay == getLastWay(parentRoute)) { startNewSegment = true; } } } - if (startNewSegment - || currentWayIsFirstWayInOneOfTheParentWays - || itinerariesInSameDirection.isEmpty() && lineIdentifiers.size() > 1 - ) { + if (startNewSegment) { RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation, activeDataSet); newSegment.addPTWayMember(index); + newSegment.itinerariesInSameDirection = itinerariesInSameDirection; + newSegment.populateLineIdentifierAndColourLists(); return newSegment; } else { + if (this.itinerariesInSameDirection == null) { + this.itinerariesInSameDirection = itinerariesInSameDirection; + populateLineIdentifierAndColourLists(); + } addWay(index); } } @@ -301,30 +229,69 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { return null; } - private boolean isPreviousWayDifferentFromCurrentWayInAtLeastOneOfTheParentsOfNextWay( - Way currentWay, Way nextWay, Way wayAfterNextWay) { - List parentRoutesOfNextWay = - Utils.filteredCollection(nextWay.getReferrers(), Relation.class).stream() - .filter(RouteUtils::isVersionTwoPTRoute) - .collect(Collectors.toList()); + public Way getLastWay(Relation parentRoute) { + Way lastWayInParentRoute = null; + List members = parentRoute.getMembers(); + for (int j = members.size() - 1; j >= 0; j--) { + RelationMember rm = members.get(j); + if (rm.isWay() && RouteUtils.isPTWay(rm)) { + lastWayInParentRoute = rm.getWay(); + break; + } + } + return lastWayInParentRoute; + } - for (Relation parentRouteOfNextWay : parentRoutesOfNextWay) { - for (WayTriplet waysInParentRouteOfNextWay : findPreviousAndNextWayInRoute(parentRouteOfNextWay.getMembers(), nextWay)) { - if (waysInParentRouteOfNextWay.previousWay != null - && !waysInParentRouteOfNextWay.previousWay.equals(currentWay) - && isItineraryInSameDirection(currentWay, wayAfterNextWay, waysInParentRouteOfNextWay)) { - return true; + public ArrayList getItinerariesInSameDirection( + WaySequence waysInCurrentRoute) { + final String wayInRelation = relation.getId() + "," + waysInCurrentRoute.currentWay.getId(); + if (parentRelationsForSameDirectionOfTravel.containsKey(wayInRelation)) { + return parentRelationsForSameDirectionOfTravel.get(wayInRelation); + } + return null; + } + + public ArrayList getItinerariesInSameDirection( + WaySequence waysInCurrentRoute, + List parentRouteRelations) { + ArrayList r = getItinerariesInSameDirection(waysInCurrentRoute); + if (r != null) { + return r; + } else { + ArrayList itinerariesInSameDirection = new ArrayList<>(); + for (Relation parentRoute : parentRouteRelations) { + final List parentRouteMembers = parentRoute.getMembers(); + List ways = new ArrayList<>(); + for (RelationMember rm : parentRouteMembers) { + if (rm.isWay() && RouteUtils.isPTWay(rm)) { + ways.add(rm.getWay()); + } + } + if (ways.contains(waysInCurrentRoute.currentWay)) { + for (WaySequence waysInParentRoute : findPreviousAndNextWayInRoute(parentRouteMembers, waysInCurrentRoute.currentWay)) { + if (isItineraryInSameDirection(waysInCurrentRoute, waysInParentRoute)) { + itinerariesInSameDirection.add(parentRoute); + } + } } } + if (relation.getMembers().stream() + .filter(member -> member.getMember().equals(waysInCurrentRoute.currentWay)) + .count() < 2) { + parentRelationsForSameDirectionOfTravel.put( + relation.getId() + "," + waysInCurrentRoute.currentWay.getId(), + itinerariesInSameDirection); + } + return itinerariesInSameDirection; } - return false; } - private boolean isItineraryInSameDirection(Way previousWay, Way nextWay, - WayTriplet waysInParentRoute) { - if (previousWay != null && nextWay != null) { - return !(previousWay.equals(waysInParentRoute.nextWay) || - nextWay.equals(waysInParentRoute.previousWay)); + public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, + WaySequence waysInParentRoute) { + assert waysInCurrentRoute.currentWay == waysInParentRoute.currentWay; + if (waysInCurrentRoute.previousWay != null && waysInParentRoute.previousWay != null) { + return !(waysInCurrentRoute.previousWay.equals(waysInParentRoute.nextWay) || + waysInParentRoute.previousWay.equals(waysInCurrentRoute.nextWay)); } return false; } @@ -335,12 +302,13 @@ private boolean isItineraryInSameDirection(Way previousWay, Way nextWay, * @param wayToLocate The way to locate in the list * @return a list of way triplets */ - private static List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + private static List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { final long wayToLocateId = wayToLocate.getId(); Way previousWay; Way nextWay = null; + Way wayAfterNextWay = null; boolean foundWay = false; - List> wayTriplets = new ArrayList<>(); + List> waySequences = new ArrayList<>(); for (int j = members.size() - 1; j>=0 ; j--) { RelationMember rm = members.get(j); if (rm.isWay() && RouteUtils.isPTWay(rm)) { @@ -349,7 +317,9 @@ private static List> findPreviousAndNextWayInRoute(List< if (previousWay == wayToLocate) { previousWay = null; } - wayTriplets.add(0, new WayTriplet<>(previousWay,wayToLocate,nextWay)); + waySequences.add(0, new WaySequence<>( + previousWay, wayToLocate, nextWay, wayAfterNextWay)); + wayAfterNextWay = null; nextWay = null; foundWay = false; continue; @@ -357,11 +327,12 @@ private static List> findPreviousAndNextWayInRoute(List< if (previousWay.getId() == wayToLocateId) { foundWay = true; } else { + wayAfterNextWay = nextWay; nextWay = previousWay; } } } - return wayTriplets; + return waySequences; } public List getWayIds() { @@ -404,14 +375,28 @@ public void addColour(String colour) { } public TreeSet getLineIdentifiers() { + if (lineIdentifiers.size() < 2) { + populateLineIdentifierAndColourLists(); + } return lineIdentifiers; } + public void populateLineIdentifierAndColourLists() { + if (itinerariesInSameDirection == null) return; + for (Relation relation : itinerariesInSameDirection) { + addLineIdentifier(relation.get("ref")); + addColour(relation.get("colour")); + } + } + public String getLineIdentifiersSignature() { return String.join(";", getLineIdentifiers()); } public TreeSet getColours() { + if (colours.size() < 2) { + populateLineIdentifierAndColourLists(); + } return colours; } diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 6254e3f1..32c97973 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -1,10 +1,12 @@ package org.openstreetmap.josm.plugins.pt_assistant.data; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.Way; + import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; @@ -16,19 +18,60 @@ import static org.openstreetmap.josm.io.OsmReader.parseDataSet; @SuppressWarnings("NonAsciiCharacters") -public class RouteSegmentToExtractTest { +public class RouteSegmentToExtractTest extends AbstractTest{ private static DataSet ds; + private static Collection allRelations; @BeforeClass public static void init() throws FileNotFoundException, IllegalDataException { - ds = parseDataSet(new FileInputStream(AbstractTest.PATH_TO_PT_BEFORE_SPLITTING_TEST), null); + ds = parseDataSet(new FileInputStream(PATH_TO_PT_BEFORE_SPLITTING_TEST), null); + allRelations = ds.getRelations(); } @Test - public void bus601Test() { - Collection allRelations = ds.getRelations(); + public void isItineraryInSameDirectionTest() { + Relation bus601RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 3612781) + .findFirst().orElse(null); + + Relation bus370NightRouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 5240367) + .findFirst().orElse(null); + + Relation bus358RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 6695469) + .findFirst().orElse(null); + + Relation bus371RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 1606056) + .findFirst().orElse(null); + + WaySequence waysInParentRouteOf601 = new WaySequence<>( + bus601RouteRelation.getMembers().get(156).getWay(), + bus601RouteRelation.getMembers().get(157).getWay(), + bus601RouteRelation.getMembers().get(158).getWay()); +// WaySequence waysInParentRouteOf370Night = new WaySequence<>( +// bus370NightRouteRelation.getMembers().get(152).getWay(), +// bus370NightRouteRelation.getMembers().get(153).getWay(), +// null); + WaySequence waysInParentRouteOf358 = new WaySequence<>( + bus358RouteRelation.getMembers().get(114).getWay(), + bus358RouteRelation.getMembers().get(115).getWay(), + bus358RouteRelation.getMembers().get(116).getWay()); + WaySequence waysInParentRouteOf371 = new WaySequence<>( + bus371RouteRelation.getMembers().get(132).getWay(), + bus371RouteRelation.getMembers().get(133).getWay(), + bus371RouteRelation.getMembers().get(134).getWay()); + RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation, ds); +// assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf370Night)); + assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358)); + assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371)); + } + + @Test + public void bus601_600Test() { Relation bus601RouteRelation = allRelations.stream() .filter(relation -> relation.getId() == 3612781) .findFirst().orElse(null); @@ -45,6 +88,27 @@ public void bus601Test() { assertEquals("", segment1.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment1.getWayMembers()); + // The following code serves to create list of + // ways in the route relation to test with +// Relation bus600RouteRelation = allRelations.stream() +// .filter(relation -> relation.getId() == 955908) +// .findFirst().orElse(null); +// List members = bus600RouteRelation.getMembers(); +// for (int i = members.size() - 1; i >= 0; i--) { +// RelationMember member = members.get(i); +// if (member.isWay() && RouteUtils.isPTWay(member)) { +// Way way = member.getWay(); +// String id = String.valueOf(way.getId()); +// String name = ""; +// if (way.hasKey("name")) name = way.get("name"); +// name = name.replace("-","_"); +// name = name.replace(" ","_"); +// name += "_"; +// System.out.println(String.format("final int W_%s_%s%s_ = %s;", +// i, name, id, id)); +// } +// } + final int W_158_perron1and2terminus_78579065_B = 78579065; final int W_157_perron1and2_377814547_A = 377814547; @@ -85,40 +149,36 @@ public void bus601Test() { final int W_154_Tiensevest_4_79211472_A = 79211472; RouteSegmentToExtract segment4 = segment3.addPTWayMember(154); - // segment4 was created, verify segment3 extractAndAssertValues(154, segment3, segment4, cloneOfBus601RouteRelation, W_155_Tiensevest_5_79211473_A, W_155_Tiensevest_5_79211473_A, W_154_Tiensevest_4_79211472_A, "Tiensevest", null, - "1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" + "1;2;3;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" ); final int W_153_Tiensevest_3_79211472_A = 79175435; RouteSegmentToExtract segment5 = segment4.addPTWayMember(153); - // segment5 was created, verify segment4 extractAndAssertValues(153, segment4, segment5, cloneOfBus601RouteRelation, W_154_Tiensevest_4_79211472_A, W_154_Tiensevest_4_79211472_A, W_153_Tiensevest_3_79211472_A, "Tiensevest", null, - "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;658" + "1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" ); final int W_152_Tiensevest_2_80458208_A = 80458208; RouteSegmentToExtract segment6 = segment5.addPTWayMember(152); - // segment6 was created, verify segment5 extractAndAssertValues(152, segment5, segment6, cloneOfBus601RouteRelation, W_153_Tiensevest_3_79211472_A, W_153_Tiensevest_3_79211472_A, W_152_Tiensevest_2_80458208_A, "Tiensevest", null, - "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;651;652;658" + "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658" ); final int W_33_151_Tiensevest_1_19793164_A = 19793164; RouteSegmentToExtract segment7 = segment6.addPTWayMember(151); - // segment7 was created, verify segment6 extractAndAssertValues(151, segment6, segment7, cloneOfBus601RouteRelation, W_152_Tiensevest_2_80458208_A, W_152_Tiensevest_2_80458208_A, W_33_151_Tiensevest_1_19793164_A, "Tiensevest", @@ -127,8 +187,8 @@ public void bus601Test() { ); final int W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D = 6184898; -// final int W_31_149_Diestsevest_3_81457878_C = 81457878; -// final int W_30_148_Diestsevest_2_4003924_B = 4003924; + final int W_31_149_Diestsevest_3_81457878_C = 81457878; + final int W_30_148_Diestsevest_2_4003924_B = 4003924; final int W_29_147_Diestsevest_1_8133608_A = 8133608; final int W_28_146_Artoisplein_2_254800931_A = 254800931; @@ -138,7 +198,7 @@ public void bus601Test() { W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", null, - "305;318;334;335;358;410;513;601;630;651;652;658" + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658" ); for (int n = 149; n >= 147; n--) returnValueNull = segment8.addPTWayMember(n); assertNull(returnValueNull); @@ -162,7 +222,7 @@ public void bus601Test() { W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, W_145_Artoisplein_1_23691158_E, "Joanna-Maria Artoisplein", null, - "178;305;318;358;410;601;651;652;658" + "178;305;318;334;335;358;410;513;601;630;651;652;658" ); for (int n = 144; n >= 141; n--) returnValueNull = segment10.addPTWayMember(n); assertNull(returnValueNull); @@ -352,7 +412,7 @@ public void bus601Test() { W_108_Rotonde_Het_Teken_3752557_A, W_108_Rotonde_Het_Teken_3752557_A, W_107_Rotonde_Het_Teken_VWBln_249333188_A, "Rotonde Het Teken", null, - "3;410;600;601" + "3;317;333;334;335;370;371;373;374;380;395;410;600;601" ); final int W_106_Rotonde_Het_Teken_249333187_A = 249333187; @@ -374,7 +434,7 @@ public void bus601Test() { W_106_Rotonde_Het_Teken_249333187_A, W_106_Rotonde_Het_Teken_249333187_A, W_105_Herestraat_7_13067134_D, "Herestraat", null, - "410;600;601" + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" ); final int W_101_Herestraat_3_813970229_C = 813970229; @@ -529,7 +589,7 @@ public void bus601Test() { W_48_Tiensevest_185988814_A, W_48_Tiensevest_185988814_A, W_47_Martelarenplein_76856823_D, "Martelarenplein", null, - "7;8;9;18;178;179;306 (student);337;380;527;601;630" + "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;600;601;616;630" ); final int W_43__79264899_A = 79264899; @@ -549,7 +609,7 @@ public void bus601Test() { W_43__79264899_A, W_43__79264899_A, W_42__377918635_A, null, null, - "18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601" + "18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630" ); final int W_41__79264888_A = 79264888; @@ -585,7 +645,7 @@ public void bus601Test() { W_39__71754927_A, W_39__71754927_A, W_38__377918638_A_TEC18, null, null, - "18;601" // TODO: this is odd, needs verification + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;475;485;512;513;520;524;525;601" ); final int W_37__79264891_A = 79264891; @@ -594,7 +654,7 @@ public void bus601Test() { W_38__377918638_A_TEC18, W_38__377918638_A_TEC18, W_37__79264891_A, null, null, - "18;601" + "601" // TODO, here line 18 has its first way in common with 601 ); final int W_36_Tiensevest_78568409_A = 78568409; @@ -612,7 +672,7 @@ public void bus601Test() { W_36_Tiensevest_78568409_A, W_36_Tiensevest_78568409_A, W_35_Tiensevest_79193579_A, "Tiensevest", null, - "4;5;6;7;8;9;18;179;306 (student);334;335;337;380;601;616;658" + "4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658" ); final int W_34_Bend_19793394_A = 19793394; // ways 28 to 33 are the same as 146 - 151 @@ -624,7 +684,7 @@ public void bus601Test() { W_35_Tiensevest_79193579_A, W_35_Tiensevest_79193579_A, W_34_Bend_19793394_A, null, null, - "334;335;513;601" + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658" ); final int W_26_Havenkant_510790349_M = 510790349; final int W_25_Havenkant_510790348_L = 510790348; @@ -653,7 +713,7 @@ public void bus601Test() { W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", null, - "305;318;334;335;358;410;513;601;630;651;652;658" + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658" ); assertEquals(rel8.getId(), rel50.getId()); @@ -672,7 +732,7 @@ public void bus601Test() { W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, W_27_Zoutstraat_3992548_A, "Zoutstraat", null, - "334;335;513;601;630" + "178;305;318;334;335;358;410;513;601;630;651;652;658" ); assertEquals(rel10.getId(), rel52.getId()); @@ -681,7 +741,7 @@ public void bus601Test() { W_27_Zoutstraat_3992548_A, W_27_Zoutstraat_3992548_A, W_26_Havenkant_510790349_M, "Havenkant", null, - "601" + "334;335;513;601;630" ); for (int n = 25; n >= 14; n--) returnValueNull = segment53.addPTWayMember(n); assertNull(returnValueNull); @@ -692,6 +752,80 @@ public void bus601Test() { null, "601" ); + + + // *********************************************************** + // *********************************************************** + // *********************************************************** + + + Relation bus600RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 955908) + .findFirst().orElse(null); + + assertNotNull(bus600RouteRelation); + Relation cloneOfBus600RouteRelation = new Relation(bus600RouteRelation); + assertNotNull(cloneOfBus600RouteRelation); + RouteSegmentToExtract segment101 = new RouteSegmentToExtract(cloneOfBus600RouteRelation, ds); + assertEquals(cloneOfBus600RouteRelation.get("ref"), segment101.getLineIdentifiersSignature()); + assertEquals(cloneOfBus600RouteRelation.get("colour"), segment101.getColoursSignature()); + + assertNull(segment101.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment101.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment101.getWayMembers()); + + final int W_169_Engels_Plein_608715622_O = 608715622; + final int W_168_Engels_Plein_338057819_N = 338057819; + final int W_167_Engels_Plein_305316104_M = 305316104; + final int W_166_Engels_Plein_3869812_L = 3869812; + final int W_165_Wolvengang_25928482_K = 25928482; + final int W_164_Wolvengang_659297690_J = 659297690; + final int W_163_Achter_de_latten_330300723_I = 330300723; + final int W_162_Burchtstraat_3869822_H = 3869822; + final int W_161_Havenkant_330300725_G = 330300725; + final int W_160_Havenkant_270181176_F = 270181176; + final int W_159_Havenkant_406205781_E = 406205781; + final int W_158_Havenkant_843534478_D = 843534478; + final int W_157_Havenkant_314635787_C = 314635787; + final int W_156_Havenkant_510790348_B = 510790348; + final int W_155_Havenkant_29283599_A = 29283599; + + final int W_154_Havenkant_304241968_B = 304241968; + final int W_153_Aarschotsesteenweg_304241967_A = 304241967; + + for (int n = 169; n >= 155; n--) returnValueNull = segment101.addPTWayMember(n); assertNull(returnValueNull); + RouteSegmentToExtract segment102 = segment101.addPTWayMember(154); + extractAndAssertValues(154, segment101, segment102, cloneOfBus600RouteRelation, + W_155_Havenkant_29283599_A, W_169_Engels_Plein_608715622_O, + W_154_Havenkant_304241968_B, "Havenkant", + null, + "600" + ); + + final int W_152_Redersstraat_340265961_B = 340265961; + final int W_151_Redersstraat_318825613_A = 318825613; + + returnValueNull = segment102.addPTWayMember(153); assertNull(returnValueNull); + RouteSegmentToExtract segment103 = segment102.addPTWayMember(152); + extractAndAssertValues(152, segment102, segment103, cloneOfBus600RouteRelation, + W_153_Aarschotsesteenweg_304241967_A, W_154_Havenkant_304241968_B, + W_152_Redersstraat_340265961_B, "Redersstraat", + null, + "334;335;513;600;630" + ); + + final int W_150_Redersstraat_340265962_A = 340265962; + + returnValueNull = segment103.addPTWayMember(151); assertNull(returnValueNull); + RouteSegmentToExtract segment104 = segment103.addPTWayMember(150); + extractAndAssertValues(150, segment103, segment104, cloneOfBus600RouteRelation, + W_151_Redersstraat_318825613_A, W_152_Redersstraat_340265961_B, + W_150_Redersstraat_340265962_A, "Redersstraat", + null, + "600" + ); + } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, @@ -699,7 +833,7 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS String nameOfNewWay, String expectedColours, String expectedRouteRef) { Relation extractedRelation = createdSegment.extractToRelation(Arrays.asList("type", "route"), true); - System.out.println(extractedRelation.get("note")); + System.out.println(index + " " + extractedRelation.get("note")); assertEquals("first way not correct", firstWayId, extractedRelation.firstMember().getWay().getId()); assertEquals("last way not correct", lastWayId, extractedRelation.lastMember().getWay().getId()); if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); From 5372fa0ec344a5ca99f8f5387a8f396c0637e0c3 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Thu, 1 Oct 2020 23:52:28 +0200 Subject: [PATCH 29/52] renamed WayTriplet to WaySequence as it can contain 4 consecutive ways now --- .../pt_assistant/data/WaySequence.java | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java new file mode 100644 index 00000000..4f45b402 --- /dev/null +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -0,0 +1,84 @@ +package org.openstreetmap.josm.plugins.pt_assistant.data; + +import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.data.osm.Way; + +import static org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils.isPTWay; + +public final class WaySequence { + public Way previousWay; + public Way currentWay; + public Way nextWay; + public Way wayAfterNextWay; + + public WaySequence() { + this(null, null, null, null); + } + + public WaySequence(RelationMember currentMember) { + this(null, null, null, null); + setCurrentPtWay(currentMember); + } + + public WaySequence(Relation relation, int index) { + this(null, null, null, null); + setCurrentPtWay(relation.getMember(index)); + if (index > 1) setPreviousPtWay(relation.getMember(index - 1)); + final int membersCount = relation.getMembersCount(); + if (index < membersCount -1) + setNextPtWay(relation.getMember(index + 1)); + if (index < membersCount -2) + setAfterNextPtWay(relation.getMember(index + 2)); + } + + public WaySequence(Way previousWay, Way currentWay, Way nextWay) + { + this(previousWay, currentWay, nextWay, null); + } + + public WaySequence(Way previousWay, Way currentWay, Way nextWay, Way wayAfterNextWay) { + this.previousWay = previousWay; + this.currentWay = currentWay; + this.nextWay = nextWay; + this.wayAfterNextWay = wayAfterNextWay; + } + + public void setCurrentPtWay(RelationMember currentMember) { + if (currentMember.isWay() && isPTWay(currentMember)) { + currentWay = currentMember.getWay(); + } else { + currentWay = null; + } + } + + public void setPreviousPtWay(RelationMember previousMember) { + if (previousMember.isWay() && isPTWay(previousMember)) { + previousWay = previousMember.getWay(); + } else { + previousWay = null; + } + + } + + public void setNextPtWay(RelationMember nextMember) { + if (nextMember.isWay() && isPTWay(nextMember)) { + nextWay = nextMember.getWay(); + } else { + nextWay = null; + } + } + + public void setAfterNextPtWay(RelationMember afterNextMember) { + if (isPTWay(afterNextMember)) { + if (afterNextMember.isWay()) { + wayAfterNextWay = afterNextMember.getWay(); + return; + } else if (afterNextMember.isRelation()) { + wayAfterNextWay = afterNextMember.getRelation().getMember(0).getWay(); + return; + } + } + wayAfterNextWay = null; + } +} From 742265aae10b6841e8082582e7c501dfd45d4279 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 5 Oct 2020 22:24:39 +0200 Subject: [PATCH 30/52] All the unit tests are working up to this point. Rewrote isItineraryInSameDirection so it can both work with previous and next ways, as with start and end node of currentWay for when one of the ways is null; --- ...actRelationMembersToNewRelationAction.java | 1 - .../data/RouteSegmentToExtract.java | 168 ++++-- .../data/RouteSegmentToExtractTest.java | 485 +++++++++++------- 3 files changed, 407 insertions(+), 247 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 150cb5b9..6e8d6985 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -18,7 +18,6 @@ import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; import org.openstreetmap.josm.plugins.pt_assistant.data.RouteSegmentToExtract; -import org.openstreetmap.josm.plugins.pt_assistant.data.WayTriplet; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import org.openstreetmap.josm.tools.*; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index b1ba73c8..1dc8f2ed 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -34,14 +34,15 @@ */ public class RouteSegmentToExtract { private static final Map ptSegments; - private static final Map> parentRelationsForSameDirectionOfTravel; + private static final Map> parentRelationsForSameDirectionOfTravel; private DataSet activeDataSet; private Relation relation; private Relation extractedRelation; + private boolean startNewSegment; private ArrayList wayMembers; private List indices; - private List itinerariesInSameDirection; + private TreeSet itinerariesInSameDirection; private final TreeSet lineIdentifiers; private final TreeSet colours; private List streetNames = null; @@ -67,6 +68,7 @@ private RouteSegmentToExtract() { colours = new TreeSet<>(); wayIds = null; activeDataSet = getLayerManager().getActiveDataSet(); + startNewSegment = false; } /** @@ -181,7 +183,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { WaySequence nextWaysInCurrentRoute = new WaySequence<>(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay, waysInCurrentRoute.wayAfterNextWay); if (this.itinerariesInSameDirection == null && nextWaysInCurrentRoute.currentWay != null) { - ArrayList itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute); + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute); if (itinerariesInSameDirection != null) { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation relation : itinerariesInSameDirection) { @@ -190,7 +192,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } } } - boolean startNewSegment = false; + if (wayMembers.size() == 0) { addWay(index, true); } else { @@ -199,15 +201,20 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { .filter(r -> r.getId() != relation.getId()) .filter(RouteUtils::isVersionTwoPTRoute) .collect(Collectors.toList()); - ArrayList itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); - if (this.itinerariesInSameDirection != null && - !itinerariesInSameDirection.equals(this.itinerariesInSameDirection)) { + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); + boolean startNewSegmentInNewSegment = false; + if (this.itinerariesInSameDirection != null + && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection)) { startNewSegment = true; } else { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation parentRoute : itinerariesInSameDirection) { - if (waysInCurrentRoute.currentWay == getLastWay(parentRoute)) { + if (waysInCurrentRoute.currentWay == getLastWay(parentRoute) + || getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1) { startNewSegment = true; + if (getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1) { + startNewSegmentInNewSegment = true; + } } } } @@ -216,6 +223,8 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { newSegment.addPTWayMember(index); newSegment.itinerariesInSameDirection = itinerariesInSameDirection; newSegment.populateLineIdentifierAndColourLists(); + newSegment.startNewSegment = startNewSegmentInNewSegment; + return newSegment; } else { if (this.itinerariesInSameDirection == null) { @@ -242,7 +251,7 @@ public Way getLastWay(Relation parentRoute) { return lastWayInParentRoute; } - public ArrayList getItinerariesInSameDirection( + public TreeSet getItinerariesInSameDirection( WaySequence waysInCurrentRoute) { final String wayInRelation = relation.getId() + "," + waysInCurrentRoute.currentWay.getId(); if (parentRelationsForSameDirectionOfTravel.containsKey(wayInRelation)) { @@ -251,33 +260,31 @@ public ArrayList getItinerariesInSameDirection( return null; } - public ArrayList getItinerariesInSameDirection( + public TreeSet getItinerariesInSameDirection( WaySequence waysInCurrentRoute, List parentRouteRelations) { - ArrayList r = getItinerariesInSameDirection(waysInCurrentRoute); + TreeSet r = getItinerariesInSameDirection(waysInCurrentRoute); if (r != null) { return r; } else { - ArrayList itinerariesInSameDirection = new ArrayList<>(); + TreeSet itinerariesInSameDirection = new TreeSet<>(); for (Relation parentRoute : parentRouteRelations) { - final List parentRouteMembers = parentRoute.getMembers(); - List ways = new ArrayList<>(); - for (RelationMember rm : parentRouteMembers) { - if (rm.isWay() && RouteUtils.isPTWay(rm)) { - ways.add(rm.getWay()); + final List parentRouteHighways = getHighways(parentRoute); + long occurrences = getMembershipCount(waysInCurrentRoute.currentWay, parentRoute); + if (!itinerariesInSameDirection.contains(parentRoute)) { + final Way firstHighwayInParentRoute = getHighways(parentRoute).get(0); + if (firstHighwayInParentRoute == waysInCurrentRoute.currentWay) { + itinerariesInSameDirection.add(parentRoute); } - } - if (ways.contains(waysInCurrentRoute.currentWay)) { - for (WaySequence waysInParentRoute : findPreviousAndNextWayInRoute(parentRouteMembers, waysInCurrentRoute.currentWay)) { - if (isItineraryInSameDirection(waysInCurrentRoute, waysInParentRoute)) { + for (WaySequence waysInParentRoute : findPreviousAndNextWayInRoute( + parentRouteHighways, waysInCurrentRoute.currentWay)) { + if (isItineraryInSameDirection(waysInCurrentRoute, waysInParentRoute, occurrences)) { itinerariesInSameDirection.add(parentRoute); } } } } - if (relation.getMembers().stream() - .filter(member -> member.getMember().equals(waysInCurrentRoute.currentWay)) - .count() < 2) { + if (getMembershipCount(waysInCurrentRoute.currentWay, relation) < 2) { parentRelationsForSameDirectionOfTravel.put( relation.getId() + "," + waysInCurrentRoute.currentWay.getId(), itinerariesInSameDirection); @@ -286,50 +293,105 @@ public ArrayList getItinerariesInSameDirection( } } + public List getHighways(Relation parentRoute) { + final List parentRouteMembers = parentRoute.getMembers(); + List ways = new ArrayList<>(); + for (RelationMember rm : parentRouteMembers) { + if (RouteUtils.isPTWay(rm)) { + if (rm.isWay()) { + ways.add(rm.getWay()); + } else if (rm.isRelation()) { + getHighways(rm.getRelation()).forEach(ways::add); + } + } + } + return ways; + } + + public long getMembershipCount(Way way, Relation routeRelation) { + return routeRelation.getMembers().stream() + .filter(member -> member.getMember().equals(way)) + .count(); + } + public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, - WaySequence waysInParentRoute) { - assert waysInCurrentRoute.currentWay == waysInParentRoute.currentWay; - if (waysInCurrentRoute.previousWay != null && waysInParentRoute.previousWay != null) { - return !(waysInCurrentRoute.previousWay.equals(waysInParentRoute.nextWay) || - waysInParentRoute.previousWay.equals(waysInCurrentRoute.nextWay)); + WaySequence waysInParentRoute, + long currentWayOccurrencesInParentRoute) { + assert waysInCurrentRoute.currentWay == waysInParentRoute.currentWay : + "this only works when comparing two equivalent way sequences" ; + + // if all ways are present, try the simple solution first + if (waysInCurrentRoute.previousWay != null + && waysInCurrentRoute.nextWay != null + && waysInParentRoute.previousWay != null + && waysInParentRoute.nextWay != null + && (waysInCurrentRoute.previousWay == waysInParentRoute.previousWay + || waysInCurrentRoute.nextWay == waysInParentRoute.nextWay) +// && currentWayOccurrencesInParentRoute < 2 + ) { + return (!waysInCurrentRoute.previousWay.equals(waysInParentRoute.nextWay) && + !waysInCurrentRoute.nextWay. equals(waysInParentRoute.previousWay)); + } + + // if not, compare on the nodes + Node firstNodeCurrentWay = null; + if (waysInCurrentRoute.previousWay != null) { + firstNodeCurrentWay = WayUtils.findCommonFirstLastNode( + waysInCurrentRoute.previousWay, waysInCurrentRoute.currentWay).orElse(null); } - return false; + Node lastNodeCurrentWay = null; + if (waysInCurrentRoute.nextWay != null) { + lastNodeCurrentWay = WayUtils.findCommonFirstLastNode( + waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay).orElse(null); + } + Node firstNodeWayOfParent = null; + if (waysInParentRoute.previousWay != null) { + firstNodeWayOfParent = WayUtils.findCommonFirstLastNode( + waysInParentRoute.previousWay, waysInParentRoute.currentWay).orElse(null); + } + Node lastNodeWayOfParent = null; + if (waysInParentRoute.nextWay != null) { + lastNodeWayOfParent = WayUtils.findCommonFirstLastNode( + waysInParentRoute.currentWay, waysInParentRoute.nextWay).orElse(null); + } + + return (firstNodeCurrentWay != null && firstNodeCurrentWay.equals(firstNodeWayOfParent) + || + lastNodeCurrentWay != null && lastNodeCurrentWay.equals(lastNodeWayOfParent)); } /** * for all occurrences of wayToLocate this method returns the way before it and the way after it - * @param members The members list of the relation + * @param highwayMembers The members list of the relation * @param wayToLocate The way to locate in the list * @return a list of way triplets */ - private static List> findPreviousAndNextWayInRoute(List members, Way wayToLocate) { + private static List> findPreviousAndNextWayInRoute(List highwayMembers, Way wayToLocate) { final long wayToLocateId = wayToLocate.getId(); - Way previousWay; + Way previousWay = null; Way nextWay = null; Way wayAfterNextWay = null; boolean foundWay = false; List> waySequences = new ArrayList<>(); - for (int j = members.size() - 1; j>=0 ; j--) { - RelationMember rm = members.get(j); - if (rm.isWay() && RouteUtils.isPTWay(rm)) { - previousWay = rm.getWay(); - if (foundWay) { - if (previousWay == wayToLocate) { - previousWay = null; - } - waySequences.add(0, new WaySequence<>( - previousWay, wayToLocate, nextWay, wayAfterNextWay)); - wayAfterNextWay = null; - nextWay = null; - foundWay = false; - continue; - } - if (previousWay.getId() == wayToLocateId) { - foundWay = true; - } else { - wayAfterNextWay = nextWay; - nextWay = previousWay; + for (int j = highwayMembers.size() - 1; j>=0 ; j--) { + Way highway = highwayMembers.get(j); + previousWay = highway; + if (foundWay) { + if (previousWay == wayToLocate) { + previousWay = null; } + waySequences.add(0, new WaySequence<>( + previousWay, wayToLocate, nextWay, wayAfterNextWay)); + wayAfterNextWay = null; + nextWay = null; + foundWay = false; + continue; + } + if (previousWay.getId() == wayToLocateId) { + foundWay = true; + } else { + wayAfterNextWay = nextWay; + nextWay = previousWay; } } return waySequences; diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 32c97973..97652a23 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -1,7 +1,6 @@ package org.openstreetmap.josm.plugins.pt_assistant.data; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Relation; @@ -22,11 +21,13 @@ public class RouteSegmentToExtractTest extends AbstractTest{ private static DataSet ds; private static Collection allRelations; + private static Collection allWays; @BeforeClass public static void init() throws FileNotFoundException, IllegalDataException { ds = parseDataSet(new FileInputStream(PATH_TO_PT_BEFORE_SPLITTING_TEST), null); allRelations = ds.getRelations(); + allWays = ds.getWays(); } @Test @@ -51,10 +52,7 @@ public void isItineraryInSameDirectionTest() { bus601RouteRelation.getMembers().get(156).getWay(), bus601RouteRelation.getMembers().get(157).getWay(), bus601RouteRelation.getMembers().get(158).getWay()); -// WaySequence waysInParentRouteOf370Night = new WaySequence<>( -// bus370NightRouteRelation.getMembers().get(152).getWay(), -// bus370NightRouteRelation.getMembers().get(153).getWay(), -// null); + WaySequence waysInParentRouteOf358 = new WaySequence<>( bus358RouteRelation.getMembers().get(114).getWay(), bus358RouteRelation.getMembers().get(115).getWay(), @@ -64,9 +62,82 @@ public void isItineraryInSameDirectionTest() { bus371RouteRelation.getMembers().get(133).getWay(), bus371RouteRelation.getMembers().get(134).getWay()); RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation, ds); -// assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf370Night)); - assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358)); - assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371)); + assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371, 1)); + + Way commonWay = allWays.stream() + .filter(way -> way.getId() == 75113358) + .findFirst().orElse(null); + + Way toHaasrode = allWays.stream() + .filter(way -> way.getId() == 4866090) + .findFirst().orElse(null); + + Way toBlanden = allWays.stream() + .filter(way -> way.getId() == 809484771) + .findFirst().orElse(null); + + Way toNeervelp = allWays.stream() + .filter(way -> way.getId() == 243961945) + .findFirst().orElse(null); + + Way toLeuven = allWays.stream() + .filter(way -> way.getId() == 809485597) + .findFirst().orElse(null); + + WaySequence leuvenToHaasrode = new WaySequence<>(toLeuven,commonWay,toHaasrode); + WaySequence leuvenToBlanden = new WaySequence<>(toLeuven,commonWay,toBlanden); + WaySequence neervelpToHaasrode = new WaySequence<>(toNeervelp,commonWay,toHaasrode); + WaySequence neervelpToBlanden = new WaySequence<>(toNeervelp,commonWay,toBlanden); + WaySequence haasrodeToLeuven = new WaySequence<>(toHaasrode,commonWay,toLeuven); + WaySequence blandenToLeuven = new WaySequence<>(toBlanden,commonWay,toLeuven); + WaySequence haasrodeToNeervelp = new WaySequence<>(toHaasrode,commonWay,toNeervelp); + WaySequence blandenToNeervelp = new WaySequence<>(toBlanden,commonWay,toNeervelp); + + assertTrue(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, leuvenToBlanden, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, leuvenToHaasrode, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, blandenToLeuven, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, haasrodeToLeuven, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(neervelpToBlanden, neervelpToHaasrode, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, neervelpToBlanden, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToNeervelp, blandenToLeuven, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, blandenToNeervelp, 1)); + + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode, 1)); + + WaySequence missingToBlanden = new WaySequence<>(null,commonWay,toBlanden); + WaySequence missingToHaasrode = new WaySequence<>(null,commonWay,toHaasrode); + WaySequence missingToLeuven = new WaySequence<>(null,commonWay,toLeuven); + WaySequence missingToNeervelp = new WaySequence<>(null,commonWay,toNeervelp); + WaySequence blandenToMissing = new WaySequence<>(toBlanden,commonWay,null); + WaySequence haasrodeToMissing = new WaySequence<>(toHaasrode,commonWay,null); + WaySequence leuvenToMissing = new WaySequence<>(toNeervelp,commonWay,null); + WaySequence neervelpToMissing = new WaySequence<>(toNeervelp,commonWay,null); + + assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, leuvenToBlanden, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, missingToBlanden, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(missingToLeuven, blandenToLeuven, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToLeuven, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, neervelpToHaasrode, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, missingToBlanden, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(missingToNeervelp, blandenToLeuven, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToNeervelp, 1)); + + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp, 1)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode, 1)); } @@ -90,34 +161,32 @@ public void bus601_600Test() { // The following code serves to create list of // ways in the route relation to test with -// Relation bus600RouteRelation = allRelations.stream() -// .filter(relation -> relation.getId() == 955908) -// .findFirst().orElse(null); -// List members = bus600RouteRelation.getMembers(); -// for (int i = members.size() - 1; i >= 0; i--) { -// RelationMember member = members.get(i); -// if (member.isWay() && RouteUtils.isPTWay(member)) { -// Way way = member.getWay(); -// String id = String.valueOf(way.getId()); -// String name = ""; -// if (way.hasKey("name")) name = way.get("name"); -// name = name.replace("-","_"); -// name = name.replace(" ","_"); -// name += "_"; -// System.out.println(String.format("final int W_%s_%s%s_ = %s;", -// i, name, id, id)); -// } -// } + //Relation bus600RouteRelation = allRelations.stream() + // .filter(relation -> relation.getId() == 955908) + // .findFirst().orElse(null); + //List members = bus600RouteRelation.getMembers(); + //for (int i = members.size() - 1; i >= 0; i--) { + // RelationMember member = members.get(i); + // if (member.isWay() && RouteUtils.isPTWay(member)) { + // Way way = member.getWay(); + // String id = String.valueOf(way.getId()); + // String name = ""; + // if (way.hasKey("name")) name = way.get("name"); + // name = name.replace("-","_"); + // name = name.replace(" ","_"); + // name += "_"; + // System.out.println(String.format("final int W_%s_%s%s_ = %s;", + // i, name, id, id)); + // } + //} final int W_158_perron1and2terminus_78579065_B = 78579065; final int W_157_perron1and2_377814547_A = 377814547; final int W_156_TiensevestToPerron1_79596986_A = 79596986; - RouteSegmentToExtract returnValueNull = segment1.addPTWayMember(158); - assertNull(returnValueNull); - returnValueNull = segment1.addPTWayMember(157); - assertNull(returnValueNull); + RouteSegmentToExtract returnValueNull =null; + for (int n = 158; n >= 157; n--) {returnValueNull =segment1.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment2 = segment1.addPTWayMember(156); final Way veryLastWay = segment1.getWayMembers().get(1).getWay(); @@ -136,9 +205,8 @@ public void bus601_600Test() { ); final int W_155_Tiensevest_5_79211473_A = 79211473; - RouteSegmentToExtract segment3 = segment2.addPTWayMember(155); - // segment3 was created, verify segment2 + RouteSegmentToExtract segment3 = segment2.addPTWayMember(155); extractAndAssertValues(155, segment2, segment3, cloneOfBus601RouteRelation, W_156_TiensevestToPerron1_79596986_A, W_156_TiensevestToPerron1_79596986_A, W_155_Tiensevest_5_79211473_A, "Tiensevest", @@ -147,8 +215,8 @@ public void bus601_600Test() { ); final int W_154_Tiensevest_4_79211472_A = 79211472; - RouteSegmentToExtract segment4 = segment3.addPTWayMember(154); + RouteSegmentToExtract segment4 = segment3.addPTWayMember(154); extractAndAssertValues(154, segment3, segment4, cloneOfBus601RouteRelation, W_155_Tiensevest_5_79211473_A, W_155_Tiensevest_5_79211473_A, W_154_Tiensevest_4_79211472_A, "Tiensevest", @@ -156,29 +224,29 @@ public void bus601_600Test() { "1;2;3;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" ); - final int W_153_Tiensevest_3_79211472_A = 79175435; - RouteSegmentToExtract segment5 = segment4.addPTWayMember(153); + final int W_153_Tiensevest_3_79175435_A = 79175435; + RouteSegmentToExtract segment5 = segment4.addPTWayMember(153); extractAndAssertValues(153, segment4, segment5, cloneOfBus601RouteRelation, W_154_Tiensevest_4_79211472_A, W_154_Tiensevest_4_79211472_A, - W_153_Tiensevest_3_79211472_A, "Tiensevest", + W_153_Tiensevest_3_79175435_A, "Tiensevest", null, - "1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" + "1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658" ); final int W_152_Tiensevest_2_80458208_A = 80458208; - RouteSegmentToExtract segment6 = segment5.addPTWayMember(152); + RouteSegmentToExtract segment6 = segment5.addPTWayMember(152); extractAndAssertValues(152, segment5, segment6, cloneOfBus601RouteRelation, - W_153_Tiensevest_3_79211472_A, W_153_Tiensevest_3_79211472_A, + W_153_Tiensevest_3_79175435_A, W_153_Tiensevest_3_79175435_A, W_152_Tiensevest_2_80458208_A, "Tiensevest", null, "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658" ); final int W_33_151_Tiensevest_1_19793164_A = 19793164; - RouteSegmentToExtract segment7 = segment6.addPTWayMember(151); + RouteSegmentToExtract segment7 = segment6.addPTWayMember(151); extractAndAssertValues(151, segment6, segment7, cloneOfBus601RouteRelation, W_152_Tiensevest_2_80458208_A, W_152_Tiensevest_2_80458208_A, W_33_151_Tiensevest_1_19793164_A, "Tiensevest", @@ -187,12 +255,10 @@ public void bus601_600Test() { ); final int W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D = 6184898; - final int W_31_149_Diestsevest_3_81457878_C = 81457878; - final int W_30_148_Diestsevest_2_4003924_B = 4003924; + // W_31_149_Diestsevest_3_81457878_C + // W_30_148_Diestsevest_2_4003924_B final int W_29_147_Diestsevest_1_8133608_A = 8133608; - final int W_28_146_Artoisplein_2_254800931_A = 254800931; - RouteSegmentToExtract segment8 = segment7.addPTWayMember(150); Relation rel8 = extractAndAssertValues(150, segment7, segment8, cloneOfBus601RouteRelation, W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, @@ -201,15 +267,16 @@ public void bus601_600Test() { "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658" ); - for (int n = 149; n >= 147; n--) returnValueNull = segment8.addPTWayMember(n); assertNull(returnValueNull); + final int W_28_146_Artoisplein_2_254800931_A = 254800931; final int W_145_Artoisplein_1_23691158_E = 23691158; -// final int W_144_Lüdenscheidsingel_5_254800932_D = 254800932; -// final int W_143_Lüdenscheidsingel_4_44932921_C = 44932921; -// final int W_142_Lüdenscheidsingel_3_3993388_B = 3993388; + // W_144_Lüdenscheidsingel_5_254800932_D = 254800932; + // W_143_Lüdenscheidsingel_4_44932921_C = 44932921; + // W_142_Lüdenscheidsingel_3_3993388_B = 3993388; final int W_141_Lüdenscheidsingel_2_109267417_A = 109267417; - RouteSegmentToExtract segment9 = segment8.addPTWayMember(146); + for (int n = 149; n >= 147; n--) {returnValueNull =segment8.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment9 = segment8.addPTWayMember(146); Relation rel9 = extractAndAssertValues(146, segment8, segment9, cloneOfBus601RouteRelation, W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", @@ -224,14 +291,14 @@ public void bus601_600Test() { null, "178;305;318;334;335;358;410;513;601;630;651;652;658" ); - for (int n = 144; n >= 141; n--) returnValueNull = segment10.addPTWayMember(n); assertNull(returnValueNull); final int W_140_Lüdenscheidsingel_1_3993387_E = 3993387; -// final int W_139_R23_2_8131125_D = 8131125; -// final int W_138_R23_1_3877105_C = 3877105; -// final int W_137_Den_Boschsingel_1_146171871_B = 146171871; + // W_139_R23_2_8131125_D = 8131125; + // W_138_R23_1_3877105_C = 3877105; + // W_137_Den_Boschsingel_1_146171871_B = 146171871; final int W_136_Den_Boschsingel_2_23837544_A = 23837544; - final int W_135_Den_Boschsingel_3_225605630_E = 225605630; + + for (int n = 144; n >= 141; n--) {returnValueNull =segment10.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment11 = segment10.addPTWayMember(140); extractAndAssertValues(140, segment10, segment11, cloneOfBus601RouteRelation, W_141_Lüdenscheidsingel_2_109267417_A, W_145_Artoisplein_1_23691158_E, @@ -239,28 +306,27 @@ public void bus601_600Test() { null, "178;305;318;358;410;601;651;652;658" ); - for (int n = 139; n >= 136; n--) returnValueNull = segment11.addPTWayMember(n); assertNull(returnValueNull); - RouteSegmentToExtract segment12 = segment11.addPTWayMember(135); + final int W_135_Den_Boschsingel_3_225605630_E = 225605630; + // W_134_Den_Boschsingel_4_8131121_D = 8131121; + // W_133_Rennes_Singel_3_3680456_C = 3680456; + // W_132_Rennes_Singel_2_3994257_B = 3994257; + final int W_131_Rennes_Singel_1_249333185_A = 249333185; + for (int n = 139; n >= 136; n--) {returnValueNull =segment11.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment12 = segment11.addPTWayMember(135); extractAndAssertValues(135, segment11, segment12, cloneOfBus601RouteRelation, W_136_Den_Boschsingel_2_23837544_A, W_140_Lüdenscheidsingel_1_3993387_E, W_135_Den_Boschsingel_3_225605630_E, "Den Boschsingel", null, "318;358;410;601;651;658" ); - for (int n = 134; n >= 131; n--) returnValueNull = segment12.addPTWayMember(n); assertNull(returnValueNull); - -// final int W_134_Den_Boschsingel_4_8131121_D = 8131121; -// final int W_133_Rennes_Singel_3_3680456_C = 3680456; -// final int W_132_Rennes_Singel_2_3994257_B = 3994257; - final int W_131_Rennes_Singel_1_249333185_A = 249333185; - final int W_99_130_Herestraat_1_249333184_AC = 249333184; -// final int W_100_129_Herestraat_2_813970231_BB = 813970231; + // W_100_129_Herestraat_2_813970231_BB = 813970231; final int W_128_Herestraat_11_681081951_A = 681081951; - RouteSegmentToExtract segment13 = segment12.addPTWayMember(130); + for (int n = 134; n >= 131; n--) {returnValueNull =segment12.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment13 = segment12.addPTWayMember(130); extractAndAssertValues(130, segment12, segment13, cloneOfBus601RouteRelation, W_131_Rennes_Singel_1_249333185_A, W_135_Den_Boschsingel_3_225605630_E, W_99_130_Herestraat_1_249333184_AC, "Herestraat", @@ -268,27 +334,24 @@ public void bus601_600Test() { "318;410;601" ); - returnValueNull = segment13.addPTWayMember(129); - assertNull(returnValueNull); - returnValueNull = segment13.addPTWayMember(128); - assertNull(returnValueNull); final int W_127_Herestraat_10_813970227_C = 813970227; -// final int W_126_Herestraat_9_41403544_B = 41403544; + // W_126_Herestraat_9_41403544_B = 41403544; final int W_125_Herestraat_8_8079995_A = 8079995; - RouteSegmentToExtract segment14 = segment13.addPTWayMember(127); + for (int n = 129; n >= 128; n--) {returnValueNull =segment13.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment14 = segment13.addPTWayMember(127); extractAndAssertValues(127, segment13, segment14, cloneOfBus601RouteRelation, W_128_Herestraat_11_681081951_A, W_99_130_Herestraat_1_249333184_AC, W_127_Herestraat_10_813970227_C, "Herestraat", null, "410;601" ); - for (int n = 126; n >= 125; n--) returnValueNull = segment14.addPTWayMember(n); assertNull(returnValueNull); final int W_124_Rotonde_Het_Teken_41403538_B = 41403538; final int W_123_Ring_Zuid_79340950_A = 79340950; - RouteSegmentToExtract segment15 = segment14.addPTWayMember(124); + for (int n = 126; n >= 125; n--) {returnValueNull =segment14.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment15 = segment14.addPTWayMember(124); extractAndAssertValues(124, segment14, segment15, cloneOfBus601RouteRelation, W_125_Herestraat_8_8079995_A, W_127_Herestraat_10_813970227_C, W_124_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", @@ -296,11 +359,10 @@ public void bus601_600Test() { "410;600;601" ); - returnValueNull = segment15.addPTWayMember(123); assertNull(returnValueNull); - final int W_122_Ring_Zuid_11369123_A = 11369123; - RouteSegmentToExtract segment16 = segment15.addPTWayMember(122); + returnValueNull =segment15.addPTWayMember(123); assertNull(returnValueNull); + RouteSegmentToExtract segment16 = segment15.addPTWayMember(122); extractAndAssertValues(122, segment15, segment16, cloneOfBus601RouteRelation, W_123_Ring_Zuid_79340950_A, W_124_Rotonde_Het_Teken_41403538_B, W_122_Ring_Zuid_11369123_A, "Ring Zuid", @@ -311,8 +373,8 @@ public void bus601_600Test() { final int W_121__159949154_A = 159949154; final int W_120__332258104_B = 332258104; final int W_119_GHB_ingang_78852604_A = 78852604; - RouteSegmentToExtract segment17 = segment16.addPTWayMember(121); + RouteSegmentToExtract segment17 = segment16.addPTWayMember(121); extractAndAssertValues(121, segment16, segment17, cloneOfBus601RouteRelation, W_122_Ring_Zuid_11369123_A, W_122_Ring_Zuid_11369123_A, W_121__159949154_A, null, @@ -322,8 +384,8 @@ public void bus601_600Test() { final int W_118_GHB_p5_377918641_B = 377918641; final int W_117_GHB_p5_14508736_A = 14508736; - RouteSegmentToExtract segment18 = segment17.addPTWayMember(120); + RouteSegmentToExtract segment18 = segment17.addPTWayMember(120); extractAndAssertValues(120, segment17, segment18, cloneOfBus601RouteRelation, W_121__159949154_A, W_121__159949154_A, W_120__332258104_B, null, @@ -331,31 +393,31 @@ public void bus601_600Test() { "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" ); - returnValueNull = segment18.addPTWayMember(119); assertNull(returnValueNull); - final int W_116_Ring_Zuid_p45_109267436_A = 109267436; - RouteSegmentToExtract segment19 = segment18.addPTWayMember(118); + returnValueNull =segment18.addPTWayMember(119); assertNull(returnValueNull); + RouteSegmentToExtract segment19 = segment18.addPTWayMember(118); extractAndAssertValues(118, segment18, segment19, cloneOfBus601RouteRelation, W_119_GHB_ingang_78852604_A, W_120__332258104_B, W_118_GHB_p5_377918641_B, null, null, "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" ); - returnValueNull = segment19.addPTWayMember(117); assertNull(returnValueNull); final int W_115_Ring_Zuid_p3_14508739_A = 14508739; - RouteSegmentToExtract segment20 = segment19.addPTWayMember(116); + returnValueNull =segment19.addPTWayMember(117); assertNull(returnValueNull); + RouteSegmentToExtract segment20 = segment19.addPTWayMember(116); extractAndAssertValues(116, segment19, segment20, cloneOfBus601RouteRelation, W_117_GHB_p5_14508736_A, W_118_GHB_p5_377918641_B, W_116_Ring_Zuid_p45_109267436_A, "Ring Zuid", null, "3;317;395;410;601" ); + final int W_114_Ring_Zuid_p2_14508740_A = 14508740; - RouteSegmentToExtract segment21 = segment20.addPTWayMember(115); + RouteSegmentToExtract segment21 = segment20.addPTWayMember(115); extractAndAssertValues(115, segment20, segment21, cloneOfBus601RouteRelation, W_116_Ring_Zuid_p45_109267436_A, W_116_Ring_Zuid_p45_109267436_A, W_115_Ring_Zuid_p3_14508739_A, "Ring Zuid", @@ -364,8 +426,8 @@ public void bus601_600Test() { ); final int W_113_Ring_Zuid_p1_502328838_D = 502328838; - final int W_112_Ring_Zuid_502328837_C = 502328837; - final int W_111_Ring_Zuid_8080023_B = 8080023; + // W_112_Ring_Zuid_502328837_C = 502328837; + // W_111_Ring_Zuid_8080023_B = 8080023; final int W_110_Rotonde_Het_Teken_78568660_A = 78568660; RouteSegmentToExtract segment22 = segment21.addPTWayMember(114); @@ -383,10 +445,11 @@ public void bus601_600Test() { null, "3;317;334;335;380;395;410;600;601" ); - for (int n = 112; n >= 110; n--) returnValueNull = segment23.addPTWayMember(n); assertNull(returnValueNull); final int W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A = 78873921; + for (int n = 112; n >= 110; n--) {returnValueNull =segment23.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment24 = segment23.addPTWayMember(109); extractAndAssertValues(109, segment23, segment24, cloneOfBus601RouteRelation, W_110_Rotonde_Het_Teken_78568660_A, W_113_Ring_Zuid_p1_502328838_D, @@ -414,6 +477,7 @@ public void bus601_600Test() { null, "3;317;333;334;335;370;371;373;374;380;395;410;600;601" ); + final int W_106_Rotonde_Het_Teken_249333187_A = 249333187; RouteSegmentToExtract segment27 = segment26.addPTWayMember(106); @@ -425,8 +489,8 @@ public void bus601_600Test() { ); final int W_105_Herestraat_7_13067134_D = 13067134; - final int W_104_Herestraat_6_813970232_C = 813970232; - final int W_103_Herestraat_5_813970226_B = 813970226; + // W_104_Herestraat_6_813970232_C = 813970232; + // W_103_Herestraat_5_813970226_B = 813970226; final int W_102_Herestraat_4_813970228_A = 813970228; RouteSegmentToExtract segment28 = segment27.addPTWayMember(105); @@ -440,7 +504,7 @@ public void bus601_600Test() { final int W_101_Herestraat_3_813970229_C = 813970229; // 99 and 100 are defined as 129 and 130 - for (int n = 104; n >= 102; n--) returnValueNull = segment28.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 104; n >= 102; n--) {returnValueNull =segment28.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment29 = segment28.addPTWayMember(101); extractAndAssertValues(101, segment28, segment29, cloneOfBus601RouteRelation, W_102_Herestraat_4_813970228_A, W_105_Herestraat_7_13067134_D, @@ -450,15 +514,15 @@ public void bus601_600Test() { ); final int W_98_Rennes_Singel_249333186_H = 249333186; - final int W_97_Rennes_Singel_192559628_G = 192559628; - final int W_96_Rennes_Singel_161166589_F = 161166589; - final int W_95_Rennes_Singel_813979470_E = 813979470; - final int W_94_Rennes_Singel_79289746_D = 79289746; - final int W_93_Rennes_Singel_813979472_C = 813979472; - final int W_92_Rennes_Singel_8131120_B = 8131120; + // W_97_Rennes_Singel_192559628_G = 192559628; + // W_96_Rennes_Singel_161166589_F = 161166589; + // W_95_Rennes_Singel_813979470_E = 813979470; + // W_94_Rennes_Singel_79289746_D = 79289746; + // W_93_Rennes_Singel_813979472_C = 813979472; + // W_92_Rennes_Singel_8131120_B = 8131120; final int W_91_Rennes_Singel_429706864_A = 429706864; - for (int n = 100; n >= 99; n--) returnValueNull = segment29.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 100; n >= 99; n--) {returnValueNull =segment29.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment30 = segment29.addPTWayMember(98); extractAndAssertValues(98, segment29, segment30, cloneOfBus601RouteRelation, W_99_130_Herestraat_1_249333184_AC, W_101_Herestraat_3_813970229_C, @@ -468,50 +532,50 @@ public void bus601_600Test() { ); final int W_90_Tervuursevest_99583853_K = 99583853; - final int W_89_Tervuursevest_521193379_J = 521193379; - final int W_88_Tervuursevest_521193380_I = 521193380; - final int W_87_Tervuursevest_813979465_H = 813979465; - final int W_86_Tervuursevest_174338458_G = 174338458; - final int W_85_Tervuursevest_608715520_F = 608715520; - final int W_84_Tervuursevest_608715521_E = 608715521; - final int W_83_Tervuursevest_3677944_D = 3677944; - final int W_82_Tervuursevest_174338459_C = 174338459; - final int W_81_Tervuursevest_429706866_B = 429706866; + // W_89_Tervuursevest_521193379_J = 521193379; + // W_88_Tervuursevest_521193380_I = 521193380; + // W_87_Tervuursevest_813979465_H = 813979465; + // W_86_Tervuursevest_174338458_G = 174338458; + // W_85_Tervuursevest_608715520_F = 608715520; + // W_84_Tervuursevest_608715521_E = 608715521; + // W_83_Tervuursevest_3677944_D = 3677944; + // W_82_Tervuursevest_174338459_C = 174338459; + // W_81_Tervuursevest_429706866_B = 429706866; final int W_80_Tervuursevest_88361317_A = 88361317; - for (int n = 97; n >= 91; n--) returnValueNull = segment30.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 97; n >= 91; n--) {returnValueNull =segment30.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment31 = segment30.addPTWayMember(90); - extractAndAssertValues(90, segment30, segment31, cloneOfBus601RouteRelation, W_91_Rennes_Singel_429706864_A, W_98_Rennes_Singel_249333186_H, W_90_Tervuursevest_99583853_K, "Tervuursevest", null, "318;601" ); + final int W_79_Tervuursevest_Kapucijnenvoer_461159345_A = 461159345; - for (int n = 89; n >= 80; n--) returnValueNull = segment31.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 89; n >= 80; n--) {returnValueNull =segment31.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment32 = segment31.addPTWayMember(79); - extractAndAssertValues(79, segment31, segment32, cloneOfBus601RouteRelation, W_80_Tervuursevest_88361317_A, W_90_Tervuursevest_99583853_K, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, "Tervuursevest", null, "601" ); + final int W_78_Tervuursevest_461159362_K = 461159362; - final int W_77_Tervuursevest_344507822_J = 344507822; - final int W_76_Tervuursevest_461159367_I = 461159367; - final int W_75_Tervuursevest_3677335_H = 3677335; - final int W_74_Tervuursevest_31474001_G = 31474001; - final int W_73_Tervuursevest_23237288_F = 23237288; - final int W_72_Tervuursevest_90168773_E = 90168773; - final int W_71_Tervuursevest_23237287_D = 23237287; - final int W_70_Tervuursevest_608715561_C = 608715561; - final int W_69_Tervuursevest_608715562_B = 608715562; + // W_77_Tervuursevest_344507822_J = 344507822; + // W_76_Tervuursevest_461159367_I = 461159367; + // W_75_Tervuursevest_3677335_H = 3677335; + // W_74_Tervuursevest_31474001_G = 31474001; + // W_73_Tervuursevest_23237288_F = 23237288; + // W_72_Tervuursevest_90168773_E = 90168773; + // W_71_Tervuursevest_23237287_D = 23237287; + // W_70_Tervuursevest_608715561_C = 608715561; + // W_69_Tervuursevest_608715562_B = 608715562; final int W_68_Tervuursevest_3677330_A = 3677330; - RouteSegmentToExtract segment33 = segment32.addPTWayMember(78); + RouteSegmentToExtract segment33 = segment32.addPTWayMember(78); extractAndAssertValues(78, segment32, segment33, cloneOfBus601RouteRelation, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, W_78_Tervuursevest_461159362_K, "Tervuursevest", @@ -520,23 +584,23 @@ public void bus601_600Test() { ); final int W_67_Naamsevest_86164005_G = 86164005; - final int W_66_Naamsevest_655251293_F = 655251293; - final int W_65_Naamsevest_131571763_E = 131571763; - final int W_64_Naamsevest_661733369_D = 661733369; - final int W_63_Naamsevest_655251292_C = 655251292; - final int W_62_Naamsevest_3677823_B = 3677823; + // W_66_Naamsevest_655251293_F = 655251293; + // W_65_Naamsevest_131571763_E = 131571763; + // W_64_Naamsevest_661733369_D = 661733369; + // W_63_Naamsevest_655251292_C = 655251292; + // W_62_Naamsevest_3677823_B = 3677823; final int W_61_Geldenaaksevest_24905257_A = 24905257; final int W_60_Geldenaaksevest_608715605_H = 608715605; - final int W_59_Geldenaaksevest_608715606_G = 608715606; - final int W_58_Geldenaaksevest_79299303_F = 79299303; - final int W_57_Geldenaaksevest_10296368_E = 10296368; - final int W_56_Geldenaaksevest_521193607_D = 521193607; - final int W_55_Geldenaaksevest_94585453_C = 94585453; - final int W_54_Geldenaaksevest_586268893_B = 586268893; + // W_59_Geldenaaksevest_608715606_G = 608715606; + // W_58_Geldenaaksevest_79299303_F = 79299303; + // W_57_Geldenaaksevest_10296368_E = 10296368; + // W_56_Geldenaaksevest_521193607_D = 521193607; + // W_55_Geldenaaksevest_94585453_C = 94585453; + // W_54_Geldenaaksevest_586268893_B = 586268893; final int W_53_Geldenaaksevest_8130906_A = 8130906; - for (int n = 77; n >= 68; n--) returnValueNull = segment33.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 77; n >= 68; n--) {returnValueNull =segment33.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment34 = segment33.addPTWayMember(67); extractAndAssertValues(67, segment33, segment34, cloneOfBus601RouteRelation, W_68_Tervuursevest_3677330_A, W_78_Tervuursevest_461159362_K, @@ -546,32 +610,32 @@ public void bus601_600Test() { ); final int W_52_Tiensepoort_16775171_D = 16775171; - final int W_51_Tiensevest_8131717_C = 8131717; - final int W_50_Tiensevest_12712557_B = 12712557; + // W_51_Tiensevest_8131717_C = 8131717; + // W_50_Tiensevest_12712557_B = 12712557; final int W_49_Tiensevest_Oostertunnel_8590231_A = 8590231; - for (int n = 66; n >= 62; n--) returnValueNull = segment34.addPTWayMember(n); assertNull(returnValueNull); - RouteSegmentToExtract segment35 = segment34.addPTWayMember(61); - extractAndAssertValues(61, segment34, segment35, cloneOfBus601RouteRelation, - W_62_Naamsevest_3677823_B, W_67_Naamsevest_86164005_G, - W_61_Geldenaaksevest_24905257_A, "Geldenaaksevest", + for (int n = 66; n >= 61; n--) {returnValueNull =segment34.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment35 = segment34.addPTWayMember(60); + extractAndAssertValues(60, segment34, segment35, cloneOfBus601RouteRelation, + W_61_Geldenaaksevest_24905257_A, W_67_Naamsevest_86164005_G, + W_60_Geldenaaksevest_608715605_H, "Geldenaaksevest", null, "18;178;179;306 (student);337;601;616" ); - for (int n = 60; n >= 53; n--) returnValueNull = segment35.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 60; n >= 53; n--) {returnValueNull =segment35.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment36 = segment35.addPTWayMember(52); - extractAndAssertValues(52, segment35, segment36, cloneOfBus601RouteRelation, - W_53_Geldenaaksevest_8130906_A, W_61_Geldenaaksevest_24905257_A, + W_53_Geldenaaksevest_8130906_A, W_60_Geldenaaksevest_608715605_H, W_52_Tiensepoort_16775171_D, "Tiensepoort", null, "18;178;179;306 (student);337;601;616;630" ); + final int W_48_Tiensevest_185988814_A = 185988814; - for (int n = 51; n >= 49; n--) returnValueNull = segment36.addPTWayMember(n); assertNull(returnValueNull); - RouteSegmentToExtract segment37 = segment36.addPTWayMember(48); + for (int n = 51; n >= 49; n--) {returnValueNull =segment36.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment37 = segment36.addPTWayMember(48); extractAndAssertValues(48, segment36, segment37, cloneOfBus601RouteRelation, W_49_Tiensevest_Oostertunnel_8590231_A, W_52_Tiensepoort_16775171_D, W_48_Tiensevest_185988814_A, "Tiensevest", @@ -580,8 +644,8 @@ public void bus601_600Test() { ); final int W_47_Martelarenplein_76856823_D = 76856823; - final int W_46_Martelarenplein_459446598_C = 459446598; - final int W_45_Martelarenplein_459446600_B = 459446600; + // W_46_Martelarenplein_459446598_C = 459446598; + // W_45_Martelarenplein_459446600_B = 459446600; final int W_44__78815533_A = 78815533; RouteSegmentToExtract segment38 = segment37.addPTWayMember(47); @@ -589,12 +653,12 @@ public void bus601_600Test() { W_48_Tiensevest_185988814_A, W_48_Tiensevest_185988814_A, W_47_Martelarenplein_76856823_D, "Martelarenplein", null, - "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;600;601;616;630" + "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630" ); final int W_43__79264899_A = 79264899; - for (int n = 46; n >= 44; n--) returnValueNull = segment38.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 46; n >= 44; n--) {returnValueNull =segment38.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment39 = segment38.addPTWayMember(43); extractAndAssertValues(43, segment38, segment39, cloneOfBus601RouteRelation, W_44__78815533_A, W_47_Martelarenplein_76856823_D, @@ -602,6 +666,7 @@ public void bus601_600Test() { null, "7;8;9;18;178;179;306 (student);337;380;527;601;630" ); + final int W_42__377918635_A = 377918635; RouteSegmentToExtract segment40 = segment39.addPTWayMember(42); @@ -620,33 +685,29 @@ public void bus601_600Test() { null, "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601" ); - final int W_40__79264897_A = 79264897; + + final int W_40__79264897_B = 79264897; + final int W_39__71754927_A = 71754927; RouteSegmentToExtract segment42 = segment41.addPTWayMember(40); extractAndAssertValues(40, segment41, segment42, cloneOfBus601RouteRelation, W_41__79264888_A, W_41__79264888_A, - W_40__79264897_A, null, + W_40__79264897_B, null, null, "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601" ); - final int W_39__71754927_A = 71754927; - RouteSegmentToExtract segment43 = segment42.addPTWayMember(39); - extractAndAssertValues(39, segment42, segment43, cloneOfBus601RouteRelation, - W_40__79264897_A, W_40__79264897_A, - W_39__71754927_A, null, - null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601" - ); final int W_38__377918638_A_TEC18 = 377918638; - RouteSegmentToExtract segment44 = segment43.addPTWayMember(38); - extractAndAssertValues(38, segment43, segment44, cloneOfBus601RouteRelation, - W_39__71754927_A, W_39__71754927_A, + returnValueNull =segment42.addPTWayMember(39); assertNull(returnValueNull); + RouteSegmentToExtract segment44 = segment42.addPTWayMember(38); + extractAndAssertValues(38, segment42, segment44, cloneOfBus601RouteRelation, + W_39__71754927_A, W_40__79264897_B, W_38__377918638_A_TEC18, null, null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;475;485;512;513;520;524;525;601" + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601" ); + final int W_37__79264891_A = 79264891; RouteSegmentToExtract segment45 = segment44.addPTWayMember(37); @@ -654,7 +715,7 @@ public void bus601_600Test() { W_38__377918638_A_TEC18, W_38__377918638_A_TEC18, W_37__79264891_A, null, null, - "601" // TODO, here line 18 has its first way in common with 601 + "18;601" ); final int W_36_Tiensevest_78568409_A = 78568409; @@ -679,25 +740,25 @@ public void bus601_600Test() { final int W_27_Zoutstraat_3992548_A = 3992548; RouteSegmentToExtract segment48 = segment47.addPTWayMember(34); - extractAndAssertValues(34, segment47, segment48, cloneOfBus601RouteRelation, W_35_Tiensevest_79193579_A, W_35_Tiensevest_79193579_A, W_34_Bend_19793394_A, null, null, "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658" ); + final int W_26_Havenkant_510790349_M = 510790349; - final int W_25_Havenkant_510790348_L = 510790348; - final int W_24_Havenkant_314635787_K = 314635787; - final int W_23_Havenkant_843534478_J = 843534478; - final int W_22_Havenkant_406205781_I = 406205781; - final int W_21_Havenkant_270181176_H = 270181176; - final int W_20_Havenkant_330300725_G = 330300725; - final int W_19_Burchtstraat_3869822_F = 3869822; - final int W_18_Achter_de_latten_330300723_E = 330300723; - final int W_17_Wolvengang_659297690_D = 659297690; - final int W_16_Wolvengang_25928482_C = 25928482; - final int W_15_Engels_Plein_3869812_B = 3869812; + // W_25_Havenkant_510790348_L = 510790348; + // W_24_Havenkant_314635787_K = 314635787; + // W_23_Havenkant_843534478_J = 843534478; + // W_22_Havenkant_406205781_I = 406205781; + // W_21_Havenkant_270181176_H = 270181176; + // W_20_Havenkant_330300725_G = 330300725; + // W_19_Burchtstraat_3869822_F = 3869822; + // W_18_Achter_de_latten_330300723_E = 330300723; + // W_17_Wolvengang_659297690_D = 659297690; + // W_16_Wolvengang_25928482_C = 25928482; + // W_15_Engels_Plein_3869812_B = 3869812; final int W_14_Engels_Plein_338057820_A = 338057820; RouteSegmentToExtract segment49 = segment48.addPTWayMember(33); @@ -717,7 +778,7 @@ public void bus601_600Test() { ); assertEquals(rel8.getId(), rel50.getId()); - for (int n = 31; n >= 29; n--) returnValueNull = segment50.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 31; n >= 29; n--) {returnValueNull =segment50.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment51 = segment50.addPTWayMember(28); Relation rel51 = extractAndAssertValues(28, segment50, segment51, cloneOfBus601RouteRelation, W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, @@ -744,7 +805,7 @@ public void bus601_600Test() { "334;335;513;601;630" ); - for (int n = 25; n >= 14; n--) returnValueNull = segment53.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 25; n >= 14; n--) {returnValueNull =segment53.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment54 = segment53.addPTWayMember(13); extractAndAssertValues(13, segment53, segment54, cloneOfBus601RouteRelation, W_14_Engels_Plein_338057820_A, W_26_Havenkant_510790349_M, @@ -776,25 +837,25 @@ public void bus601_600Test() { assertEquals(Collections.emptyList(), segment101.getWayMembers()); final int W_169_Engels_Plein_608715622_O = 608715622; - final int W_168_Engels_Plein_338057819_N = 338057819; - final int W_167_Engels_Plein_305316104_M = 305316104; - final int W_166_Engels_Plein_3869812_L = 3869812; - final int W_165_Wolvengang_25928482_K = 25928482; - final int W_164_Wolvengang_659297690_J = 659297690; - final int W_163_Achter_de_latten_330300723_I = 330300723; - final int W_162_Burchtstraat_3869822_H = 3869822; - final int W_161_Havenkant_330300725_G = 330300725; - final int W_160_Havenkant_270181176_F = 270181176; - final int W_159_Havenkant_406205781_E = 406205781; - final int W_158_Havenkant_843534478_D = 843534478; - final int W_157_Havenkant_314635787_C = 314635787; - final int W_156_Havenkant_510790348_B = 510790348; + // W_168_Engels_Plein_338057819_N = 338057819; + // W_167_Engels_Plein_305316104_M = 305316104; + // W_166_Engels_Plein_3869812_L = 3869812; + // W_165_Wolvengang_25928482_K = 25928482; + // W_164_Wolvengang_659297690_J = 659297690; + // W_163_Achter_de_latten_330300723_I = 330300723; + // W_162_Burchtstraat_3869822_H = 3869822; + // W_161_Havenkant_330300725_G = 330300725; + // W_160_Havenkant_270181176_F = 270181176; + // W_159_Havenkant_406205781_E = 406205781; + // W_158_Havenkant_843534478_D = 843534478; + // W_157_Havenkant_314635787_C = 314635787; + // W_156_Havenkant_510790348_B = 510790348; final int W_155_Havenkant_29283599_A = 29283599; final int W_154_Havenkant_304241968_B = 304241968; final int W_153_Aarschotsesteenweg_304241967_A = 304241967; - for (int n = 169; n >= 155; n--) returnValueNull = segment101.addPTWayMember(n); assertNull(returnValueNull); + for (int n = 169; n >= 155; n--) {returnValueNull =segment101.addPTWayMember(n); assertNull(returnValueNull);} RouteSegmentToExtract segment102 = segment101.addPTWayMember(154); extractAndAssertValues(154, segment101, segment102, cloneOfBus600RouteRelation, W_155_Havenkant_29283599_A, W_169_Engels_Plein_608715622_O, @@ -806,7 +867,7 @@ public void bus601_600Test() { final int W_152_Redersstraat_340265961_B = 340265961; final int W_151_Redersstraat_318825613_A = 318825613; - returnValueNull = segment102.addPTWayMember(153); assertNull(returnValueNull); + returnValueNull =segment102.addPTWayMember(153); assertNull(returnValueNull); RouteSegmentToExtract segment103 = segment102.addPTWayMember(152); extractAndAssertValues(152, segment102, segment103, cloneOfBus600RouteRelation, W_153_Aarschotsesteenweg_304241967_A, W_154_Havenkant_304241968_B, @@ -817,7 +878,7 @@ public void bus601_600Test() { final int W_150_Redersstraat_340265962_A = 340265962; - returnValueNull = segment103.addPTWayMember(151); assertNull(returnValueNull); + returnValueNull =segment103.addPTWayMember(151); assertNull(returnValueNull); RouteSegmentToExtract segment104 = segment103.addPTWayMember(150); extractAndAssertValues(150, segment103, segment104, cloneOfBus600RouteRelation, W_151_Redersstraat_318825613_A, W_152_Redersstraat_340265961_B, @@ -826,6 +887,44 @@ public void bus601_600Test() { "600" ); + final int W_149_Joanna_Maria_Artoisplein_254801390_B = 254801390; + final int W_148_Joanna_Maria_Artoisplein_61540068_A = 61540068; + + RouteSegmentToExtract segment105 = segment104.addPTWayMember(149); + extractAndAssertValues(149, segment104, segment105, cloneOfBus600RouteRelation, + W_150_Redersstraat_340265962_A, W_150_Redersstraat_340265962_A, + W_149_Joanna_Maria_Artoisplein_254801390_B, "Joanna-Maria Artoisplein", + null, + "333;334;335;513;600;630" + ); + + final int W_147_Vuurkruisenlaan_23691160_C = 23691160; + // W_146_Vuurkruisenlaan_4061640_B = 4061640; + final int W_145_Diestsepoort_8109264_A = 8109264; + + returnValueNull =segment105.addPTWayMember(148); assertNull(returnValueNull); + RouteSegmentToExtract segment106 = segment105.addPTWayMember(147); + extractAndAssertValues(147, segment105, segment106, cloneOfBus600RouteRelation, + W_148_Joanna_Maria_Artoisplein_61540068_A, W_149_Joanna_Maria_Artoisplein_254801390_B, + W_147_Vuurkruisenlaan_23691160_C, "Vuurkruisenlaan", + null, + "178;318;333;334;335;410;513;600;630;651;652;658" + ); + + final int W_144_Diestsepoort_61556877_D = 61556877; + // W_143_Diestsepoort_663770966_C = 663770966; + // W_142_Diestsepoort_584356749_B = 584356749; + final int W_141_Diestsepoort_584356745_A = 584356745; + + for (int n = 146; n >= 145; n--) {returnValueNull =segment106.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment107 = segment106.addPTWayMember(144); + extractAndAssertValues(144, segment106, segment107, cloneOfBus600RouteRelation, + W_145_Diestsepoort_8109264_A, W_147_Vuurkruisenlaan_23691160_C, + W_144_Diestsepoort_61556877_D, "Diestsepoort", + null, + "333;334;335;513;600;630;651;652;658" + ); + } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, From deb7c6db686225d1323258b9f6f1aa0e4221e4e5 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Tue, 6 Oct 2020 09:49:02 +0200 Subject: [PATCH 31/52] Added some more unit tests and needed to check that if one of the parent ways is the first way, that it also was for an itinerary going in the same direction. --- .../data/RouteSegmentToExtract.java | 4 +- .../data/RouteSegmentToExtractTest.java | 53 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 1dc8f2ed..4aa1ca6c 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -273,7 +273,9 @@ public TreeSet getItinerariesInSameDirection( long occurrences = getMembershipCount(waysInCurrentRoute.currentWay, parentRoute); if (!itinerariesInSameDirection.contains(parentRoute)) { final Way firstHighwayInParentRoute = getHighways(parentRoute).get(0); - if (firstHighwayInParentRoute == waysInCurrentRoute.currentWay) { + final Way secondHighwayInParentRoute = getHighways(parentRoute).get(1); + if (firstHighwayInParentRoute == waysInCurrentRoute.currentWay + && !waysInCurrentRoute.previousWay.getNodes().contains(secondHighwayInParentRoute.getNode(0))) { itinerariesInSameDirection.add(parentRoute); } for (WaySequence waysInParentRoute : findPreviousAndNextWayInRoute( diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 97652a23..0bdd3059 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -925,6 +925,59 @@ public void bus601_600Test() { "333;334;335;513;600;630;651;652;658" ); + final int W_140_Diestsepoort_198559166_E = 198559166; + // W_139_Diestsepoort_584356751_D = 584356751; + // W_138_Diestsepoort_451873773_C = 451873773; + // W_137_Diestsepoort_584356742_B = 584356742; + final int W_136_Diestsepoort_451873774_A = 451873774; + + for (int n = 143; n >= 141; n--) {returnValueNull =segment107.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment108 = segment107.addPTWayMember(140); + extractAndAssertValues(140, segment107, segment108, cloneOfBus600RouteRelation, + W_141_Diestsepoort_584356745_A, W_144_Diestsepoort_61556877_D, + W_140_Diestsepoort_198559166_E, "Diestsepoort", + null, + "2;3;179;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658" + ); + + final int W_135__76867049_C = 76867049; + // W_134__79264890_B = 79264890; + final int W_133__79596965_A = 79596965; + + for (int n = 139; n >= 136; n--) {returnValueNull =segment108.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment109 = segment108.addPTWayMember(135); + extractAndAssertValues(135, segment108, segment109, cloneOfBus600RouteRelation, + W_136_Diestsepoort_451873774_A, W_140_Diestsepoort_198559166_E, + W_135__76867049_C, null, + null, + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658" + ); + + final int W_132__79596974_B = 79596974; + final int W_131__79596982_A = 79596982; + final int W_130__79596987_A = 79596987; + + for (int n = 134; n >= 133; n--) {returnValueNull =segment109.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment110 = segment109.addPTWayMember(132); + extractAndAssertValues(132, segment109, segment110, cloneOfBus600RouteRelation, + W_133__79596965_A, W_135__76867049_C, + W_132__79596974_B, null, + null, + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630" + ); + + final int W_129__377918658_A = 377918658; + final int W_128__79596980_A = 79596980; + + returnValueNull =segment110.addPTWayMember(131); assertNull(returnValueNull); + RouteSegmentToExtract segment111 = segment110.addPTWayMember(130); + extractAndAssertValues(130, segment110, segment111, cloneOfBus600RouteRelation, + W_131__79596982_A, W_132__79596974_B, + W_130__79596987_A, null, + null, + "3;333;334;335;433;600;630" + ); + } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, From 28f11b6ca7bb7f5f175c5fd8fde3cc537975b5bf Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 7 Oct 2020 13:40:41 +0200 Subject: [PATCH 32/52] Added a lookup for itineraryWays per relation, so it only needs to be calculated once. They are needed over and over again for each of the parent route relations of all the member ways. Modified WaySequence according to Florian's suggestions. Stopped excluding the relation that is processed from the parent route relations. --- .../data/RouteSegmentToExtract.java | 201 +++++++++--------- .../pt_assistant/data/WaySequence.java | 71 ++++--- .../data/RouteSegmentToExtractTest.java | 177 +++++++-------- 3 files changed, 237 insertions(+), 212 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 4aa1ca6c..9658ce4e 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -35,6 +35,7 @@ public class RouteSegmentToExtract { private static final Map ptSegments; private static final Map> parentRelationsForSameDirectionOfTravel; + private static final Map> itineraryWays; private DataSet activeDataSet; private Relation relation; private Relation extractedRelation; @@ -53,6 +54,7 @@ public class RouteSegmentToExtract { static { ptSegments = new HashMap<>(); parentRelationsForSameDirectionOfTravel = new HashMap<>(); + itineraryWays = new HashMap<>(); } /** @@ -178,81 +180,87 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; - WaySequence waysInCurrentRoute = new WaySequence<>(relation, index); - if (waysInCurrentRoute.currentWay != null) { - WaySequence nextWaysInCurrentRoute = new WaySequence<>(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay, waysInCurrentRoute.wayAfterNextWay); - - if (this.itinerariesInSameDirection == null && nextWaysInCurrentRoute.currentWay != null) { - TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute); - if (itinerariesInSameDirection != null) { - this.itinerariesInSameDirection = itinerariesInSameDirection; - for (Relation relation : itinerariesInSameDirection) { - addLineIdentifier(relation.get("ref")); - addColour(relation.get("colour")); - } + WaySequence waysInCurrentRoute = new WaySequence(relation, index); + if (waysInCurrentRoute.currentWay == null) { + return null; + } + WaySequence nextWaysInCurrentRoute = new WaySequence(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay, waysInCurrentRoute.wayAfterNextWay); + + if (this.itinerariesInSameDirection == null && nextWaysInCurrentRoute.currentWay != null) { + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute); + if (itinerariesInSameDirection != null) { + this.itinerariesInSameDirection = itinerariesInSameDirection; + for (Relation relation : itinerariesInSameDirection) { + addLineIdentifier(relation.get("ref")); + addColour(relation.get("colour")); } } + } - if (wayMembers.size() == 0) { - addWay(index, true); + if (wayMembers.size() == 0) { + addWay(index, true); + } else { + List parentRouteRelations = + Utils.filteredCollection(waysInCurrentRoute.currentWay.getReferrers(), Relation.class).stream() +// .filter(r -> r.getId() != relation.getId()) + .filter(RouteUtils::isVersionTwoPTRoute) + .collect(Collectors.toList()); + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); + boolean startNewSegmentInNewSegment = false; + if (this.itinerariesInSameDirection != null + && itinerariesInSameDirection.size() != 0 + && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) + && !(getMembershipCount(waysInCurrentRoute.currentWay, relation) > 1 + && waysInCurrentRoute.currentWay.equals(getFirstWay(relation))) + ) { + startNewSegment = true; } else { - List parentRouteRelations = - Utils.filteredCollection(waysInCurrentRoute.currentWay.getReferrers(), Relation.class).stream() - .filter(r -> r.getId() != relation.getId()) - .filter(RouteUtils::isVersionTwoPTRoute) - .collect(Collectors.toList()); - TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); - boolean startNewSegmentInNewSegment = false; - if (this.itinerariesInSameDirection != null - && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection)) { - startNewSegment = true; - } else { - this.itinerariesInSameDirection = itinerariesInSameDirection; - for (Relation parentRoute : itinerariesInSameDirection) { - if (waysInCurrentRoute.currentWay == getLastWay(parentRoute) - || getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1) { - startNewSegment = true; - if (getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1) { - startNewSegmentInNewSegment = true; - } + this.itinerariesInSameDirection = itinerariesInSameDirection; + for (Relation parentRoute : itinerariesInSameDirection) { + if (waysInCurrentRoute.currentWay == getLastWay(parentRoute) + || getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1 + && !parentRoute.equals(relation)) { + startNewSegment = true; + if (getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1) { + startNewSegmentInNewSegment = true; } } } - if (startNewSegment) { - RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation, activeDataSet); - newSegment.addPTWayMember(index); - newSegment.itinerariesInSameDirection = itinerariesInSameDirection; - newSegment.populateLineIdentifierAndColourLists(); - newSegment.startNewSegment = startNewSegmentInNewSegment; - - return newSegment; - } else { - if (this.itinerariesInSameDirection == null) { - this.itinerariesInSameDirection = itinerariesInSameDirection; - populateLineIdentifierAndColourLists(); - } - addWay(index); + } + if (startNewSegment) { + RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation, activeDataSet); + newSegment.addPTWayMember(index); + newSegment.itinerariesInSameDirection = itinerariesInSameDirection; + newSegment.populateLineIdentifierAndColourLists(); + newSegment.startNewSegment = startNewSegmentInNewSegment; + + return newSegment; + } else { + if (this.itinerariesInSameDirection == null) { + this.itinerariesInSameDirection = itinerariesInSameDirection; + populateLineIdentifierAndColourLists(); } + addWay(index); } } return null; } - public Way getLastWay(Relation parentRoute) { - Way lastWayInParentRoute = null; - List members = parentRoute.getMembers(); - for (int j = members.size() - 1; j >= 0; j--) { - RelationMember rm = members.get(j); - if (rm.isWay() && RouteUtils.isPTWay(rm)) { - lastWayInParentRoute = rm.getWay(); - break; - } - } - return lastWayInParentRoute; + public Way getFirstWay(Relation ptRoute) { + return getItineraryWays(ptRoute).get(0); + } + + public Way getSecondWay(Relation ptRoute) { + return getItineraryWays(ptRoute).get(1); + } + + public Way getLastWay(Relation ptRoute) { + final List highways = getItineraryWays(ptRoute); + return highways.get(highways.size() - 1); } public TreeSet getItinerariesInSameDirection( - WaySequence waysInCurrentRoute) { + WaySequence waysInCurrentRoute) { final String wayInRelation = relation.getId() + "," + waysInCurrentRoute.currentWay.getId(); if (parentRelationsForSameDirectionOfTravel.containsKey(wayInRelation)) { return parentRelationsForSameDirectionOfTravel.get(wayInRelation); @@ -261,7 +269,7 @@ public TreeSet getItinerariesInSameDirection( } public TreeSet getItinerariesInSameDirection( - WaySequence waysInCurrentRoute, + WaySequence waysInCurrentRoute, List parentRouteRelations) { TreeSet r = getItinerariesInSameDirection(waysInCurrentRoute); if (r != null) { @@ -269,21 +277,17 @@ public TreeSet getItinerariesInSameDirection( } else { TreeSet itinerariesInSameDirection = new TreeSet<>(); for (Relation parentRoute : parentRouteRelations) { - final List parentRouteHighways = getHighways(parentRoute); - long occurrences = getMembershipCount(waysInCurrentRoute.currentWay, parentRoute); + final List parentRouteHighways = getItineraryWays(parentRoute); if (!itinerariesInSameDirection.contains(parentRoute)) { - final Way firstHighwayInParentRoute = getHighways(parentRoute).get(0); - final Way secondHighwayInParentRoute = getHighways(parentRoute).get(1); - if (firstHighwayInParentRoute == waysInCurrentRoute.currentWay - && !waysInCurrentRoute.previousWay.getNodes().contains(secondHighwayInParentRoute.getNode(0))) { + if (getFirstWay(parentRoute) == waysInCurrentRoute.currentWay + && waysInCurrentRoute.previousWay != null + && !waysInCurrentRoute.previousWay.getNodes().contains(getSecondWay(parentRoute).getNode(0))) { itinerariesInSameDirection.add(parentRoute); } - for (WaySequence waysInParentRoute : findPreviousAndNextWayInRoute( - parentRouteHighways, waysInCurrentRoute.currentWay)) { - if (isItineraryInSameDirection(waysInCurrentRoute, waysInParentRoute, occurrences)) { - itinerariesInSameDirection.add(parentRoute); - } - } + findPreviousAndNextWayInRoute(parentRouteHighways, waysInCurrentRoute.currentWay).stream() + .filter(waysInParentRoute -> isItineraryInSameDirection(waysInCurrentRoute, waysInParentRoute)) + .map(waysInParentRoute -> parentRoute) + .forEachOrdered(itinerariesInSameDirection::add); } } if (getMembershipCount(waysInCurrentRoute.currentWay, relation) < 2) { @@ -295,19 +299,23 @@ public TreeSet getItinerariesInSameDirection( } } - public List getHighways(Relation parentRoute) { - final List parentRouteMembers = parentRoute.getMembers(); - List ways = new ArrayList<>(); - for (RelationMember rm : parentRouteMembers) { - if (RouteUtils.isPTWay(rm)) { - if (rm.isWay()) { - ways.add(rm.getWay()); - } else if (rm.isRelation()) { - getHighways(rm.getRelation()).forEach(ways::add); + public ArrayList getItineraryWays(Relation ptRoute) { + if (itineraryWays.containsKey(ptRoute)) { + return (ArrayList) itineraryWays.get(ptRoute); + } else { + ArrayList itinerary = new ArrayList<>(); + ptRoute.getMembers().stream().filter(RouteUtils::isPTWay) + .forEachOrdered(rm -> { + if (rm.isWay()) { + itinerary.add(rm.getWay()); + } else if (rm.isRelation()) { + getItineraryWays(rm.getRelation()).forEach(itinerary::add); + } } - } + ); + itineraryWays.put(ptRoute, itinerary); + return itinerary; } - return ways; } public long getMembershipCount(Way way, Relation routeRelation) { @@ -316,9 +324,8 @@ public long getMembershipCount(Way way, Relation routeRelation) { .count(); } - public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, - WaySequence waysInParentRoute, - long currentWayOccurrencesInParentRoute) { + public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, + WaySequence waysInParentRoute) { assert waysInCurrentRoute.currentWay == waysInParentRoute.currentWay : "this only works when comparing two equivalent way sequences" ; @@ -368,32 +375,30 @@ public boolean isItineraryInSameDirection(WaySequence waysIn * @param wayToLocate The way to locate in the list * @return a list of way triplets */ - private static List> findPreviousAndNextWayInRoute(List highwayMembers, Way wayToLocate) { - final long wayToLocateId = wayToLocate.getId(); - Way previousWay = null; + private static List findPreviousAndNextWayInRoute(List highwayMembers, Way wayToLocate) { + Way wayAtIndexPosition; Way nextWay = null; Way wayAfterNextWay = null; boolean foundWay = false; - List> waySequences = new ArrayList<>(); + List waySequences = new ArrayList<>(); for (int j = highwayMembers.size() - 1; j>=0 ; j--) { - Way highway = highwayMembers.get(j); - previousWay = highway; + wayAtIndexPosition = highwayMembers.get(j); if (foundWay) { - if (previousWay == wayToLocate) { - previousWay = null; + if (wayAtIndexPosition == wayToLocate) { + wayAtIndexPosition = null; } - waySequences.add(0, new WaySequence<>( - previousWay, wayToLocate, nextWay, wayAfterNextWay)); + waySequences.add(0, new WaySequence( + wayAtIndexPosition, wayToLocate, nextWay, wayAfterNextWay)); wayAfterNextWay = null; nextWay = null; foundWay = false; continue; } - if (previousWay.getId() == wayToLocateId) { + if (wayAtIndexPosition.equals(wayToLocate)) { foundWay = true; } else { wayAfterNextWay = nextWay; - nextWay = previousWay; + nextWay = wayAtIndexPosition; } } return waySequences; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java index 4f45b402..d956ba85 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -4,9 +4,11 @@ import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.data.osm.Way; +import java.util.List; + import static org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils.isPTWay; -public final class WaySequence { +public final class WaySequence { public Way previousWay; public Way currentWay; public Way nextWay; @@ -16,20 +18,38 @@ public WaySequence() { this(null, null, null, null); } - public WaySequence(RelationMember currentMember) { - this(null, null, null, null); - setCurrentPtWay(currentMember); - } - public WaySequence(Relation relation, int index) { - this(null, null, null, null); - setCurrentPtWay(relation.getMember(index)); + final RelationMember currentMember = relation.getMember(index); + if (isPTWay(currentMember)) { + if (currentMember.isRelation()) { + final Relation subRelation = currentMember.getRelation(); + if (subRelation.getMembersCount() == 1) { + final RelationMember subRelationMember = subRelation.getMember(0); + if (subRelationMember.isWay()) { + currentWay = subRelationMember.getWay(); + } else { + // if there is a relation with a single way at this position, no problem + // But if that sub relation has more than a single member, there is no + // possibility to decide which way is meant + currentWay = null; + return; + } + } + } else if (currentMember.isWay()) { + currentWay = currentMember.getWay(); + } + } else { + // the member was probably a stop or platform + currentWay = null; + return; + } if (index > 1) setPreviousPtWay(relation.getMember(index - 1)); final int membersCount = relation.getMembersCount(); - if (index < membersCount -1) + if (index < membersCount -1) { setNextPtWay(relation.getMember(index + 1)); - if (index < membersCount -2) - setAfterNextPtWay(relation.getMember(index + 2)); + if (index < membersCount - 2) + setAfterNextPtWay(relation.getMember(index + 2)); + } } public WaySequence(Way previousWay, Way currentWay, Way nextWay) @@ -44,26 +64,26 @@ public WaySequence(Way previousWay, Way currentWay, Way nextWay, Way wayAfterNex this.wayAfterNextWay = wayAfterNextWay; } - public void setCurrentPtWay(RelationMember currentMember) { - if (currentMember.isWay() && isPTWay(currentMember)) { - currentWay = currentMember.getWay(); - } else { - currentWay = null; - } - } - public void setPreviousPtWay(RelationMember previousMember) { - if (previousMember.isWay() && isPTWay(previousMember)) { - previousWay = previousMember.getWay(); + if (isPTWay(previousMember)) { + if (previousMember.isWay()) { + previousWay = previousMember.getWay(); + } else if (previousMember.isRelation()) { + List subRelationMembers = previousMember.getRelation().getMembers(); + previousWay = subRelationMembers.get(subRelationMembers.size() - 1).getWay(); + } } else { previousWay = null; } - } public void setNextPtWay(RelationMember nextMember) { - if (nextMember.isWay() && isPTWay(nextMember)) { + if (isPTWay(nextMember)) { + if (nextMember.isWay()) { nextWay = nextMember.getWay(); + } else if (nextMember.isRelation()) { + nextWay = nextMember.getRelation().getMember(0).getWay(); + } } else { nextWay = null; } @@ -73,12 +93,11 @@ public void setAfterNextPtWay(RelationMember afterNextMember) { if (isPTWay(afterNextMember)) { if (afterNextMember.isWay()) { wayAfterNextWay = afterNextMember.getWay(); - return; } else if (afterNextMember.isRelation()) { wayAfterNextWay = afterNextMember.getRelation().getMember(0).getWay(); - return; } + } else { + wayAfterNextWay = null; } - wayAfterNextWay = null; } } diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 0bdd3059..1750dbf3 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -22,6 +22,7 @@ public class RouteSegmentToExtractTest extends AbstractTest{ private static DataSet ds; private static Collection allRelations; private static Collection allWays; + private final static String rc = " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way"; @BeforeClass public static void init() throws FileNotFoundException, IllegalDataException { @@ -48,22 +49,22 @@ public void isItineraryInSameDirectionTest() { .filter(relation -> relation.getId() == 1606056) .findFirst().orElse(null); - WaySequence waysInParentRouteOf601 = new WaySequence<>( + WaySequence waysInParentRouteOf601 = new WaySequence( bus601RouteRelation.getMembers().get(156).getWay(), bus601RouteRelation.getMembers().get(157).getWay(), bus601RouteRelation.getMembers().get(158).getWay()); - WaySequence waysInParentRouteOf358 = new WaySequence<>( + WaySequence waysInParentRouteOf358 = new WaySequence( bus358RouteRelation.getMembers().get(114).getWay(), bus358RouteRelation.getMembers().get(115).getWay(), bus358RouteRelation.getMembers().get(116).getWay()); - WaySequence waysInParentRouteOf371 = new WaySequence<>( + WaySequence waysInParentRouteOf371 = new WaySequence( bus371RouteRelation.getMembers().get(132).getWay(), bus371RouteRelation.getMembers().get(133).getWay(), bus371RouteRelation.getMembers().get(134).getWay()); RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation, ds); - assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371, 1)); + assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358)); + assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371)); Way commonWay = allWays.stream() .filter(way -> way.getId() == 75113358) @@ -85,59 +86,59 @@ public void isItineraryInSameDirectionTest() { .filter(way -> way.getId() == 809485597) .findFirst().orElse(null); - WaySequence leuvenToHaasrode = new WaySequence<>(toLeuven,commonWay,toHaasrode); - WaySequence leuvenToBlanden = new WaySequence<>(toLeuven,commonWay,toBlanden); - WaySequence neervelpToHaasrode = new WaySequence<>(toNeervelp,commonWay,toHaasrode); - WaySequence neervelpToBlanden = new WaySequence<>(toNeervelp,commonWay,toBlanden); - WaySequence haasrodeToLeuven = new WaySequence<>(toHaasrode,commonWay,toLeuven); - WaySequence blandenToLeuven = new WaySequence<>(toBlanden,commonWay,toLeuven); - WaySequence haasrodeToNeervelp = new WaySequence<>(toHaasrode,commonWay,toNeervelp); - WaySequence blandenToNeervelp = new WaySequence<>(toBlanden,commonWay,toNeervelp); - - assertTrue(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, leuvenToBlanden, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, leuvenToHaasrode, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, blandenToLeuven, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, haasrodeToLeuven, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(neervelpToBlanden, neervelpToHaasrode, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, neervelpToBlanden, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToNeervelp, blandenToLeuven, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, blandenToNeervelp, 1)); - - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode, 1)); - - WaySequence missingToBlanden = new WaySequence<>(null,commonWay,toBlanden); - WaySequence missingToHaasrode = new WaySequence<>(null,commonWay,toHaasrode); - WaySequence missingToLeuven = new WaySequence<>(null,commonWay,toLeuven); - WaySequence missingToNeervelp = new WaySequence<>(null,commonWay,toNeervelp); - WaySequence blandenToMissing = new WaySequence<>(toBlanden,commonWay,null); - WaySequence haasrodeToMissing = new WaySequence<>(toHaasrode,commonWay,null); - WaySequence leuvenToMissing = new WaySequence<>(toNeervelp,commonWay,null); - WaySequence neervelpToMissing = new WaySequence<>(toNeervelp,commonWay,null); - - assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, leuvenToBlanden, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, missingToBlanden, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(missingToLeuven, blandenToLeuven, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToLeuven, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, neervelpToHaasrode, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, missingToBlanden, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(missingToNeervelp, blandenToLeuven, 1)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToNeervelp, 1)); - - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp, 1)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode, 1)); + WaySequence leuvenToHaasrode = new WaySequence(toLeuven,commonWay,toHaasrode); + WaySequence leuvenToBlanden = new WaySequence(toLeuven,commonWay,toBlanden); + WaySequence neervelpToHaasrode = new WaySequence(toNeervelp,commonWay,toHaasrode); + WaySequence neervelpToBlanden = new WaySequence(toNeervelp,commonWay,toBlanden); + WaySequence haasrodeToLeuven = new WaySequence(toHaasrode,commonWay,toLeuven); + WaySequence blandenToLeuven = new WaySequence(toBlanden,commonWay,toLeuven); + WaySequence haasrodeToNeervelp = new WaySequence(toHaasrode,commonWay,toNeervelp); + WaySequence blandenToNeervelp = new WaySequence(toBlanden,commonWay,toNeervelp); + + assertTrue(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, leuvenToBlanden)); + assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, leuvenToHaasrode)); + assertTrue(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, blandenToLeuven)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, haasrodeToLeuven)); + assertTrue(segment601_1.isItineraryInSameDirection(neervelpToBlanden, neervelpToHaasrode)); + assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, neervelpToBlanden)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToNeervelp, blandenToLeuven)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, blandenToNeervelp)); + + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden)); + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode)); + + WaySequence missingToBlanden = new WaySequence(null,commonWay,toBlanden); + WaySequence missingToHaasrode = new WaySequence(null,commonWay,toHaasrode); + WaySequence missingToLeuven = new WaySequence(null,commonWay,toLeuven); + WaySequence missingToNeervelp = new WaySequence(null,commonWay,toNeervelp); + WaySequence blandenToMissing = new WaySequence(toBlanden,commonWay,null); + WaySequence haasrodeToMissing = new WaySequence(toHaasrode,commonWay,null); + WaySequence leuvenToMissing = new WaySequence(toNeervelp,commonWay,null); + WaySequence neervelpToMissing = new WaySequence(toNeervelp,commonWay,null); + + assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, leuvenToBlanden)); + assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, missingToBlanden)); + assertTrue(segment601_1.isItineraryInSameDirection(missingToLeuven, blandenToLeuven)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToLeuven)); + assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, neervelpToHaasrode)); + assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, missingToBlanden)); + assertTrue(segment601_1.isItineraryInSameDirection(missingToNeervelp, blandenToLeuven)); + assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToNeervelp)); + + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden)); + assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp)); + assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden)); + assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp)); + assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode)); } @@ -186,7 +187,7 @@ public void bus601_600Test() { final int W_156_TiensevestToPerron1_79596986_A = 79596986; RouteSegmentToExtract returnValueNull =null; - for (int n = 158; n >= 157; n--) {returnValueNull =segment1.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 158; n >= 157; n--) {returnValueNull =segment1.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment2 = segment1.addPTWayMember(156); final Way veryLastWay = segment1.getWayMembers().get(1).getWay(); @@ -275,7 +276,7 @@ public void bus601_600Test() { // W_142_Lüdenscheidsingel_3_3993388_B = 3993388; final int W_141_Lüdenscheidsingel_2_109267417_A = 109267417; - for (int n = 149; n >= 147; n--) {returnValueNull =segment8.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 149; n >= 147; n--) {returnValueNull =segment8.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment9 = segment8.addPTWayMember(146); Relation rel9 = extractAndAssertValues(146, segment8, segment9, cloneOfBus601RouteRelation, W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, @@ -298,7 +299,7 @@ public void bus601_600Test() { // W_137_Den_Boschsingel_1_146171871_B = 146171871; final int W_136_Den_Boschsingel_2_23837544_A = 23837544; - for (int n = 144; n >= 141; n--) {returnValueNull =segment10.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 144; n >= 141; n--) {returnValueNull =segment10.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment11 = segment10.addPTWayMember(140); extractAndAssertValues(140, segment10, segment11, cloneOfBus601RouteRelation, W_141_Lüdenscheidsingel_2_109267417_A, W_145_Artoisplein_1_23691158_E, @@ -313,7 +314,7 @@ public void bus601_600Test() { // W_132_Rennes_Singel_2_3994257_B = 3994257; final int W_131_Rennes_Singel_1_249333185_A = 249333185; - for (int n = 139; n >= 136; n--) {returnValueNull =segment11.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 139; n >= 136; n--) {returnValueNull =segment11.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment12 = segment11.addPTWayMember(135); extractAndAssertValues(135, segment11, segment12, cloneOfBus601RouteRelation, W_136_Den_Boschsingel_2_23837544_A, W_140_Lüdenscheidsingel_1_3993387_E, @@ -325,7 +326,7 @@ public void bus601_600Test() { // W_100_129_Herestraat_2_813970231_BB = 813970231; final int W_128_Herestraat_11_681081951_A = 681081951; - for (int n = 134; n >= 131; n--) {returnValueNull =segment12.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 134; n >= 131; n--) {returnValueNull =segment12.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment13 = segment12.addPTWayMember(130); extractAndAssertValues(130, segment12, segment13, cloneOfBus601RouteRelation, W_131_Rennes_Singel_1_249333185_A, W_135_Den_Boschsingel_3_225605630_E, @@ -338,7 +339,7 @@ public void bus601_600Test() { // W_126_Herestraat_9_41403544_B = 41403544; final int W_125_Herestraat_8_8079995_A = 8079995; - for (int n = 129; n >= 128; n--) {returnValueNull =segment13.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 129; n >= 128; n--) {returnValueNull =segment13.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment14 = segment13.addPTWayMember(127); extractAndAssertValues(127, segment13, segment14, cloneOfBus601RouteRelation, W_128_Herestraat_11_681081951_A, W_99_130_Herestraat_1_249333184_AC, @@ -350,7 +351,7 @@ public void bus601_600Test() { final int W_124_Rotonde_Het_Teken_41403538_B = 41403538; final int W_123_Ring_Zuid_79340950_A = 79340950; - for (int n = 126; n >= 125; n--) {returnValueNull =segment14.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 126; n >= 125; n--) {returnValueNull =segment14.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment15 = segment14.addPTWayMember(124); extractAndAssertValues(124, segment14, segment15, cloneOfBus601RouteRelation, W_125_Herestraat_8_8079995_A, W_127_Herestraat_10_813970227_C, @@ -448,7 +449,7 @@ public void bus601_600Test() { final int W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A = 78873921; - for (int n = 112; n >= 110; n--) {returnValueNull =segment23.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 112; n >= 110; n--) {returnValueNull =segment23.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment24 = segment23.addPTWayMember(109); extractAndAssertValues(109, segment23, segment24, cloneOfBus601RouteRelation, @@ -504,7 +505,7 @@ public void bus601_600Test() { final int W_101_Herestraat_3_813970229_C = 813970229; // 99 and 100 are defined as 129 and 130 - for (int n = 104; n >= 102; n--) {returnValueNull =segment28.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 104; n >= 102; n--) {returnValueNull =segment28.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment29 = segment28.addPTWayMember(101); extractAndAssertValues(101, segment28, segment29, cloneOfBus601RouteRelation, W_102_Herestraat_4_813970228_A, W_105_Herestraat_7_13067134_D, @@ -522,7 +523,7 @@ public void bus601_600Test() { // W_92_Rennes_Singel_8131120_B = 8131120; final int W_91_Rennes_Singel_429706864_A = 429706864; - for (int n = 100; n >= 99; n--) {returnValueNull =segment29.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 100; n >= 99; n--) {returnValueNull =segment29.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment30 = segment29.addPTWayMember(98); extractAndAssertValues(98, segment29, segment30, cloneOfBus601RouteRelation, W_99_130_Herestraat_1_249333184_AC, W_101_Herestraat_3_813970229_C, @@ -543,7 +544,7 @@ public void bus601_600Test() { // W_81_Tervuursevest_429706866_B = 429706866; final int W_80_Tervuursevest_88361317_A = 88361317; - for (int n = 97; n >= 91; n--) {returnValueNull =segment30.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 97; n >= 91; n--) {returnValueNull =segment30.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment31 = segment30.addPTWayMember(90); extractAndAssertValues(90, segment30, segment31, cloneOfBus601RouteRelation, W_91_Rennes_Singel_429706864_A, W_98_Rennes_Singel_249333186_H, @@ -554,7 +555,7 @@ public void bus601_600Test() { final int W_79_Tervuursevest_Kapucijnenvoer_461159345_A = 461159345; - for (int n = 89; n >= 80; n--) {returnValueNull =segment31.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 89; n >= 80; n--) {returnValueNull =segment31.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment32 = segment31.addPTWayMember(79); extractAndAssertValues(79, segment31, segment32, cloneOfBus601RouteRelation, W_80_Tervuursevest_88361317_A, W_90_Tervuursevest_99583853_K, @@ -600,7 +601,7 @@ public void bus601_600Test() { // W_54_Geldenaaksevest_586268893_B = 586268893; final int W_53_Geldenaaksevest_8130906_A = 8130906; - for (int n = 77; n >= 68; n--) {returnValueNull =segment33.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 77; n >= 68; n--) {returnValueNull =segment33.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment34 = segment33.addPTWayMember(67); extractAndAssertValues(67, segment33, segment34, cloneOfBus601RouteRelation, W_68_Tervuursevest_3677330_A, W_78_Tervuursevest_461159362_K, @@ -614,7 +615,7 @@ public void bus601_600Test() { // W_50_Tiensevest_12712557_B = 12712557; final int W_49_Tiensevest_Oostertunnel_8590231_A = 8590231; - for (int n = 66; n >= 61; n--) {returnValueNull =segment34.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 66; n >= 61; n--) {returnValueNull =segment34.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment35 = segment34.addPTWayMember(60); extractAndAssertValues(60, segment34, segment35, cloneOfBus601RouteRelation, W_61_Geldenaaksevest_24905257_A, W_67_Naamsevest_86164005_G, @@ -623,7 +624,7 @@ public void bus601_600Test() { "18;178;179;306 (student);337;601;616" ); - for (int n = 60; n >= 53; n--) {returnValueNull =segment35.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 60; n >= 53; n--) {returnValueNull =segment35.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment36 = segment35.addPTWayMember(52); extractAndAssertValues(52, segment35, segment36, cloneOfBus601RouteRelation, W_53_Geldenaaksevest_8130906_A, W_60_Geldenaaksevest_608715605_H, @@ -634,7 +635,7 @@ public void bus601_600Test() { final int W_48_Tiensevest_185988814_A = 185988814; - for (int n = 51; n >= 49; n--) {returnValueNull =segment36.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 51; n >= 49; n--) {returnValueNull =segment36.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment37 = segment36.addPTWayMember(48); extractAndAssertValues(48, segment36, segment37, cloneOfBus601RouteRelation, W_49_Tiensevest_Oostertunnel_8590231_A, W_52_Tiensepoort_16775171_D, @@ -658,7 +659,7 @@ public void bus601_600Test() { final int W_43__79264899_A = 79264899; - for (int n = 46; n >= 44; n--) {returnValueNull =segment38.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 46; n >= 44; n--) {returnValueNull =segment38.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment39 = segment38.addPTWayMember(43); extractAndAssertValues(43, segment38, segment39, cloneOfBus601RouteRelation, W_44__78815533_A, W_47_Martelarenplein_76856823_D, @@ -778,7 +779,7 @@ public void bus601_600Test() { ); assertEquals(rel8.getId(), rel50.getId()); - for (int n = 31; n >= 29; n--) {returnValueNull =segment50.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 31; n >= 29; n--) {returnValueNull =segment50.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment51 = segment50.addPTWayMember(28); Relation rel51 = extractAndAssertValues(28, segment50, segment51, cloneOfBus601RouteRelation, W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, @@ -805,7 +806,7 @@ public void bus601_600Test() { "334;335;513;601;630" ); - for (int n = 25; n >= 14; n--) {returnValueNull =segment53.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 25; n >= 14; n--) {returnValueNull =segment53.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment54 = segment53.addPTWayMember(13); extractAndAssertValues(13, segment53, segment54, cloneOfBus601RouteRelation, W_14_Engels_Plein_338057820_A, W_26_Havenkant_510790349_M, @@ -855,7 +856,7 @@ public void bus601_600Test() { final int W_154_Havenkant_304241968_B = 304241968; final int W_153_Aarschotsesteenweg_304241967_A = 304241967; - for (int n = 169; n >= 155; n--) {returnValueNull =segment101.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 169; n >= 155; n--) {returnValueNull =segment101.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment102 = segment101.addPTWayMember(154); extractAndAssertValues(154, segment101, segment102, cloneOfBus600RouteRelation, W_155_Havenkant_29283599_A, W_169_Engels_Plein_608715622_O, @@ -916,7 +917,7 @@ public void bus601_600Test() { // W_142_Diestsepoort_584356749_B = 584356749; final int W_141_Diestsepoort_584356745_A = 584356745; - for (int n = 146; n >= 145; n--) {returnValueNull =segment106.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 146; n >= 145; n--) {returnValueNull =segment106.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment107 = segment106.addPTWayMember(144); extractAndAssertValues(144, segment106, segment107, cloneOfBus600RouteRelation, W_145_Diestsepoort_8109264_A, W_147_Vuurkruisenlaan_23691160_C, @@ -931,7 +932,7 @@ public void bus601_600Test() { // W_137_Diestsepoort_584356742_B = 584356742; final int W_136_Diestsepoort_451873774_A = 451873774; - for (int n = 143; n >= 141; n--) {returnValueNull =segment107.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 143; n >= 141; n--) {returnValueNull =segment107.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment108 = segment107.addPTWayMember(140); extractAndAssertValues(140, segment107, segment108, cloneOfBus600RouteRelation, W_141_Diestsepoort_584356745_A, W_144_Diestsepoort_61556877_D, @@ -944,7 +945,7 @@ public void bus601_600Test() { // W_134__79264890_B = 79264890; final int W_133__79596965_A = 79596965; - for (int n = 139; n >= 136; n--) {returnValueNull =segment108.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 139; n >= 136; n--) {returnValueNull =segment108.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment109 = segment108.addPTWayMember(135); extractAndAssertValues(135, segment108, segment109, cloneOfBus600RouteRelation, W_136_Diestsepoort_451873774_A, W_140_Diestsepoort_198559166_E, @@ -957,7 +958,7 @@ public void bus601_600Test() { final int W_131__79596982_A = 79596982; final int W_130__79596987_A = 79596987; - for (int n = 134; n >= 133; n--) {returnValueNull =segment109.addPTWayMember(n); assertNull(returnValueNull);} + for (int n = 134; n >= 133; n--) {returnValueNull =segment109.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment110 = segment109.addPTWayMember(132); extractAndAssertValues(132, segment109, segment110, cloneOfBus600RouteRelation, W_133__79596965_A, W_135__76867049_C, @@ -977,7 +978,6 @@ public void bus601_600Test() { null, "3;333;334;335;433;600;630" ); - } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, @@ -986,16 +986,17 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS String expectedColours, String expectedRouteRef) { Relation extractedRelation = createdSegment.extractToRelation(Arrays.asList("type", "route"), true); System.out.println(index + " " + extractedRelation.get("note")); - assertEquals("first way not correct", firstWayId, extractedRelation.firstMember().getWay().getId()); - assertEquals("last way not correct", lastWayId, extractedRelation.lastMember().getWay().getId()); + assertEquals(String.format("%d first way not correct %s%s\n", index, rc, firstWayId), firstWayId, extractedRelation.firstMember().getWay().getId()); + assertEquals(String.format("%d last way not correct %s%s\n", index, rc, lastWayId), lastWayId, extractedRelation.lastMember().getWay().getId()); if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); assertEquals(expectedRouteRef, createdSegment.getLineIdentifiersSignature()); - assertEquals("relation id not correct", extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); + assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); // newSegment should have the last way we tried to add to this segment if (firstWayIdForNewSegment != 0) { - assertEquals("name of last added way not correct", nameOfNewWay, newSegment.getWayMembers().get(0).getWay().get("name")); - assertEquals("id of first way not correct", firstWayIdForNewSegment, newSegment.getWayMembers().get(0).getWay().getId()); + final long wayId = newSegment.getWayMembers().get(0).getWay().getId(); + assertEquals(String.format("%d name of last added way not correct %s%s\n ", index, rc, wayId), nameOfNewWay, newSegment.getWayMembers().get(0).getWay().get("name")); + assertEquals(String.format("%d id of first way not correct %s%s\n", index, rc, wayId), firstWayIdForNewSegment, wayId); } return extractedRelation; } From 4bd2b7135d3dc85fcbfd7a0f224e858db11f38e5 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Thu, 8 Oct 2020 15:01:48 +0200 Subject: [PATCH 33/52] In some cases the membershipcount is needed of all the (parent) route relations, in others, it's only the routes that go in the same sense that count. All tests for 2 lines that make a circle around the city, but which at the railway station and the bus station near the hospital reuse ways in the same or the opposite sense, pass now. Now I'm going to do some interactive testing on other bus lines. I also found a bus line that wasn't mapped correctly, so the test osm file is also updated --- .../data/RouteSegmentToExtract.java | 60 +- .../data/RouteSegmentToExtractTest.java | 586 +++++++++++++++++- 2 files changed, 637 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 9658ce4e..03a7297f 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -218,10 +218,11 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation parentRoute : itinerariesInSameDirection) { if (waysInCurrentRoute.currentWay == getLastWay(parentRoute) - || getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1 - && !parentRoute.equals(relation)) { + || getMembershipCountOfWayInSameDirection(waysInCurrentRoute.currentWay, parentRoute) > 1 + && !parentRoute.equals(relation)) + { startNewSegment = true; - if (getMembershipCount(waysInCurrentRoute.currentWay, parentRoute) > 1) { + if (getMembershipCountOfWayInSameDirection(waysInCurrentRoute.currentWay, parentRoute) > 1) { startNewSegmentInNewSegment = true; } } @@ -318,10 +319,57 @@ public ArrayList getItineraryWays(Relation ptRoute) { } } + /** + * @param way + * @param routeRelation + * @return number of times this way appears in the route relation, regardless of the sense it's traversed + */ public long getMembershipCount(Way way, Relation routeRelation) { - return routeRelation.getMembers().stream() - .filter(member -> member.getMember().equals(way)) - .count(); + return this.getItineraryWays(routeRelation).stream() + .filter(w -> w.equals(way)).count(); + } + /** + * @param way + * @param routeRelation + * @return number of times this way appears in the route relation, being traversed in the same sense + */ + public long getMembershipCountOfWayInSameDirection(Way way, Relation routeRelation) { + List indices = new ArrayList<>(); + List members = routeRelation.getMembers(); + for (int i = 0; i < members.size(); i++) { + RelationMember member = members.get(i); + if (member.getMember().equals(way)) { + indices.add(i); + } + } + int counter = indices.size(); + assert !(counter > 2); // if this happens the method will have to be rewritten to accomodate 3 or more occurrences + // of the same with in a single route relation + if (counter == 2) { + Way previousWay1 = null; + Way previousWay2 = null; + Way nextWay1 = null; + Way nextWay2 = null; + if (routeRelation.getMember(indices.get(0) - 1).isWay()) + previousWay1 = routeRelation.getMember(indices.get(0) - 1).getWay(); + if (routeRelation.getMember(indices.get(1) - 1).isWay()) + previousWay2 = routeRelation.getMember(indices.get(1) - 1).getWay(); + if (routeRelation.getMember(indices.get(0) + 1).isWay()) + nextWay1 = routeRelation.getMember(indices.get(0) + 1).getWay(); + if (routeRelation.getMember(indices.get(1) + 1).isWay()) + nextWay2 = routeRelation.getMember(indices.get(1) + 1).getWay(); + if (!isItineraryInSameDirection(new WaySequence( + previousWay1, + way, + nextWay1), + new WaySequence( + previousWay2, + way, + nextWay2))) { + counter--; + } + } + return counter; } public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 1750dbf3..44ff8be0 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -956,7 +956,6 @@ public void bus601_600Test() { final int W_132__79596974_B = 79596974; final int W_131__79596982_A = 79596982; - final int W_130__79596987_A = 79596987; for (int n = 134; n >= 133; n--) {returnValueNull =segment109.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment110 = segment109.addPTWayMember(132); @@ -967,17 +966,598 @@ public void bus601_600Test() { "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630" ); - final int W_129__377918658_A = 377918658; + final int W_130__79596987_C = 79596987; + // W_129__377918658_B = 377918658; final int W_128__79596980_A = 79596980; returnValueNull =segment110.addPTWayMember(131); assertNull(returnValueNull); RouteSegmentToExtract segment111 = segment110.addPTWayMember(130); extractAndAssertValues(130, segment110, segment111, cloneOfBus600RouteRelation, W_131__79596982_A, W_132__79596974_B, - W_130__79596987_A, null, + W_130__79596987_C, null, null, "3;333;334;335;433;600;630" ); + final int W_127_Tiensevest_79193579_A = 79193579; + + for (int n = 129; n >= 128; n--) {returnValueNull =segment111.addPTWayMember(n); assertNull(returnValueNull);} + RouteSegmentToExtract segment112 = segment111.addPTWayMember(127); + extractAndAssertValues(127, segment111, segment112, cloneOfBus600RouteRelation, + W_128__79596980_A, W_130__79596987_C, + W_127_Tiensevest_79193579_A, "Tiensevest", + null, + "3;333;334;335;513;600;630" + ); + + final int W_126_Tiensevest_258936980_A = 258936980; + + RouteSegmentToExtract segment113 = segment112.addPTWayMember(126); + extractAndAssertValues(126, segment112, segment113, cloneOfBus600RouteRelation, + W_127_Tiensevest_79193579_A, W_127_Tiensevest_79193579_A, + W_126_Tiensevest_258936980_A, "Tiensevest", + null, + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658" + ); + + final int W_125_Tiensevest_79193580_A = 79193580; + + RouteSegmentToExtract segment114 = segment113.addPTWayMember(125); + extractAndAssertValues(125, segment113, segment114, cloneOfBus600RouteRelation, + W_126_Tiensevest_258936980_A, W_126_Tiensevest_258936980_A, + W_125_Tiensevest_79193580_A, "Tiensevest", + null, + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658" + ); + + final int W_124_Tiensevest_79193581_A = 79193581; + + RouteSegmentToExtract segment115 = segment114.addPTWayMember(124); + extractAndAssertValues(124, segment114, segment115, cloneOfBus600RouteRelation, + W_125_Tiensevest_79193580_A, W_125_Tiensevest_79193580_A, + W_124_Tiensevest_79193581_A, "Tiensevest", + null, + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" + ); + + final int W_123_Tiensevest_78815505_A = 78815505; + + RouteSegmentToExtract segment116 = segment115.addPTWayMember(123); + extractAndAssertValues(123, segment115, segment116, cloneOfBus600RouteRelation, + W_124_Tiensevest_79193581_A, W_124_Tiensevest_79193581_A, + W_123_Tiensevest_78815505_A, "Tiensevest", + null, + "2;3;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" + ); + + final int W_122_Tiensevest_84696751_A = 84696751; + final int W_121_Tiensevest_79265237_A = 79265237; + + RouteSegmentToExtract segment117 = segment116.addPTWayMember(122); + extractAndAssertValues(122, segment116, segment117, cloneOfBus600RouteRelation, + W_123_Tiensevest_78815505_A, W_123_Tiensevest_78815505_A, + W_122_Tiensevest_84696751_A, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" + ); + + final int W_120_Tiensevest_89574079_B = 89574079; + final int W_119_Tiensevest_81522744_A = 81522744; + final int W_118_Tiensevest_19793223_B = 19793223; + final int W_117_Tiensevest_185988814_A = 185988814; + + RouteSegmentToExtract segment118 = segment117.addPTWayMember(121); + extractAndAssertValues(121, segment117, segment118, cloneOfBus600RouteRelation, + W_122_Tiensevest_84696751_A, W_122_Tiensevest_84696751_A, + W_121_Tiensevest_79265237_A, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630" + ); + + RouteSegmentToExtract segment119 = segment118.addPTWayMember(120); + extractAndAssertValues(120, segment118, segment119, cloneOfBus600RouteRelation, + W_121_Tiensevest_79265237_A, W_121_Tiensevest_79265237_A, + W_120_Tiensevest_89574079_B, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630" + ); + + final int W_116_Tiensevest_185988816_B = 185988816; + final int W_115_Tiensevest_15083398_A = 15083398; + + for (int n = 119; n >= 119; n--) {returnValueNull =segment119.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment119a = segment119.addPTWayMember(118); + extractAndAssertValues(118, segment119, segment119a, cloneOfBus600RouteRelation, + W_119_Tiensevest_81522744_A, W_120_Tiensevest_89574079_B, + W_118_Tiensevest_19793223_B, "Tiensevest", + null, + "1;2;3;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630" + ); + + for (int n = 117; n >= 117; n--) {returnValueNull =segment119a.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment119b = segment119a.addPTWayMember(116); + extractAndAssertValues(116, segment119a, segment119b, cloneOfBus600RouteRelation, + W_117_Tiensevest_185988814_A, W_118_Tiensevest_19793223_B, + W_116_Tiensevest_185988816_B, "Tiensevest", + null, + "1;7;8;9;18;179;306 (student);337;380;600;616;630" + ); + + final int W_114_Tiensevest_8154434_E = 8154434; + // W_113_Tiensevest_4003927_D = 4003927; + // W_112_Tiensevest_521193609_C = 521193609; + // W_111_Tiensevest_586268892_B = 586268892; + final int W_110_Tiensevest_521193611_A = 521193611; + + returnValueNull =segment119b.addPTWayMember(115); assertNull(returnValueNull); + RouteSegmentToExtract segment120 = segment119b.addPTWayMember(114); + extractAndAssertValues(114, segment119b, segment120, cloneOfBus600RouteRelation, + W_115_Tiensevest_15083398_A, W_116_Tiensevest_185988816_B, + W_114_Tiensevest_8154434_E, "Tiensevest", + null, + "7;8;9;18;179;306 (student);337;380;600;616;630" + ); + + final int W_109_Tiensepoort_4003928_G = 4003928; + // W_108_Geldenaaksevest_8130905_F = 8130905; + // W_107_Geldenaaksevest_24905256_E = 24905256; + // W_106_Geldenaaksevest_24905255_D = 24905255; + // W_105_Geldenaaksevest_491728135_C = 491728135; + // W_104_Geldenaaksevest_24905254_B = 24905254; + final int W_103_Geldenaaksevest_199381120_A = 199381120; + + for (int n = 113; n >= 110; n--) {returnValueNull =segment120.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment121 = segment120.addPTWayMember(109); + extractAndAssertValues(109, segment120, segment121, cloneOfBus600RouteRelation, + W_110_Tiensevest_521193611_A, W_114_Tiensevest_8154434_E, + W_109_Tiensepoort_4003928_G, "Tiensepoort", + null, + "7;8;9;18;178;179;306 (student);337;380;600;616;630" + ); + + final int W_102_Geldenaaksevest_3991775_E = 3991775; + // W_101_Erasme_Ruelensvest_120086001_D = 120086001; + // W_100_Erasme_Ruelensvest_608715575_C = 608715575; + final int W_99_Erasme_Ruelensvest_608715579_A = 608715579; + + for (int n = 108; n >= 103; n--) {returnValueNull =segment121.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment122 = segment121.addPTWayMember(102); + extractAndAssertValues(102, segment121, segment122, cloneOfBus600RouteRelation, + W_103_Geldenaaksevest_199381120_A, W_109_Tiensepoort_4003928_G, + W_102_Geldenaaksevest_3991775_E, "Geldenaaksevest", + null, + "18;178;179;306 (student);337;600;616;630" + ); + + final int W_98_Erasme_Ruelensvest_3677822_B = 3677822; + final int W_97_Tervuursevest_120086003_A = 120086003; + + for (int n = 100; n >= 99; n--) {returnValueNull =segment122.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment123 = segment122.addPTWayMember(98); + extractAndAssertValues(98, segment122, segment123, cloneOfBus600RouteRelation, + W_99_Erasme_Ruelensvest_608715579_A, W_102_Geldenaaksevest_3991775_E, + W_98_Erasme_Ruelensvest_3677822_B, "Erasme Ruelensvest", + null, + "18;178;179;306 (student);337;600;616" + ); + + final int W_96_Tervuursevest_90168774_F = 90168774; + // W_95_Tervuursevest_3677329_E = 3677329; + // W_94_Tervuursevest_608715614_D = 608715614; + // W_93_Tervuursevest_608715615_C = 608715615; + final int W_92_Tervuursevest_85044922_A = 85044922; + + final int W_91_Tervuursevest_16771611_A = 16771611; + + returnValueNull =segment123.addPTWayMember(97); assertNull(String.format("%d %s%s\n", 97, rc, cloneOfBus600RouteRelation.getMember(97).getMember().getId()), returnValueNull); + RouteSegmentToExtract segment125 = segment123.addPTWayMember(96); + extractAndAssertValues(96, segment123, segment125, cloneOfBus600RouteRelation, + W_97_Tervuursevest_120086003_A, W_98_Erasme_Ruelensvest_3677822_B, + W_96_Tervuursevest_90168774_F, "Tervuursevest", + null, + "178;179;306 (student);600" + ); + + for (int n = 95; n >= 92; n--) {returnValueNull =segment125.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment127 = segment125.addPTWayMember(91); + extractAndAssertValues(91, segment125, segment127, cloneOfBus600RouteRelation, + W_92_Tervuursevest_85044922_A, W_96_Tervuursevest_90168774_F, + W_91_Tervuursevest_16771611_A, "Tervuursevest", + null, + "178;179;306 (student);520;524;525;537;586;600" + ); + + final int W_90_Tervuursevest_13246158_A = 13246158; + + final int W_89_Tervuursevest_260405216_B = 260405216; + final int W_88_Tervuursevest_16771609_A = 16771609; + + RouteSegmentToExtract segment128 = segment127.addPTWayMember(90); + extractAndAssertValues(90, segment127, segment128, cloneOfBus600RouteRelation, + W_91_Tervuursevest_16771611_A, W_91_Tervuursevest_16771611_A, + W_90_Tervuursevest_13246158_A, "Tervuursevest", + null, + "178;520;524;525;537;586;600" + ); + + final int W_87_Tervuursevest_608715518_J = 608715518; + // W_86_Tervuursevest_608715519_I = 608715519; + // W_85_Tervuursevest_3677336_H = 3677336; + // W_84_Tervuursevest_15051052_G = 15051052; + // W_83_Tervuursevest_814322832_F = 814322832; + // W_82_Tervuursevest_80194318_E = 80194318; + // W_81_Tervuursevest_813979466_D = 813979466; + // W_80_Tervuursevest_521193382_C = 521193382; + // W_79_Tervuursevest_521193383_B = 521193383; + final int W_78_Tervuursevest_3677945_A = 3677945; + + RouteSegmentToExtract segment129 = segment128.addPTWayMember(89); + extractAndAssertValues(89, segment128, segment129, cloneOfBus600RouteRelation, + W_90_Tervuursevest_13246158_A, W_90_Tervuursevest_13246158_A, + W_89_Tervuursevest_260405216_B, "Tervuursevest", + null, + "7;8;9;178;520;524;525;527;537;586;600" + ); + + for (int n = 88; n >= 88; n--) {returnValueNull =segment129.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment130 = segment129.addPTWayMember(87); + extractAndAssertValues(87, segment129, segment130, cloneOfBus600RouteRelation, + W_88_Tervuursevest_16771609_A, W_89_Tervuursevest_260405216_B, + W_87_Tervuursevest_608715518_J, "Tervuursevest", + null, + "7;8;9;178;527;600" + ); + + final int W_77_Rennes_Singel_192559627_E = 192559627; + // W_76_Rennes_Singel_813979469_D = 813979469; + // W_75_Rennes_Singel_192559626_C = 192559626; + // W_74_Rennes_Singel_813979473_B = 813979473; + final int W_73_Rennes_Singel_28982660_A = 28982660; + + final int W_72_Herestraat_78568455_A = 78568455; + + for (int n = 86; n >= 78; n--) {returnValueNull =segment130.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment131 = segment130.addPTWayMember(77); + extractAndAssertValues(77, segment130, segment131, cloneOfBus600RouteRelation, + W_78_Tervuursevest_3677945_A, W_87_Tervuursevest_608715518_J, + W_77_Rennes_Singel_192559627_E, "Rennes-Singel", + null, + "178;600" + ); + + final int W_71_Herestraat_813970227_C = 813970227; + // W_70_Herestraat_41403544_B = 41403544; + final int W_69_Herestraat_8079995_A = 8079995; + + for (int n = 76; n >= 73; n--) {returnValueNull =segment131.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment132 = segment131.addPTWayMember(72); + extractAndAssertValues(72, segment131, segment132, cloneOfBus600RouteRelation, + W_73_Rennes_Singel_28982660_A, W_77_Rennes_Singel_192559627_E, + W_72_Herestraat_78568455_A, "Herestraat", + null, + "178;318;600" + ); + + final int W_68_Rotonde_Het_Teken_41403538_B = 41403538; + final int W_67_Ring_Zuid_79340950_A = 79340950; + + RouteSegmentToExtract segment133 = segment132.addPTWayMember(71); + extractAndAssertValues(71, segment132, segment133, cloneOfBus600RouteRelation, + W_72_Herestraat_78568455_A, W_72_Herestraat_78568455_A, + W_71_Herestraat_813970227_C, "Herestraat", + null, + "600" + ); + + for (int n = 70; n >= 69; n--) {returnValueNull =segment133.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment134 = segment133.addPTWayMember(68); + extractAndAssertValues(68, segment133, segment134, cloneOfBus600RouteRelation, + W_69_Herestraat_8079995_A, W_71_Herestraat_813970227_C, + W_68_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", + null, + "410;600;601" + ); + + final int W_66_Ring_Zuid_11369123_A = 11369123; + + for (int n = 67; n >= 67; n--) {returnValueNull =segment134.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment135 = segment134.addPTWayMember(66); + extractAndAssertValues(66, segment134, segment135, cloneOfBus600RouteRelation, + W_67_Ring_Zuid_79340950_A, W_68_Rotonde_Het_Teken_41403538_B, + W_66_Ring_Zuid_11369123_A, "Ring Zuid", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + final int W_65__159949154_A = 159949154; + + final int W_64__332258104_B = 332258104; + final int W_63__78852604_A = 78852604; + + RouteSegmentToExtract segment136 = segment135.addPTWayMember(65); + extractAndAssertValues(65, segment135, segment136, cloneOfBus600RouteRelation, + W_66_Ring_Zuid_11369123_A, W_66_Ring_Zuid_11369123_A, + W_65__159949154_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + RouteSegmentToExtract segment137 = segment136.addPTWayMember(64); + extractAndAssertValues(64, segment136, segment137, cloneOfBus600RouteRelation, + W_65__159949154_A, W_65__159949154_A, + W_64__332258104_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + final int W_62__14508735_A = 14508735; + + for (int n = 63; n >= 63; n--) {returnValueNull =segment137.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment138 = segment137.addPTWayMember(62); + extractAndAssertValues(62, segment137, segment138, cloneOfBus600RouteRelation, + W_63__78852604_A, W_64__332258104_B, + W_62__14508735_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + final int W_61__318878531_B = 318878531; + final int W_60__14506241_A = 14506241; + + RouteSegmentToExtract segment139 = segment138.addPTWayMember(61); + extractAndAssertValues(61, segment138, segment139, cloneOfBus600RouteRelation, + W_62__14508735_A, W_62__14508735_A, + W_61__318878531_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600" + ); + + final int W_59_Ring_Zuid_109267436_A = 109267436; + + for (int n = 60; n >= 60; n--) {returnValueNull =segment139.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment142 = segment139.addPTWayMember(59); + extractAndAssertValues(59, segment139, segment142, cloneOfBus600RouteRelation, + W_60__14506241_A, W_61__318878531_B, + W_59_Ring_Zuid_109267436_A, "Ring Zuid", + null, + "3;317;395;410;600" + ); + + final int W_58_Ring_Zuid_14508739_A = 14508739; + + RouteSegmentToExtract segment143 = segment142.addPTWayMember(58); + extractAndAssertValues(58, segment142, segment143, cloneOfBus600RouteRelation, + W_59_Ring_Zuid_109267436_A, W_59_Ring_Zuid_109267436_A, + W_58_Ring_Zuid_14508739_A, "Ring Zuid", + null, + "3;317;395;410;600;601" + ); + + final int W_57_Ring_Zuid_14508740_A = 14508740; + + RouteSegmentToExtract segment144 = segment143.addPTWayMember(57); + extractAndAssertValues(57, segment143, segment144, cloneOfBus600RouteRelation, + W_58_Ring_Zuid_14508739_A, W_58_Ring_Zuid_14508739_A, + W_57_Ring_Zuid_14508740_A, "Ring Zuid", + null, + "3;317;334;335;395;410;600;601" + ); + + final int W_56_Ring_Zuid_502328838_D = 502328838; + final int W_55_Ring_Zuid_502328837_C = 502328837; + final int W_54_Ring_Zuid_8080023_B = 8080023; + final int W_53_Rotonde_Het_Teken_78568660_A = 78568660; + + RouteSegmentToExtract segment145 = segment144.addPTWayMember(56); + extractAndAssertValues(56, segment144, segment145, cloneOfBus600RouteRelation, + W_57_Ring_Zuid_14508740_A, W_57_Ring_Zuid_14508740_A, + W_56_Ring_Zuid_502328838_D, "Ring Zuid", + null, + "3;317;334;335;380;395;410;600;601" + ); + + final int W_52_Rotonde_Het_Teken_78873921_A = 78873921; + + for (int n = 55; n >= 53; n--) {returnValueNull =segment145.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment146 = segment145.addPTWayMember(52); + extractAndAssertValues(52, segment145, segment146, cloneOfBus600RouteRelation, + W_53_Rotonde_Het_Teken_78568660_A, W_56_Ring_Zuid_502328838_D, + W_52_Rotonde_Het_Teken_78873921_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601" + ); + + final int W_51_Rotonde_Het_Teken_3752557_A = 3752557; + + RouteSegmentToExtract segment148 = segment146.addPTWayMember(51); + extractAndAssertValues(51, segment146, segment148, cloneOfBus600RouteRelation, + W_52_Rotonde_Het_Teken_78873921_A, W_52_Rotonde_Het_Teken_78873921_A, + W_51_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601" + ); + + final int W_50_Rotonde_Het_Teken_249333188_A = 249333188; + + RouteSegmentToExtract segment149 = segment148.addPTWayMember(50); + extractAndAssertValues(50, segment148, segment149, cloneOfBus600RouteRelation, + W_51_Rotonde_Het_Teken_3752557_A, W_51_Rotonde_Het_Teken_3752557_A, + W_50_Rotonde_Het_Teken_249333188_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601" + ); + + final int W_49_Rotonde_Het_Teken_249333187_A = 249333187; + + RouteSegmentToExtract segment150 = segment149.addPTWayMember(49); + extractAndAssertValues(49, segment149, segment150, cloneOfBus600RouteRelation, + W_50_Rotonde_Het_Teken_249333188_A, W_50_Rotonde_Het_Teken_249333188_A, + W_49_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", + null, + "3;410;600;601" + ); + + final int W_48_Herestraat_13067134_D = 13067134; + final int W_47_Herestraat_813970232_C = 813970232; + final int W_46_Herestraat_813970226_B = 813970226; + final int W_45_Herestraat_813970228_A = 813970228; + + RouteSegmentToExtract segment151 = segment150.addPTWayMember(48); + extractAndAssertValues(48, segment150, segment151, cloneOfBus600RouteRelation, + W_49_Rotonde_Het_Teken_249333187_A, W_49_Rotonde_Het_Teken_249333187_A, + W_48_Herestraat_13067134_D, "Herestraat", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" + ); + + final int W_44_Herestraat_270181177_A = 270181177; + + for (int n = 47; n >= 45; n--) {returnValueNull =segment151.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment152 = segment151.addPTWayMember(44); + extractAndAssertValues(44, segment151, segment152, cloneOfBus600RouteRelation, + W_45_Herestraat_813970228_A, W_48_Herestraat_13067134_D, + W_44_Herestraat_270181177_A, "Herestraat", + null, + "410;600;601" + ); + + final int W_43_Rennes_Singel_78568454_B = 78568454; + final int W_42_Rennes_Singel_225605633_A = 225605633; + + RouteSegmentToExtract segment153 = segment152.addPTWayMember(43); + extractAndAssertValues(43, segment152, segment153, cloneOfBus600RouteRelation, + W_44_Herestraat_270181177_A, W_44_Herestraat_270181177_A, + W_43_Rennes_Singel_78568454_B, "Rennes-Singel", + null, + "410;600" + ); + + final int W_41_Rennes_Singel_8131123_D = 8131123; + final int W_40_Rennes_Singel_3680457_C = 3680457; + final int W_39_Den_Boschsingel_192559625_B = 192559625; + final int W_38_Den_Boschsingel_23837543_A = 23837543; + + for (int n = 42; n >= 42; n--) {returnValueNull =segment153.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment154 = segment153.addPTWayMember(41); + extractAndAssertValues(41, segment153, segment154, cloneOfBus600RouteRelation, + W_42_Rennes_Singel_225605633_A, W_43_Rennes_Singel_78568454_B, + W_41_Rennes_Singel_8131123_D, "Rennes-Singel", + null, + "178;318;410;600" + ); + + final int W_37_Den_Boschsingel_146171867_D = 146171867; + final int W_36_Den_Boschsingel_125835586_C = 125835586; + final int W_35__3877104_B = 3877104; + final int W_34_Lüdenscheidsingel_85048201_A = 85048201; + + for (int n = 40; n >= 38; n--) {returnValueNull =segment154.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment155 = segment154.addPTWayMember(37); + extractAndAssertValues(37, segment154, segment155, cloneOfBus600RouteRelation, + W_38_Den_Boschsingel_23837543_A, W_41_Rennes_Singel_8131123_D, + W_37_Den_Boschsingel_146171867_D, "Den Boschsingel", + null, + "318;410;600" + ); + + final int W_33_Lüdenscheidsingel_12891213_D = 12891213; + final int W_32_Lüdenscheidsingel_44932919_C = 44932919; + final int W_31_Lüdenscheidsingel_8131040_B = 8131040; + final int W_30_Joanna_Maria_Artoisplein_61540098_A = 61540098; + + for (int n = 36; n >= 34; n--) {returnValueNull =segment155.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment156 = segment155.addPTWayMember(33); + extractAndAssertValues(33, segment155, segment156, cloneOfBus600RouteRelation, + W_34_Lüdenscheidsingel_85048201_A, W_37_Den_Boschsingel_146171867_D, + W_33_Lüdenscheidsingel_12891213_D, "Lüdenscheidsingel", + null, + "318;410;600;651;658" + ); + + final int W_29_Joanna_Maria_Artoisplein_254801390_B = 254801390; + final int W_28_Joanna_Maria_Artoisplein_61540068_A = 61540068; + + for (int n = 32; n >= 30; n--) {returnValueNull =segment156.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment157 = segment156.addPTWayMember(29); + extractAndAssertValues(29, segment156, segment157, cloneOfBus600RouteRelation, + W_30_Joanna_Maria_Artoisplein_61540098_A, W_33_Lüdenscheidsingel_12891213_D, + W_29_Joanna_Maria_Artoisplein_254801390_B, "Joanna-Maria Artoisplein", + null, + "178;318;410;600;651;652;658" + ); + + final int W_27_Vuurkruisenlaan_23691160_C = 23691160; + final int W_26_Vuurkruisenlaan_4061640_B = 4061640; + final int W_25_Diestsepoort_8109264_A = 8109264; + + for (int n = 28; n >= 28; n--) {returnValueNull =segment157.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment158 = segment157.addPTWayMember(27); + extractAndAssertValues(27, segment157, segment158, cloneOfBus600RouteRelation, + W_28_Joanna_Maria_Artoisplein_61540068_A, W_29_Joanna_Maria_Artoisplein_254801390_B, + W_27_Vuurkruisenlaan_23691160_C, "Vuurkruisenlaan", + null, + "178;318;333;334;335;410;513;600;630;651;652;658" + ); + + final int W_24_Diestsepoort_61556877_D = 61556877; + final int W_23_Diestsepoort_663770966_C = 663770966; + final int W_22_Diestsepoort_584356749_B = 584356749; + final int W_21_Diestsepoort_584356745_A = 584356745; + + for (int n = 26; n >= 25; n--) {returnValueNull =segment158.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment159 = segment158.addPTWayMember(24); + extractAndAssertValues(24, segment158, segment159, cloneOfBus600RouteRelation, + W_25_Diestsepoort_8109264_A, W_27_Vuurkruisenlaan_23691160_C, + W_24_Diestsepoort_61556877_D, "Diestsepoort", + null, + "333;334;335;513;600;630;651;652;658" + ); + + final int W_20_Diestsepoort_198559166_E = 198559166; + final int W_19_Diestsepoort_584356751_D = 584356751; + final int W_18_Diestsepoort_451873773_C = 451873773; + final int W_17_Diestsepoort_584356742_B = 584356742; + final int W_16_Diestsepoort_451873774_A = 451873774; + + for (int n = 23; n >= 21; n--) {returnValueNull =segment159.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment160 = segment159.addPTWayMember(20); + extractAndAssertValues(20, segment159, segment160, cloneOfBus600RouteRelation, + W_21_Diestsepoort_584356745_A, W_24_Diestsepoort_61556877_D, + W_20_Diestsepoort_198559166_E, "Diestsepoort", + null, + "2;3;179;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658" + ); + + final int W_15_Diestsepoort_116797180_B = 116797180; + final int W_14_Diestsepoort_23691157_A = 23691157; + + for (int n = 19; n >= 16; n--) {returnValueNull =segment160.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment161 = segment160.addPTWayMember(15); + extractAndAssertValues(15, segment160, segment161, cloneOfBus600RouteRelation, + W_16_Diestsepoort_451873774_A, W_20_Diestsepoort_198559166_E, + W_15_Diestsepoort_116797180_B, "Diestsepoort", + null, + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658" + ); + + final int W_13_p12_to_Diestsepoort_78815527_B = 78815527; + final int W_12_perron_12_377918658_A = 377918658; + + for (int n = 15; n >= 14; n--) {returnValueNull =segment161.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + RouteSegmentToExtract segment162 = segment161.addPTWayMember(13); + extractAndAssertValues(13, segment161, segment162, cloneOfBus600RouteRelation, + W_14_Diestsepoort_23691157_A, W_15_Diestsepoort_116797180_B, + W_13_p12_to_Diestsepoort_78815527_B, null, + null, + "4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658" + ); + + RouteSegmentToExtract segment163 = segment162.addPTWayMember(12); + extractAndAssertValues(12, segment162, segment163, cloneOfBus600RouteRelation, + W_12_perron_12_377918658_A, W_13_p12_to_Diestsepoort_78815527_B, + 0, null, + null, + "395;600;651;652" + ); } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, From 4bcfa3fbd701e3f527fafad7e26469fd1c87d998 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sat, 10 Oct 2020 22:14:55 +0200 Subject: [PATCH 34/52] Added another line, which has variants with an extra spoon, which needs special treatment. When I had fixed that, it gave problems at roundabouts and where the bus forked on oneway stretches, but that is solved as well now. Cleaned up the test code, so IntelliJ has a minimal amount of warnings on it. Also found some errors in the OSM file. --- .../data/RouteSegmentToExtract.java | 124 ++++---- .../data/RouteSegmentToExtractTest.java | 264 ++++++++---------- 2 files changed, 173 insertions(+), 215 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 03a7297f..9392de85 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -202,7 +202,6 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } else { List parentRouteRelations = Utils.filteredCollection(waysInCurrentRoute.currentWay.getReferrers(), Relation.class).stream() -// .filter(r -> r.getId() != relation.getId()) .filter(RouteUtils::isVersionTwoPTRoute) .collect(Collectors.toList()); TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); @@ -217,14 +216,31 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } else { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation parentRoute : itinerariesInSameDirection) { + final long membershipCountOfWayInSameDirectionInParentRoute = + getMembershipCountOfWayInSameDirection(waysInCurrentRoute.currentWay, parentRoute); if (waysInCurrentRoute.currentWay == getLastWay(parentRoute) - || getMembershipCountOfWayInSameDirection(waysInCurrentRoute.currentWay, parentRoute) > 1 - && !parentRoute.equals(relation)) - { + || membershipCountOfWayInSameDirectionInParentRoute > 1 + && !parentRoute.equals(relation)) { startNewSegment = true; - if (getMembershipCountOfWayInSameDirection(waysInCurrentRoute.currentWay, parentRoute) > 1) { + if (membershipCountOfWayInSameDirectionInParentRoute > 1) { startNewSegmentInNewSegment = true; } + break; + } + // Sometimes a PT line has variants that make a 'spoon like loop' + // In this case the ref will usually be the same, if not membership in a route_master will need to be checked + // The common node between the way that goes into the new sub route relation (currentWay) + // and the first one of the route relation currently processed (nextWay) will always have more than 2 parent ways + + if (!startNewSegment && !relation.equals(parentRoute) + && Objects.equals(relation.get("ref"), parentRoute.get("ref"))) { + final Node commonNode = WayUtils.findFirstCommonNode(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay).orElseGet(null); + if (commonNode.getParentWays().stream() + .filter(w -> (getItineraryWays(parentRoute).contains(w))) + .count() > 2) { + startNewSegment = true; + break; + } } } } @@ -237,16 +253,31 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { return newSegment; } else { - if (this.itinerariesInSameDirection == null) { - this.itinerariesInSameDirection = itinerariesInSameDirection; - populateLineIdentifierAndColourLists(); - } addWay(index); } } return null; } + public ArrayList getItineraryWays(Relation ptRoute) { + if (itineraryWays.containsKey(ptRoute)) { + return (ArrayList) itineraryWays.get(ptRoute); + } else { + ArrayList itinerary = new ArrayList<>(); + ptRoute.getMembers().stream().filter(RouteUtils::isPTWay) + .forEachOrdered(rm -> { + if (rm.isWay()) { + itinerary.add(rm.getWay()); + } else if (rm.isRelation()) { + itinerary.addAll(getItineraryWays(rm.getRelation())); + } + } + ); + itineraryWays.put(ptRoute, itinerary); + return itinerary; + } + } + public Way getFirstWay(Relation ptRoute) { return getItineraryWays(ptRoute).get(0); } @@ -300,28 +331,9 @@ public TreeSet getItinerariesInSameDirection( } } - public ArrayList getItineraryWays(Relation ptRoute) { - if (itineraryWays.containsKey(ptRoute)) { - return (ArrayList) itineraryWays.get(ptRoute); - } else { - ArrayList itinerary = new ArrayList<>(); - ptRoute.getMembers().stream().filter(RouteUtils::isPTWay) - .forEachOrdered(rm -> { - if (rm.isWay()) { - itinerary.add(rm.getWay()); - } else if (rm.isRelation()) { - getItineraryWays(rm.getRelation()).forEach(itinerary::add); - } - } - ); - itineraryWays.put(ptRoute, itinerary); - return itinerary; - } - } - /** - * @param way - * @param routeRelation + * @param way way to locate + * @param routeRelation route relation to locate way in * @return number of times this way appears in the route relation, regardless of the sense it's traversed */ public long getMembershipCount(Way way, Relation routeRelation) { @@ -329,47 +341,33 @@ public long getMembershipCount(Way way, Relation routeRelation) { .filter(w -> w.equals(way)).count(); } /** - * @param way - * @param routeRelation + * @param way way to locate + * @param routeRelation route relation to locate way in * @return number of times this way appears in the route relation, being traversed in the same sense */ public long getMembershipCountOfWayInSameDirection(Way way, Relation routeRelation) { + List indices = getIndicesFor(way, routeRelation); + + int counter = indices.size(); + for (int i = 0; i < indices.size() - 1 ; i++) { + if (!isItineraryInSameDirection(new WaySequence(routeRelation, indices.get(i)), + new WaySequence(routeRelation, indices.get(i+1)))) { + counter--; + } + } + return counter; + } + + public List getIndicesFor(OsmPrimitive primitive, Relation routeRelation) { List indices = new ArrayList<>(); List members = routeRelation.getMembers(); for (int i = 0; i < members.size(); i++) { RelationMember member = members.get(i); - if (member.getMember().equals(way)) { + if (member.getMember().equals(primitive)) { indices.add(i); } } - int counter = indices.size(); - assert !(counter > 2); // if this happens the method will have to be rewritten to accomodate 3 or more occurrences - // of the same with in a single route relation - if (counter == 2) { - Way previousWay1 = null; - Way previousWay2 = null; - Way nextWay1 = null; - Way nextWay2 = null; - if (routeRelation.getMember(indices.get(0) - 1).isWay()) - previousWay1 = routeRelation.getMember(indices.get(0) - 1).getWay(); - if (routeRelation.getMember(indices.get(1) - 1).isWay()) - previousWay2 = routeRelation.getMember(indices.get(1) - 1).getWay(); - if (routeRelation.getMember(indices.get(0) + 1).isWay()) - nextWay1 = routeRelation.getMember(indices.get(0) + 1).getWay(); - if (routeRelation.getMember(indices.get(1) + 1).isWay()) - nextWay2 = routeRelation.getMember(indices.get(1) + 1).getWay(); - if (!isItineraryInSameDirection(new WaySequence( - previousWay1, - way, - nextWay1), - new WaySequence( - previousWay2, - way, - nextWay2))) { - counter--; - } - } - return counter; + return indices; } public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, @@ -384,7 +382,6 @@ public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, && waysInParentRoute.nextWay != null && (waysInCurrentRoute.previousWay == waysInParentRoute.previousWay || waysInCurrentRoute.nextWay == waysInParentRoute.nextWay) -// && currentWayOccurrencesInParentRoute < 2 ) { return (!waysInCurrentRoute.previousWay.equals(waysInParentRoute.nextWay) && !waysInCurrentRoute.nextWay. equals(waysInParentRoute.previousWay)); @@ -432,9 +429,6 @@ private static List findPreviousAndNextWayInRoute(List highway for (int j = highwayMembers.size() - 1; j>=0 ; j--) { wayAtIndexPosition = highwayMembers.get(j); if (foundWay) { - if (wayAtIndexPosition == wayToLocate) { - wayAtIndexPosition = null; - } waySequences.add(0, new WaySequence( wayAtIndexPosition, wayToLocate, nextWay, wayAfterNextWay)); wayAfterNextWay = null; diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 44ff8be0..62951827 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -37,10 +37,6 @@ public void isItineraryInSameDirectionTest() { .filter(relation -> relation.getId() == 3612781) .findFirst().orElse(null); - Relation bus370NightRouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 5240367) - .findFirst().orElse(null); - Relation bus358RouteRelation = allRelations.stream() .filter(relation -> relation.getId() == 6695469) .findFirst().orElse(null); @@ -49,15 +45,19 @@ public void isItineraryInSameDirectionTest() { .filter(relation -> relation.getId() == 1606056) .findFirst().orElse(null); + assertNotNull(bus601RouteRelation); WaySequence waysInParentRouteOf601 = new WaySequence( bus601RouteRelation.getMembers().get(156).getWay(), bus601RouteRelation.getMembers().get(157).getWay(), bus601RouteRelation.getMembers().get(158).getWay()); + assertNotNull(bus358RouteRelation); WaySequence waysInParentRouteOf358 = new WaySequence( bus358RouteRelation.getMembers().get(114).getWay(), bus358RouteRelation.getMembers().get(115).getWay(), bus358RouteRelation.getMembers().get(116).getWay()); + + assertNotNull(bus371RouteRelation); WaySequence waysInParentRouteOf371 = new WaySequence( bus371RouteRelation.getMembers().get(132).getWay(), bus371RouteRelation.getMembers().get(133).getWay(), @@ -143,7 +143,7 @@ public void isItineraryInSameDirectionTest() { @Test - public void bus601_600Test() { + public void bus601_600_3_Test() { Relation bus601RouteRelation = allRelations.stream() .filter(relation -> relation.getId() == 3612781) .findFirst().orElse(null); @@ -186,7 +186,7 @@ public void bus601_600Test() { final int W_156_TiensevestToPerron1_79596986_A = 79596986; - RouteSegmentToExtract returnValueNull =null; + RouteSegmentToExtract returnValueNull; for (int n = 158; n >= 157; n--) {returnValueNull =segment1.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment2 = segment1.addPTWayMember(156); @@ -256,8 +256,6 @@ public void bus601_600Test() { ); final int W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D = 6184898; - // W_31_149_Diestsevest_3_81457878_C - // W_30_148_Diestsevest_2_4003924_B final int W_29_147_Diestsevest_1_8133608_A = 8133608; RouteSegmentToExtract segment8 = segment7.addPTWayMember(150); @@ -271,9 +269,6 @@ public void bus601_600Test() { final int W_28_146_Artoisplein_2_254800931_A = 254800931; final int W_145_Artoisplein_1_23691158_E = 23691158; - // W_144_Lüdenscheidsingel_5_254800932_D = 254800932; - // W_143_Lüdenscheidsingel_4_44932921_C = 44932921; - // W_142_Lüdenscheidsingel_3_3993388_B = 3993388; final int W_141_Lüdenscheidsingel_2_109267417_A = 109267417; for (int n = 149; n >= 147; n--) {returnValueNull =segment8.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -294,9 +289,6 @@ public void bus601_600Test() { ); final int W_140_Lüdenscheidsingel_1_3993387_E = 3993387; - // W_139_R23_2_8131125_D = 8131125; - // W_138_R23_1_3877105_C = 3877105; - // W_137_Den_Boschsingel_1_146171871_B = 146171871; final int W_136_Den_Boschsingel_2_23837544_A = 23837544; for (int n = 144; n >= 141; n--) {returnValueNull =segment10.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -309,9 +301,6 @@ public void bus601_600Test() { ); final int W_135_Den_Boschsingel_3_225605630_E = 225605630; - // W_134_Den_Boschsingel_4_8131121_D = 8131121; - // W_133_Rennes_Singel_3_3680456_C = 3680456; - // W_132_Rennes_Singel_2_3994257_B = 3994257; final int W_131_Rennes_Singel_1_249333185_A = 249333185; for (int n = 139; n >= 136; n--) {returnValueNull =segment11.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -336,7 +325,6 @@ public void bus601_600Test() { ); final int W_127_Herestraat_10_813970227_C = 813970227; - // W_126_Herestraat_9_41403544_B = 41403544; final int W_125_Herestraat_8_8079995_A = 8079995; for (int n = 129; n >= 128; n--) {returnValueNull =segment13.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -373,6 +361,7 @@ public void bus601_600Test() { final int W_121__159949154_A = 159949154; final int W_120__332258104_B = 332258104; + final int W_119_GHB_ingang_78852604_A = 78852604; RouteSegmentToExtract segment17 = segment16.addPTWayMember(121); @@ -427,8 +416,6 @@ public void bus601_600Test() { ); final int W_113_Ring_Zuid_p1_502328838_D = 502328838; - // W_112_Ring_Zuid_502328837_C = 502328837; - // W_111_Ring_Zuid_8080023_B = 8080023; final int W_110_Rotonde_Het_Teken_78568660_A = 78568660; RouteSegmentToExtract segment22 = segment21.addPTWayMember(114); @@ -450,7 +437,6 @@ public void bus601_600Test() { final int W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A = 78873921; for (int n = 112; n >= 110; n--) {returnValueNull =segment23.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment24 = segment23.addPTWayMember(109); extractAndAssertValues(109, segment23, segment24, cloneOfBus601RouteRelation, W_110_Rotonde_Het_Teken_78568660_A, W_113_Ring_Zuid_p1_502328838_D, @@ -490,8 +476,6 @@ public void bus601_600Test() { ); final int W_105_Herestraat_7_13067134_D = 13067134; - // W_104_Herestraat_6_813970232_C = 813970232; - // W_103_Herestraat_5_813970226_B = 813970226; final int W_102_Herestraat_4_813970228_A = 813970228; RouteSegmentToExtract segment28 = segment27.addPTWayMember(105); @@ -515,12 +499,6 @@ public void bus601_600Test() { ); final int W_98_Rennes_Singel_249333186_H = 249333186; - // W_97_Rennes_Singel_192559628_G = 192559628; - // W_96_Rennes_Singel_161166589_F = 161166589; - // W_95_Rennes_Singel_813979470_E = 813979470; - // W_94_Rennes_Singel_79289746_D = 79289746; - // W_93_Rennes_Singel_813979472_C = 813979472; - // W_92_Rennes_Singel_8131120_B = 8131120; final int W_91_Rennes_Singel_429706864_A = 429706864; for (int n = 100; n >= 99; n--) {returnValueNull =segment29.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -533,15 +511,6 @@ public void bus601_600Test() { ); final int W_90_Tervuursevest_99583853_K = 99583853; - // W_89_Tervuursevest_521193379_J = 521193379; - // W_88_Tervuursevest_521193380_I = 521193380; - // W_87_Tervuursevest_813979465_H = 813979465; - // W_86_Tervuursevest_174338458_G = 174338458; - // W_85_Tervuursevest_608715520_F = 608715520; - // W_84_Tervuursevest_608715521_E = 608715521; - // W_83_Tervuursevest_3677944_D = 3677944; - // W_82_Tervuursevest_174338459_C = 174338459; - // W_81_Tervuursevest_429706866_B = 429706866; final int W_80_Tervuursevest_88361317_A = 88361317; for (int n = 97; n >= 91; n--) {returnValueNull =segment30.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -565,15 +534,6 @@ public void bus601_600Test() { ); final int W_78_Tervuursevest_461159362_K = 461159362; - // W_77_Tervuursevest_344507822_J = 344507822; - // W_76_Tervuursevest_461159367_I = 461159367; - // W_75_Tervuursevest_3677335_H = 3677335; - // W_74_Tervuursevest_31474001_G = 31474001; - // W_73_Tervuursevest_23237288_F = 23237288; - // W_72_Tervuursevest_90168773_E = 90168773; - // W_71_Tervuursevest_23237287_D = 23237287; - // W_70_Tervuursevest_608715561_C = 608715561; - // W_69_Tervuursevest_608715562_B = 608715562; final int W_68_Tervuursevest_3677330_A = 3677330; RouteSegmentToExtract segment33 = segment32.addPTWayMember(78); @@ -585,20 +545,9 @@ public void bus601_600Test() { ); final int W_67_Naamsevest_86164005_G = 86164005; - // W_66_Naamsevest_655251293_F = 655251293; - // W_65_Naamsevest_131571763_E = 131571763; - // W_64_Naamsevest_661733369_D = 661733369; - // W_63_Naamsevest_655251292_C = 655251292; - // W_62_Naamsevest_3677823_B = 3677823; final int W_61_Geldenaaksevest_24905257_A = 24905257; final int W_60_Geldenaaksevest_608715605_H = 608715605; - // W_59_Geldenaaksevest_608715606_G = 608715606; - // W_58_Geldenaaksevest_79299303_F = 79299303; - // W_57_Geldenaaksevest_10296368_E = 10296368; - // W_56_Geldenaaksevest_521193607_D = 521193607; - // W_55_Geldenaaksevest_94585453_C = 94585453; - // W_54_Geldenaaksevest_586268893_B = 586268893; final int W_53_Geldenaaksevest_8130906_A = 8130906; for (int n = 77; n >= 68; n--) {returnValueNull =segment33.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -611,8 +560,6 @@ public void bus601_600Test() { ); final int W_52_Tiensepoort_16775171_D = 16775171; - // W_51_Tiensevest_8131717_C = 8131717; - // W_50_Tiensevest_12712557_B = 12712557; final int W_49_Tiensevest_Oostertunnel_8590231_A = 8590231; for (int n = 66; n >= 61; n--) {returnValueNull =segment34.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -645,8 +592,6 @@ public void bus601_600Test() { ); final int W_47_Martelarenplein_76856823_D = 76856823; - // W_46_Martelarenplein_459446598_C = 459446598; - // W_45_Martelarenplein_459446600_B = 459446600; final int W_44__78815533_A = 78815533; RouteSegmentToExtract segment38 = segment37.addPTWayMember(47); @@ -749,17 +694,6 @@ public void bus601_600Test() { ); final int W_26_Havenkant_510790349_M = 510790349; - // W_25_Havenkant_510790348_L = 510790348; - // W_24_Havenkant_314635787_K = 314635787; - // W_23_Havenkant_843534478_J = 843534478; - // W_22_Havenkant_406205781_I = 406205781; - // W_21_Havenkant_270181176_H = 270181176; - // W_20_Havenkant_330300725_G = 330300725; - // W_19_Burchtstraat_3869822_F = 3869822; - // W_18_Achter_de_latten_330300723_E = 330300723; - // W_17_Wolvengang_659297690_D = 659297690; - // W_16_Wolvengang_25928482_C = 25928482; - // W_15_Engels_Plein_3869812_B = 3869812; final int W_14_Engels_Plein_338057820_A = 338057820; RouteSegmentToExtract segment49 = segment48.addPTWayMember(33); @@ -838,19 +772,6 @@ public void bus601_600Test() { assertEquals(Collections.emptyList(), segment101.getWayMembers()); final int W_169_Engels_Plein_608715622_O = 608715622; - // W_168_Engels_Plein_338057819_N = 338057819; - // W_167_Engels_Plein_305316104_M = 305316104; - // W_166_Engels_Plein_3869812_L = 3869812; - // W_165_Wolvengang_25928482_K = 25928482; - // W_164_Wolvengang_659297690_J = 659297690; - // W_163_Achter_de_latten_330300723_I = 330300723; - // W_162_Burchtstraat_3869822_H = 3869822; - // W_161_Havenkant_330300725_G = 330300725; - // W_160_Havenkant_270181176_F = 270181176; - // W_159_Havenkant_406205781_E = 406205781; - // W_158_Havenkant_843534478_D = 843534478; - // W_157_Havenkant_314635787_C = 314635787; - // W_156_Havenkant_510790348_B = 510790348; final int W_155_Havenkant_29283599_A = 29283599; final int W_154_Havenkant_304241968_B = 304241968; @@ -900,7 +821,6 @@ public void bus601_600Test() { ); final int W_147_Vuurkruisenlaan_23691160_C = 23691160; - // W_146_Vuurkruisenlaan_4061640_B = 4061640; final int W_145_Diestsepoort_8109264_A = 8109264; returnValueNull =segment105.addPTWayMember(148); assertNull(returnValueNull); @@ -913,8 +833,6 @@ public void bus601_600Test() { ); final int W_144_Diestsepoort_61556877_D = 61556877; - // W_143_Diestsepoort_663770966_C = 663770966; - // W_142_Diestsepoort_584356749_B = 584356749; final int W_141_Diestsepoort_584356745_A = 584356745; for (int n = 146; n >= 145; n--) {returnValueNull =segment106.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -927,9 +845,6 @@ public void bus601_600Test() { ); final int W_140_Diestsepoort_198559166_E = 198559166; - // W_139_Diestsepoort_584356751_D = 584356751; - // W_138_Diestsepoort_451873773_C = 451873773; - // W_137_Diestsepoort_584356742_B = 584356742; final int W_136_Diestsepoort_451873774_A = 451873774; for (int n = 143; n >= 141; n--) {returnValueNull =segment107.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -967,7 +882,6 @@ public void bus601_600Test() { ); final int W_130__79596987_C = 79596987; - // W_129__377918658_B = 377918658; final int W_128__79596980_A = 79596980; returnValueNull =segment110.addPTWayMember(131); assertNull(returnValueNull); @@ -1083,9 +997,6 @@ public void bus601_600Test() { ); final int W_114_Tiensevest_8154434_E = 8154434; - // W_113_Tiensevest_4003927_D = 4003927; - // W_112_Tiensevest_521193609_C = 521193609; - // W_111_Tiensevest_586268892_B = 586268892; final int W_110_Tiensevest_521193611_A = 521193611; returnValueNull =segment119b.addPTWayMember(115); assertNull(returnValueNull); @@ -1098,11 +1009,6 @@ public void bus601_600Test() { ); final int W_109_Tiensepoort_4003928_G = 4003928; - // W_108_Geldenaaksevest_8130905_F = 8130905; - // W_107_Geldenaaksevest_24905256_E = 24905256; - // W_106_Geldenaaksevest_24905255_D = 24905255; - // W_105_Geldenaaksevest_491728135_C = 491728135; - // W_104_Geldenaaksevest_24905254_B = 24905254; final int W_103_Geldenaaksevest_199381120_A = 199381120; for (int n = 113; n >= 110; n--) {returnValueNull =segment120.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -1115,8 +1021,6 @@ public void bus601_600Test() { ); final int W_102_Geldenaaksevest_3991775_E = 3991775; - // W_101_Erasme_Ruelensvest_120086001_D = 120086001; - // W_100_Erasme_Ruelensvest_608715575_C = 608715575; final int W_99_Erasme_Ruelensvest_608715579_A = 608715579; for (int n = 108; n >= 103; n--) {returnValueNull =segment121.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -1141,9 +1045,6 @@ public void bus601_600Test() { ); final int W_96_Tervuursevest_90168774_F = 90168774; - // W_95_Tervuursevest_3677329_E = 3677329; - // W_94_Tervuursevest_608715614_D = 608715614; - // W_93_Tervuursevest_608715615_C = 608715615; final int W_92_Tervuursevest_85044922_A = 85044922; final int W_91_Tervuursevest_16771611_A = 16771611; @@ -1180,14 +1081,6 @@ public void bus601_600Test() { ); final int W_87_Tervuursevest_608715518_J = 608715518; - // W_86_Tervuursevest_608715519_I = 608715519; - // W_85_Tervuursevest_3677336_H = 3677336; - // W_84_Tervuursevest_15051052_G = 15051052; - // W_83_Tervuursevest_814322832_F = 814322832; - // W_82_Tervuursevest_80194318_E = 80194318; - // W_81_Tervuursevest_813979466_D = 813979466; - // W_80_Tervuursevest_521193382_C = 521193382; - // W_79_Tervuursevest_521193383_B = 521193383; final int W_78_Tervuursevest_3677945_A = 3677945; RouteSegmentToExtract segment129 = segment128.addPTWayMember(89); @@ -1208,9 +1101,6 @@ public void bus601_600Test() { ); final int W_77_Rennes_Singel_192559627_E = 192559627; - // W_76_Rennes_Singel_813979469_D = 813979469; - // W_75_Rennes_Singel_192559626_C = 192559626; - // W_74_Rennes_Singel_813979473_B = 813979473; final int W_73_Rennes_Singel_28982660_A = 28982660; final int W_72_Herestraat_78568455_A = 78568455; @@ -1225,7 +1115,6 @@ public void bus601_600Test() { ); final int W_71_Herestraat_813970227_C = 813970227; - // W_70_Herestraat_41403544_B = 41403544; final int W_69_Herestraat_8079995_A = 8079995; for (int n = 76; n >= 73; n--) {returnValueNull =segment131.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -1259,7 +1148,7 @@ public void bus601_600Test() { final int W_66_Ring_Zuid_11369123_A = 11369123; - for (int n = 67; n >= 67; n--) {returnValueNull =segment134.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 67; n >= 67; n--) {returnValueNull =segment134.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment135 = segment134.addPTWayMember(66); extractAndAssertValues(66, segment134, segment135, cloneOfBus600RouteRelation, W_67_Ring_Zuid_79340950_A, W_68_Rotonde_Het_Teken_41403538_B, @@ -1291,7 +1180,7 @@ public void bus601_600Test() { final int W_62__14508735_A = 14508735; - for (int n = 63; n >= 63; n--) {returnValueNull =segment137.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 63; n >= 63; n--) {returnValueNull =segment137.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment138 = segment137.addPTWayMember(62); extractAndAssertValues(62, segment137, segment138, cloneOfBus600RouteRelation, W_63__78852604_A, W_64__332258104_B, @@ -1313,7 +1202,7 @@ public void bus601_600Test() { final int W_59_Ring_Zuid_109267436_A = 109267436; - for (int n = 60; n >= 60; n--) {returnValueNull =segment139.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 60; n >= 60; n--) {returnValueNull =segment139.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment142 = segment139.addPTWayMember(59); extractAndAssertValues(59, segment139, segment142, cloneOfBus600RouteRelation, W_60__14506241_A, W_61__318878531_B, @@ -1343,8 +1232,6 @@ public void bus601_600Test() { ); final int W_56_Ring_Zuid_502328838_D = 502328838; - final int W_55_Ring_Zuid_502328837_C = 502328837; - final int W_54_Ring_Zuid_8080023_B = 8080023; final int W_53_Rotonde_Het_Teken_78568660_A = 78568660; RouteSegmentToExtract segment145 = segment144.addPTWayMember(56); @@ -1357,7 +1244,7 @@ public void bus601_600Test() { final int W_52_Rotonde_Het_Teken_78873921_A = 78873921; - for (int n = 55; n >= 53; n--) {returnValueNull =segment145.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 55; n >= 53; n--) {returnValueNull =segment145.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment146 = segment145.addPTWayMember(52); extractAndAssertValues(52, segment145, segment146, cloneOfBus600RouteRelation, W_53_Rotonde_Het_Teken_78568660_A, W_56_Ring_Zuid_502328838_D, @@ -1397,8 +1284,6 @@ public void bus601_600Test() { ); final int W_48_Herestraat_13067134_D = 13067134; - final int W_47_Herestraat_813970232_C = 813970232; - final int W_46_Herestraat_813970226_B = 813970226; final int W_45_Herestraat_813970228_A = 813970228; RouteSegmentToExtract segment151 = segment150.addPTWayMember(48); @@ -1411,7 +1296,7 @@ public void bus601_600Test() { final int W_44_Herestraat_270181177_A = 270181177; - for (int n = 47; n >= 45; n--) {returnValueNull =segment151.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 47; n >= 45; n--) {returnValueNull =segment151.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment152 = segment151.addPTWayMember(44); extractAndAssertValues(44, segment151, segment152, cloneOfBus600RouteRelation, W_45_Herestraat_813970228_A, W_48_Herestraat_13067134_D, @@ -1432,11 +1317,9 @@ public void bus601_600Test() { ); final int W_41_Rennes_Singel_8131123_D = 8131123; - final int W_40_Rennes_Singel_3680457_C = 3680457; - final int W_39_Den_Boschsingel_192559625_B = 192559625; final int W_38_Den_Boschsingel_23837543_A = 23837543; - for (int n = 42; n >= 42; n--) {returnValueNull =segment153.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 42; n >= 42; n--) {returnValueNull =segment153.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment154 = segment153.addPTWayMember(41); extractAndAssertValues(41, segment153, segment154, cloneOfBus600RouteRelation, W_42_Rennes_Singel_225605633_A, W_43_Rennes_Singel_78568454_B, @@ -1446,11 +1329,9 @@ public void bus601_600Test() { ); final int W_37_Den_Boschsingel_146171867_D = 146171867; - final int W_36_Den_Boschsingel_125835586_C = 125835586; - final int W_35__3877104_B = 3877104; final int W_34_Lüdenscheidsingel_85048201_A = 85048201; - for (int n = 40; n >= 38; n--) {returnValueNull =segment154.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 40; n >= 38; n--) {returnValueNull =segment154.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment155 = segment154.addPTWayMember(37); extractAndAssertValues(37, segment154, segment155, cloneOfBus600RouteRelation, W_38_Den_Boschsingel_23837543_A, W_41_Rennes_Singel_8131123_D, @@ -1460,11 +1341,9 @@ public void bus601_600Test() { ); final int W_33_Lüdenscheidsingel_12891213_D = 12891213; - final int W_32_Lüdenscheidsingel_44932919_C = 44932919; - final int W_31_Lüdenscheidsingel_8131040_B = 8131040; final int W_30_Joanna_Maria_Artoisplein_61540098_A = 61540098; - for (int n = 36; n >= 34; n--) {returnValueNull =segment155.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 36; n >= 34; n--) {returnValueNull =segment155.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment156 = segment155.addPTWayMember(33); extractAndAssertValues(33, segment155, segment156, cloneOfBus600RouteRelation, W_34_Lüdenscheidsingel_85048201_A, W_37_Den_Boschsingel_146171867_D, @@ -1476,7 +1355,7 @@ public void bus601_600Test() { final int W_29_Joanna_Maria_Artoisplein_254801390_B = 254801390; final int W_28_Joanna_Maria_Artoisplein_61540068_A = 61540068; - for (int n = 32; n >= 30; n--) {returnValueNull =segment156.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 32; n >= 30; n--) {returnValueNull =segment156.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment157 = segment156.addPTWayMember(29); extractAndAssertValues(29, segment156, segment157, cloneOfBus600RouteRelation, W_30_Joanna_Maria_Artoisplein_61540098_A, W_33_Lüdenscheidsingel_12891213_D, @@ -1486,10 +1365,9 @@ public void bus601_600Test() { ); final int W_27_Vuurkruisenlaan_23691160_C = 23691160; - final int W_26_Vuurkruisenlaan_4061640_B = 4061640; final int W_25_Diestsepoort_8109264_A = 8109264; - for (int n = 28; n >= 28; n--) {returnValueNull =segment157.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 28; n >= 28; n--) {returnValueNull =segment157.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment158 = segment157.addPTWayMember(27); extractAndAssertValues(27, segment157, segment158, cloneOfBus600RouteRelation, W_28_Joanna_Maria_Artoisplein_61540068_A, W_29_Joanna_Maria_Artoisplein_254801390_B, @@ -1499,11 +1377,9 @@ public void bus601_600Test() { ); final int W_24_Diestsepoort_61556877_D = 61556877; - final int W_23_Diestsepoort_663770966_C = 663770966; - final int W_22_Diestsepoort_584356749_B = 584356749; final int W_21_Diestsepoort_584356745_A = 584356745; - for (int n = 26; n >= 25; n--) {returnValueNull =segment158.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 26; n >= 25; n--) {returnValueNull =segment158.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment159 = segment158.addPTWayMember(24); extractAndAssertValues(24, segment158, segment159, cloneOfBus600RouteRelation, W_25_Diestsepoort_8109264_A, W_27_Vuurkruisenlaan_23691160_C, @@ -1513,12 +1389,9 @@ public void bus601_600Test() { ); final int W_20_Diestsepoort_198559166_E = 198559166; - final int W_19_Diestsepoort_584356751_D = 584356751; - final int W_18_Diestsepoort_451873773_C = 451873773; - final int W_17_Diestsepoort_584356742_B = 584356742; final int W_16_Diestsepoort_451873774_A = 451873774; - for (int n = 23; n >= 21; n--) {returnValueNull =segment159.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 23; n >= 21; n--) {returnValueNull =segment159.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment160 = segment159.addPTWayMember(20); extractAndAssertValues(20, segment159, segment160, cloneOfBus600RouteRelation, W_21_Diestsepoort_584356745_A, W_24_Diestsepoort_61556877_D, @@ -1530,7 +1403,7 @@ public void bus601_600Test() { final int W_15_Diestsepoort_116797180_B = 116797180; final int W_14_Diestsepoort_23691157_A = 23691157; - for (int n = 19; n >= 16; n--) {returnValueNull =segment160.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 19; n >= 16; n--) {returnValueNull =segment160.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment161 = segment160.addPTWayMember(15); extractAndAssertValues(15, segment160, segment161, cloneOfBus600RouteRelation, W_16_Diestsepoort_451873774_A, W_20_Diestsepoort_198559166_E, @@ -1542,7 +1415,7 @@ public void bus601_600Test() { final int W_13_p12_to_Diestsepoort_78815527_B = 78815527; final int W_12_perron_12_377918658_A = 377918658; - for (int n = 15; n >= 14; n--) {returnValueNull =segment161.addPTWayMember(n); assertNull(Integer.toString(n) + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} + for (int n = 15; n >= 14; n--) {returnValueNull =segment161.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} RouteSegmentToExtract segment162 = segment161.addPTWayMember(13); extractAndAssertValues(13, segment161, segment162, cloneOfBus600RouteRelation, W_14_Diestsepoort_23691157_A, W_15_Diestsepoort_116797180_B, @@ -1558,6 +1431,96 @@ public void bus601_600Test() { null, "395;600;651;652" ); + + // *********************************************************** + // Line 3 has the particularity that there are 2 variants + // The longer version has a spoon to serve another hospital + // *********************************************************** + + + Relation bus3_GHB_Lubbeek_RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 3297543) + .findFirst().orElse(null); + + assertNotNull(bus3_GHB_Lubbeek_RouteRelation); + RouteSegmentToExtract segment201 = new RouteSegmentToExtract(bus3_GHB_Lubbeek_RouteRelation, ds); + assertEquals(bus3_GHB_Lubbeek_RouteRelation.get("ref"), segment201.getLineIdentifiersSignature()); + assertEquals(bus3_GHB_Lubbeek_RouteRelation.get("colour"), segment201.getColoursSignature()); + + assertNull(segment201.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment201.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment201.getWayMembers()); + + final int W_194_Dorpskring_27684829_D = 27684829; + final int W_191_Dorpskring_112917099_A = 112917099; + + final int W_190_Dorpskring_125835538_A = 125835538; + + final int W_189_Bollenberg_81197019_Z = 81197019; + final int W_179_Kapelstraat_16377612_A = 16377612; + + final int W_178_Lostraat_40189518_Z = 40189518; + final int W_130_Oude_Diestsesteenweg_10230617_A = 10230617; + + final int W_129_Diestsesteenweg_23707243_A = 23707243; + + final int W_128_Diestsesteenweg_23707244_B = 23707244; + final int W_127_Diestsesteenweg_12715116_A = 12715116; + + final int W_126_Diestsepoort_61556877_D = 61556877; + + for (int n = 194; n >= 191; n--) {returnValueNull =segment201.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment202 = segment201.addPTWayMember(190); + extractAndAssertValues(190, segment201, segment202, bus3_GHB_Lubbeek_RouteRelation, + W_191_Dorpskring_112917099_A, W_194_Dorpskring_27684829_D, + W_190_Dorpskring_125835538_A, "Dorpskring", + null, + "3" + ); + + RouteSegmentToExtract segment203 = segment202.addPTWayMember(189); + extractAndAssertValues(189, segment202, segment203, bus3_GHB_Lubbeek_RouteRelation, + W_190_Dorpskring_125835538_A, W_190_Dorpskring_125835538_A, + W_189_Bollenberg_81197019_Z, "Bollenberg", + null, + "3;373;485" + ); + + for (int n = 188; n >= 179; n--) {returnValueNull =segment203.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment204 = segment203.addPTWayMember(178); + extractAndAssertValues(178, segment203, segment204, bus3_GHB_Lubbeek_RouteRelation, + W_179_Kapelstraat_16377612_A, W_189_Bollenberg_81197019_Z, + W_178_Lostraat_40189518_Z, "Lostraat", + null, + "3" + ); + + for (int n = 177; n >= 130; n--) {returnValueNull =segment204.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment205 = segment204.addPTWayMember(129); + extractAndAssertValues(129, segment204, segment205, bus3_GHB_Lubbeek_RouteRelation, + W_130_Oude_Diestsesteenweg_10230617_A, W_178_Lostraat_40189518_Z, + W_129_Diestsesteenweg_23707243_A, "Diestsesteenweg", + null, + "3" + ); + + RouteSegmentToExtract segment206 = segment205.addPTWayMember(128); + extractAndAssertValues(128, segment205, segment206, bus3_GHB_Lubbeek_RouteRelation, + W_129_Diestsesteenweg_23707243_A, W_129_Diestsesteenweg_23707243_A, + W_128_Diestsesteenweg_23707244_B, "Diestsesteenweg", + null, + "3;370;371;373;374;475;485;524;525" + ); + + for (int n = 127; n >= 127; n--) {returnValueNull =segment206.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment207 = segment206.addPTWayMember(126); + extractAndAssertValues(126, segment206, segment207, bus3_GHB_Lubbeek_RouteRelation, + W_127_Diestsesteenweg_12715116_A, W_128_Diestsesteenweg_23707244_B, + W_126_Diestsepoort_61556877_D, "Diestsepoort", + null, + "2;3;179;306 (student);310;370;371;373;374;433;475;485;520;524;525" + ); } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, @@ -1566,14 +1529,15 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS String expectedColours, String expectedRouteRef) { Relation extractedRelation = createdSegment.extractToRelation(Arrays.asList("type", "route"), true); System.out.println(index + " " + extractedRelation.get("note")); - assertEquals(String.format("%d first way not correct %s%s\n", index, rc, firstWayId), firstWayId, extractedRelation.firstMember().getWay().getId()); - assertEquals(String.format("%d last way not correct %s%s\n", index, rc, lastWayId), lastWayId, extractedRelation.lastMember().getWay().getId()); + assertEquals(String.format("%d first way not correct %s%s\n%s%s\n", index, rc, firstWayId, rc, extractedRelation.firstMember().getWay().getId()), firstWayId, extractedRelation.firstMember().getWay().getId()); + assertEquals(String.format("%d last way not correct %s%s\n%s%s\n", index, rc, lastWayId, rc, extractedRelation.lastMember().getWay().getId()), lastWayId, extractedRelation.lastMember().getWay().getId()); if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); assertEquals(expectedRouteRef, createdSegment.getLineIdentifiersSignature()); assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); // newSegment should have the last way we tried to add to this segment if (firstWayIdForNewSegment != 0) { + assertNotNull(String.format("No new segment was created for way\n%s%s at position %d", rc, firstWayIdForNewSegment, index), newSegment); final long wayId = newSegment.getWayMembers().get(0).getWay().getId(); assertEquals(String.format("%d name of last added way not correct %s%s\n ", index, rc, wayId), nameOfNewWay, newSegment.getWayMembers().get(0).getWay().get("name")); assertEquals(String.format("%d id of first way not correct %s%s\n", index, rc, wayId), firstWayIdForNewSegment, wayId); From af2ab8cd20158f592536f3b28651bfdd69c5ac39 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 11 Oct 2020 15:32:42 +0200 Subject: [PATCH 35/52] Added connectivity checks to WaySequence and wrote JavaDoc for its methods. If there is a gap, hasGap gets set. I started to check this in findPreviousAndNextWayInRoute and came to the conclusion that I had to change the OSM file and a few test results. I also renamed 2 variables to improve readability. --- .../data/RouteSegmentToExtract.java | 94 +++++++------- .../pt_assistant/data/WaySequence.java | 116 +++++++++++++++--- .../data/RouteSegmentToExtractTest.java | 11 +- 3 files changed, 153 insertions(+), 68 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 9392de85..b8920bb3 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -180,14 +180,13 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; - WaySequence waysInCurrentRoute = new WaySequence(relation, index); - if (waysInCurrentRoute.currentWay == null) { + WaySequence thisRoute = new WaySequence(relation, index); + if (thisRoute.currentWay == null || thisRoute.hasGap) { return null; } - WaySequence nextWaysInCurrentRoute = new WaySequence(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay, waysInCurrentRoute.wayAfterNextWay); - if (this.itinerariesInSameDirection == null && nextWaysInCurrentRoute.currentWay != null) { - TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute); + if (this.itinerariesInSameDirection == null) { + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(thisRoute); if (itinerariesInSameDirection != null) { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation relation : itinerariesInSameDirection) { @@ -201,24 +200,24 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { addWay(index, true); } else { List parentRouteRelations = - Utils.filteredCollection(waysInCurrentRoute.currentWay.getReferrers(), Relation.class).stream() + Utils.filteredCollection(thisRoute.currentWay.getReferrers(), Relation.class).stream() .filter(RouteUtils::isVersionTwoPTRoute) .collect(Collectors.toList()); - TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(waysInCurrentRoute, parentRouteRelations); + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(thisRoute, parentRouteRelations); boolean startNewSegmentInNewSegment = false; if (this.itinerariesInSameDirection != null && itinerariesInSameDirection.size() != 0 && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) - && !(getMembershipCount(waysInCurrentRoute.currentWay, relation) > 1 - && waysInCurrentRoute.currentWay.equals(getFirstWay(relation))) + && !(getMembershipCount(thisRoute.currentWay, relation) > 1 + && thisRoute.currentWay.equals(getFirstWay(relation))) ) { startNewSegment = true; } else { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation parentRoute : itinerariesInSameDirection) { final long membershipCountOfWayInSameDirectionInParentRoute = - getMembershipCountOfWayInSameDirection(waysInCurrentRoute.currentWay, parentRoute); - if (waysInCurrentRoute.currentWay == getLastWay(parentRoute) + getMembershipCountOfWayInSameDirection(thisRoute.currentWay, parentRoute); + if (thisRoute.currentWay == getLastWay(parentRoute) || membershipCountOfWayInSameDirectionInParentRoute > 1 && !parentRoute.equals(relation)) { startNewSegment = true; @@ -234,7 +233,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { if (!startNewSegment && !relation.equals(parentRoute) && Objects.equals(relation.get("ref"), parentRoute.get("ref"))) { - final Node commonNode = WayUtils.findFirstCommonNode(waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay).orElseGet(null); + final Node commonNode = WayUtils.findFirstCommonNode(thisRoute.currentWay, thisRoute.nextWay).orElseGet(null); if (commonNode.getParentWays().stream() .filter(w -> (getItineraryWays(parentRoute).contains(w))) .count() > 2) { @@ -291,19 +290,17 @@ public Way getLastWay(Relation ptRoute) { return highways.get(highways.size() - 1); } - public TreeSet getItinerariesInSameDirection( - WaySequence waysInCurrentRoute) { - final String wayInRelation = relation.getId() + "," + waysInCurrentRoute.currentWay.getId(); + public TreeSet getItinerariesInSameDirection(WaySequence thisRoute) { + final String wayInRelation = relation.getId() + "," + thisRoute.currentWay.getId(); if (parentRelationsForSameDirectionOfTravel.containsKey(wayInRelation)) { return parentRelationsForSameDirectionOfTravel.get(wayInRelation); } return null; } - public TreeSet getItinerariesInSameDirection( - WaySequence waysInCurrentRoute, - List parentRouteRelations) { - TreeSet r = getItinerariesInSameDirection(waysInCurrentRoute); + public TreeSet getItinerariesInSameDirection(WaySequence thisRoute, + List parentRouteRelations) { + TreeSet r = getItinerariesInSameDirection(thisRoute); if (r != null) { return r; } else { @@ -311,20 +308,20 @@ public TreeSet getItinerariesInSameDirection( for (Relation parentRoute : parentRouteRelations) { final List parentRouteHighways = getItineraryWays(parentRoute); if (!itinerariesInSameDirection.contains(parentRoute)) { - if (getFirstWay(parentRoute) == waysInCurrentRoute.currentWay - && waysInCurrentRoute.previousWay != null - && !waysInCurrentRoute.previousWay.getNodes().contains(getSecondWay(parentRoute).getNode(0))) { + if (getFirstWay(parentRoute) == thisRoute.currentWay + && thisRoute.previousWay != null + && !thisRoute.previousWay.getNodes().contains(getSecondWay(parentRoute).getNode(0))) { itinerariesInSameDirection.add(parentRoute); } - findPreviousAndNextWayInRoute(parentRouteHighways, waysInCurrentRoute.currentWay).stream() - .filter(waysInParentRoute -> isItineraryInSameDirection(waysInCurrentRoute, waysInParentRoute)) + findPreviousAndNextWayInRoute(parentRouteHighways, thisRoute.currentWay).stream() + .filter(waysInParentRoute -> isItineraryInSameDirection(thisRoute, waysInParentRoute)) .map(waysInParentRoute -> parentRoute) .forEachOrdered(itinerariesInSameDirection::add); } } - if (getMembershipCount(waysInCurrentRoute.currentWay, relation) < 2) { + if (getMembershipCount(thisRoute.currentWay, relation) < 2) { parentRelationsForSameDirectionOfTravel.put( - relation.getId() + "," + waysInCurrentRoute.currentWay.getId(), + relation.getId() + "," + thisRoute.currentWay.getId(), itinerariesInSameDirection); } return itinerariesInSameDirection; @@ -370,43 +367,43 @@ public List getIndicesFor(OsmPrimitive primitive, Relation routeRelatio return indices; } - public boolean isItineraryInSameDirection(WaySequence waysInCurrentRoute, - WaySequence waysInParentRoute) { - assert waysInCurrentRoute.currentWay == waysInParentRoute.currentWay : + public boolean isItineraryInSameDirection(WaySequence thisRoute, + WaySequence parentRoute) { + assert thisRoute.currentWay == parentRoute.currentWay : "this only works when comparing two equivalent way sequences" ; // if all ways are present, try the simple solution first - if (waysInCurrentRoute.previousWay != null - && waysInCurrentRoute.nextWay != null - && waysInParentRoute.previousWay != null - && waysInParentRoute.nextWay != null - && (waysInCurrentRoute.previousWay == waysInParentRoute.previousWay - || waysInCurrentRoute.nextWay == waysInParentRoute.nextWay) + if (thisRoute.previousWay != null + && thisRoute.nextWay != null + && parentRoute.previousWay != null + && parentRoute.nextWay != null + && (thisRoute.previousWay == parentRoute.previousWay + || thisRoute.nextWay == parentRoute.nextWay) ) { - return (!waysInCurrentRoute.previousWay.equals(waysInParentRoute.nextWay) && - !waysInCurrentRoute.nextWay. equals(waysInParentRoute.previousWay)); + return (!thisRoute.previousWay.equals(parentRoute.nextWay) && + !thisRoute.nextWay. equals(parentRoute.previousWay)); } // if not, compare on the nodes Node firstNodeCurrentWay = null; - if (waysInCurrentRoute.previousWay != null) { + if (thisRoute.previousWay != null) { firstNodeCurrentWay = WayUtils.findCommonFirstLastNode( - waysInCurrentRoute.previousWay, waysInCurrentRoute.currentWay).orElse(null); + thisRoute.previousWay, thisRoute.currentWay).orElse(null); } Node lastNodeCurrentWay = null; - if (waysInCurrentRoute.nextWay != null) { + if (thisRoute.nextWay != null) { lastNodeCurrentWay = WayUtils.findCommonFirstLastNode( - waysInCurrentRoute.currentWay, waysInCurrentRoute.nextWay).orElse(null); + thisRoute.currentWay, thisRoute.nextWay).orElse(null); } Node firstNodeWayOfParent = null; - if (waysInParentRoute.previousWay != null) { + if (parentRoute.previousWay != null) { firstNodeWayOfParent = WayUtils.findCommonFirstLastNode( - waysInParentRoute.previousWay, waysInParentRoute.currentWay).orElse(null); + parentRoute.previousWay, parentRoute.currentWay).orElse(null); } Node lastNodeWayOfParent = null; - if (waysInParentRoute.nextWay != null) { + if (parentRoute.nextWay != null) { lastNodeWayOfParent = WayUtils.findCommonFirstLastNode( - waysInParentRoute.currentWay, waysInParentRoute.nextWay).orElse(null); + parentRoute.currentWay, parentRoute.nextWay).orElse(null); } return (firstNodeCurrentWay != null && firstNodeCurrentWay.equals(firstNodeWayOfParent) @@ -429,8 +426,11 @@ private static List findPreviousAndNextWayInRoute(List highway for (int j = highwayMembers.size() - 1; j>=0 ; j--) { wayAtIndexPosition = highwayMembers.get(j); if (foundWay) { - waySequences.add(0, new WaySequence( - wayAtIndexPosition, wayToLocate, nextWay, wayAfterNextWay)); + final WaySequence waySequence = new WaySequence( + wayAtIndexPosition, wayToLocate, nextWay, wayAfterNextWay); + if (!waySequence.hasGap) { + waySequences.add(0, waySequence); + } wayAfterNextWay = null; nextWay = null; foundWay = false; diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java index d956ba85..efd46878 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -3,21 +3,30 @@ import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.data.osm.Way; +import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import java.util.List; import static org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils.isPTWay; +/** + * This class keeps track of up to 4 consecutive ways + * that are most likely members in a route relation + */ public final class WaySequence { + public boolean hasGap = false; public Way previousWay; public Way currentWay; public Way nextWay; public Way wayAfterNextWay; - public WaySequence() { - this(null, null, null, null); - } - + /** + * Constructor to fetch the ways from a route relation + * The caller needs to verify that hasGap remains false + * + * @param relation the route relation + * @param index the position of currentWay in the route relation + */ public WaySequence(Relation relation, int index) { final RelationMember currentMember = relation.getMember(index); if (isPTWay(currentMember)) { @@ -39,7 +48,7 @@ public WaySequence(Relation relation, int index) { currentWay = currentMember.getWay(); } } else { - // the member was probably a stop or platform + // the member was probably a stop or a platform currentWay = null; return; } @@ -52,49 +61,124 @@ public WaySequence(Relation relation, int index) { } } + /** + * Constructor if only 3 ways are needed/known + * @param previousWay the way before currentWay + * @param currentWay the current way + * @param nextWay the way after currentWay + */ public WaySequence(Way previousWay, Way currentWay, Way nextWay) { this(previousWay, currentWay, nextWay, null); } + /** + * Constructor if all 4 ways are known + * @param previousWay the way before currentWay + * @param currentWay the way this way sequence was created for + * @param nextWay the way after currentWay + * @param wayAfterNextWay the way after nextWay + */ public WaySequence(Way previousWay, Way currentWay, Way nextWay, Way wayAfterNextWay) { - this.previousWay = previousWay; this.currentWay = currentWay; - this.nextWay = nextWay; - this.wayAfterNextWay = wayAfterNextWay; + setPreviousWay(previousWay); + setNextWay(nextWay); + setAfterNextWay(wayAfterNextWay); + } + + /** + * @param way the way that comes before currentWay + * a check is performed to make sure they actually connect + */ + public void setPreviousWay(Way way) { + if (way == null || RouteUtils.waysTouch(way, currentWay)) { + previousWay = way; + } else { + previousWay = null; + hasGap = true; + } + } + + /** + * @param way the way that comes after currentWay + * a check is performed to make sure they actually connect + */ + public void setNextWay(Way way) { + if (way == null || RouteUtils.waysTouch(currentWay, way)) { + nextWay = way; + } else { + nextWay = null; + hasGap = true; + } } + /** + * @param way the way that comes after nextWay + * a check is performed to make sure they actually connect + */ + public void setAfterNextWay(Way way) { + if (way == null || RouteUtils.waysTouch(nextWay, way)) { + wayAfterNextWay = way; + } else { + wayAfterNextWay = null; + hasGap = true; + } + } + + /** + * @param previousMember the relation member that comes before currentWay in the route relation + * in case this member is also a relation, the last way in that relation + * is used + */ public void setPreviousPtWay(RelationMember previousMember) { if (isPTWay(previousMember)) { if (previousMember.isWay()) { - previousWay = previousMember.getWay(); + setPreviousWay(previousMember.getWay()); } else if (previousMember.isRelation()) { List subRelationMembers = previousMember.getRelation().getMembers(); - previousWay = subRelationMembers.get(subRelationMembers.size() - 1).getWay(); + setPreviousWay(subRelationMembers.get(subRelationMembers.size() - 1).getWay()); } } else { previousWay = null; } } + /** + * @param nextMember the relation member that comes after currentWay in the route relation + * in case this member is also a relation, the first way in that relation + * is used. + * If that relation has more than 1 member, afterNextWay is also set already + */ public void setNextPtWay(RelationMember nextMember) { if (isPTWay(nextMember)) { if (nextMember.isWay()) { - nextWay = nextMember.getWay(); - } else if (nextMember.isRelation()) { - nextWay = nextMember.getRelation().getMember(0).getWay(); + setNextWay(nextMember.getWay()); + } else if (nextMember.isRelation()) { + final Relation subRelation = nextMember.getRelation(); + setNextWay(subRelation.getMember(0).getWay()); + if (subRelation.getMembersCount() > 1) { + setAfterNextWay(subRelation.getMember(1).getWay()); + } } } else { nextWay = null; + hasGap = true; } } + /** + * @param afterNextMember the relation member that comes after nextWay in the route relation + * in case this member is also a relation, the last way in that relation + * is used. + * If wayAfterNextWay already contains a way, this is not performed anymore + * Also if there was no nextWay, hasGap will be true + */ public void setAfterNextPtWay(RelationMember afterNextMember) { - if (isPTWay(afterNextMember)) { + if (!hasGap && wayAfterNextWay == null && isPTWay(afterNextMember)) { if (afterNextMember.isWay()) { - wayAfterNextWay = afterNextMember.getWay(); + setAfterNextWay(afterNextMember.getWay()); } else if (afterNextMember.isRelation()) { - wayAfterNextWay = afterNextMember.getRelation().getMember(0).getWay(); + setAfterNextWay(afterNextMember.getRelation().getMember(0).getWay()); } } else { wayAfterNextWay = null; diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 62951827..99d05272 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -222,7 +222,7 @@ public void bus601_600_3_Test() { W_155_Tiensevest_5_79211473_A, W_155_Tiensevest_5_79211473_A, W_154_Tiensevest_4_79211472_A, "Tiensevest", null, - "1;2;3;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658" + "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658" ); final int W_153_Tiensevest_3_79175435_A = 79175435; @@ -599,7 +599,7 @@ public void bus601_600_3_Test() { W_48_Tiensevest_185988814_A, W_48_Tiensevest_185988814_A, W_47_Martelarenplein_76856823_D, "Martelarenplein", null, - "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630" + "1;7;8;9;18;178;179;306 (student);337;380;527;601;616;630" ); final int W_43__79264899_A = 79264899; @@ -940,7 +940,7 @@ public void bus601_600_3_Test() { W_124_Tiensevest_79193581_A, W_124_Tiensevest_79193581_A, W_123_Tiensevest_78815505_A, "Tiensevest", null, - "2;3;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" ); final int W_122_Tiensevest_84696751_A = 84696751; @@ -956,6 +956,7 @@ public void bus601_600_3_Test() { final int W_120_Tiensevest_89574079_B = 89574079; final int W_119_Tiensevest_81522744_A = 81522744; + final int W_118_Tiensevest_19793223_B = 19793223; final int W_117_Tiensevest_185988814_A = 185988814; @@ -984,7 +985,7 @@ public void bus601_600_3_Test() { W_119_Tiensevest_81522744_A, W_120_Tiensevest_89574079_B, W_118_Tiensevest_19793223_B, "Tiensevest", null, - "1;2;3;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630" + "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630" ); for (int n = 117; n >= 117; n--) {returnValueNull =segment119a.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -993,7 +994,7 @@ public void bus601_600_3_Test() { W_117_Tiensevest_185988814_A, W_118_Tiensevest_19793223_B, W_116_Tiensevest_185988816_B, "Tiensevest", null, - "1;7;8;9;18;179;306 (student);337;380;600;616;630" + "1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630" ); final int W_114_Tiensevest_8154434_E = 8154434; From 04acfb014221c95c6855206a2f076849d4be3d0d Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 16 Oct 2020 09:51:46 +0200 Subject: [PATCH 36/52] I have no idea how to resolve this exception. It always complains about Index xxx out of bounds for length yyy. Where xxx is the original length, and yyy the new size of the members list. java.lang.IndexOutOfBoundsException: Index 157 out of bounds for length 70 at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) at java.base/java.util.Objects.checkIndex(Objects.java:373) at java.base/java.util.ArrayList.get(ArrayList.java:426) at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180) at java.base/java.util.Spliterators$IntArraySpliterator.forEachRemaining(Spliterators.java:1032) at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:699) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getSelectedMembers(MemberTableModel.java:516) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.hasIncompleteSelectedMembers(MemberTableModel.java:416) at org.openstreetmap.josm.gui.dialogs.relation.actions.DownloadSelectedIncompleteMembersAction.updateEnabledState(DownloadSelectedIncompleteMembersAction.java:46) at org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction.tableChanged(AbstractRelationEditorAction.java:76) at java.desktop/javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:297) at java.desktop/javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:199) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.populate(MemberTableModel.java:227) at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:327) at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:320) at org.openstreetmap.josm.plugins.pt_assistant.actions.ExtractRelationMembersToNewRelationAction.actionPerformed(ExtractRelationMembersToNewRelationAction.java:159) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) --- ...actRelationMembersToNewRelationAction.java | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 6e8d6985..642fe7fe 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -43,11 +43,11 @@ public void actionPerformed(ActionEvent actionEvent) { final MemberTableModel memberTableModel = editorAccess.getMemberTableModel(); IRelationEditor editor = editorAccess.getEditor(); final Relation originalRelation = editor.getRelation(); - Relation editedRelation = new Relation(originalRelation); - // save the current state, otherwise accidents happen - memberTableModel.applyToRelation(editedRelation); - editorAccess.getTagModel().applyToPrimitive(editedRelation); - UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, editedRelation)); +// Relation editedRelation = new Relation(originalRelation); +// // save the current state, otherwise accidents happen +// memberTableModel.applyToRelation(editedRelation); +// editorAccess.getTagModel().applyToPrimitive(editedRelation); +// UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, editedRelation)); final Collection selectedMembers = memberTableModel.getSelectedMembers(); @@ -103,7 +103,7 @@ public void actionPerformed(ActionEvent actionEvent) { if (cbFindAllSegmentsAutomatically.isSelected()) { splitInSegments(originalRelation, cbConvertToSuperroute.isSelected()); } else { - final Relation clonedRelation = new Relation(originalRelation); + Relation clonedRelation = new Relation(originalRelation); RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation, Arrays.stream(memberTableModel.getSelectedIndices()).boxed().collect(Collectors.toList())); segment.put("name", tfNameTag.getText()); @@ -136,7 +136,23 @@ public void actionPerformed(ActionEvent actionEvent) { extraEditor.setAlwaysOnTop(true); } } - editor.reloadDataFromRelation(); + /* + Doing this suppresses the exception to be shown to the user, + something fishy is still happening though. + And the stack trace comes anyway when the user presses + the reload button in the relation editor. + This is annoying, I have no idea how to solve this. + The problem has been there since the beginning. + Oddly there are relations for which it doesn't happen. + It must have something to do with the fact that the member + count is always lower after converting ways to relations + that contain those ways. + */ + try { + editor.reloadDataFromRelation(); + } catch (Exception e) { + e.printStackTrace(); + } } } From d33a855c0da6438c4a76b4b1fb0c3ce09d6a2b7c Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 16 Oct 2020 13:18:23 +0200 Subject: [PATCH 37/52] as route relations get converted to superroute relations, sub route relations start to appear. It's important to also consider the parents of these sub route relations when compiling a list of parent route relations for the same direction of travel. --- .../data/RouteSegmentToExtract.java | 192 ++- .../data/RouteSegmentToExtractTest.java | 1283 +++++++++++++---- 2 files changed, 1139 insertions(+), 336 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index b8920bb3..d1dc6fb2 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -180,13 +180,13 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; - WaySequence thisRoute = new WaySequence(relation, index); - if (thisRoute.currentWay == null || thisRoute.hasGap) { + WaySequence ws = new WaySequence(relation, index); + if (ws.currentWay == null || ws.hasGap) { return null; } if (this.itinerariesInSameDirection == null) { - TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(thisRoute); + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(ws); if (itinerariesInSameDirection != null) { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation relation : itinerariesInSameDirection) { @@ -199,44 +199,70 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { if (wayMembers.size() == 0) { addWay(index, true); } else { + boolean startNewSegmentInNewSegment = false; + List segmentRelations = + Utils.filteredCollection(ws.currentWay.getReferrers(), Relation.class).stream() + .filter(r -> "route".equals(r.get("type")) && "bus".equals(r.get("route")) && r.hasKey("route_ref")) + .collect(Collectors.toList()); List parentRouteRelations = - Utils.filteredCollection(thisRoute.currentWay.getReferrers(), Relation.class).stream() + Utils.filteredCollection(ws.currentWay.getReferrers(), Relation.class).stream() .filter(RouteUtils::isVersionTwoPTRoute) .collect(Collectors.toList()); - TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(thisRoute, parentRouteRelations); - boolean startNewSegmentInNewSegment = false; + for (Relation sr : segmentRelations) { + RouteSegmentToExtract existingSegment = new RouteSegmentToExtract(sr, true); + if (existingSegment.getLastWay().equals(ws.currentWay)) { + final int existingSegmentSize = existingSegment.getWayMembers().size(); + if (existingSegmentSize < 2) break; + final int startIndexOfRange = index - existingSegmentSize + 1; + if (startIndexOfRange > 0) { + List sl = relation.getMembers().subList(startIndexOfRange, index + 1); + if (sl.equals(existingSegment.getWayMembers())) { + startNewSegment = true; + } + } + } + parentRouteRelations.addAll(sr.getReferrers().stream() + .filter(r -> Objects.equals(r.getType(), Relation.class) && "superroute".equals(r.get("type"))) + .map(r -> (Relation) r) + .collect(Collectors.toList())); + } + + TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(ws, parentRouteRelations); + if (this.itinerariesInSameDirection != null - && itinerariesInSameDirection.size() != 0 - && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) - && !(getMembershipCount(thisRoute.currentWay, relation) > 1 - && thisRoute.currentWay.equals(getFirstWay(relation))) + && itinerariesInSameDirection.size() != 0 + && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) + && !(getMembershipCount(ws.currentWay, relation) > 1 + && ws.currentWay.equals(getFirstWay(relation))) ) { startNewSegment = true; } else { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation parentRoute : itinerariesInSameDirection) { + final Node commonNode2 = WayUtils.findFirstCommonNode(ws.currentWay, ws.nextWay).orElseGet(null); final long membershipCountOfWayInSameDirectionInParentRoute = - getMembershipCountOfWayInSameDirection(thisRoute.currentWay, parentRoute); - if (thisRoute.currentWay == getLastWay(parentRoute) - || membershipCountOfWayInSameDirectionInParentRoute > 1 - && !parentRoute.equals(relation)) { + getMembershipCountOfWayInSameDirection(ws.currentWay, parentRoute); + if (ws.currentWay == getLastWay(parentRoute) + || membershipCountOfWayInSameDirectionInParentRoute > 1 + && !parentRoute.equals(relation) + && (commonNode2.getParentWays().size() > 2) + ) { startNewSegment = true; if (membershipCountOfWayInSameDirectionInParentRoute > 1) { startNewSegmentInNewSegment = true; } break; } - // Sometimes a PT line has variants that make a 'spoon like loop' + // Some PT lines have variants that make a 'spoon like loop' // In this case the ref will usually be the same, if not membership in a route_master will need to be checked // The common node between the way that goes into the new sub route relation (currentWay) // and the first one of the route relation currently processed (nextWay) will always have more than 2 parent ways if (!startNewSegment && !relation.equals(parentRoute) - && Objects.equals(relation.get("ref"), parentRoute.get("ref"))) { - final Node commonNode = WayUtils.findFirstCommonNode(thisRoute.currentWay, thisRoute.nextWay).orElseGet(null); - if (commonNode.getParentWays().stream() - .filter(w -> (getItineraryWays(parentRoute).contains(w))) - .count() > 2) { + && Objects.equals(relation.get("ref"), parentRoute.get("ref"))) { + if (commonNode2.getParentWays().stream() + .filter(w -> (getItineraryWays(parentRoute).contains(w))) + .count() > 2) { startNewSegment = true; break; } @@ -258,6 +284,43 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { return null; } + /** + * @return The last way of the relation that is being processed + */ + public Way getLastWay() { + return wayMembers.get(wayMembers.size() - 1).getWay(); + } + + /** + * @param ptRoute relation to analyse + * @return the first highway/railway of ptRoute + */ + public Way getFirstWay(Relation ptRoute) { + return getItineraryWays(ptRoute).get(0); + } + + /** + * @param ptRoute relation to analyse + * @return the second highway/railway of ptRoute + */ + public Way getSecondWay(Relation ptRoute) { + return getItineraryWays(ptRoute).get(1); + } + + /** + * @param ptRoute relation to analyse + * @return the last highway/railway of ptRoute + */ + public Way getLastWay(Relation ptRoute) { + final List highways = getItineraryWays(ptRoute); + return highways.get(highways.size() - 1); + } + + /** + * @param ptRoute relation to inventorise + * @return All the highway/railway ways of the itinerary + * it drills down into sub relations + */ public ArrayList getItineraryWays(Relation ptRoute) { if (itineraryWays.containsKey(ptRoute)) { return (ArrayList) itineraryWays.get(ptRoute); @@ -277,30 +340,27 @@ public ArrayList getItineraryWays(Relation ptRoute) { } } - public Way getFirstWay(Relation ptRoute) { - return getItineraryWays(ptRoute).get(0); - } - - public Way getSecondWay(Relation ptRoute) { - return getItineraryWays(ptRoute).get(1); - } - - public Way getLastWay(Relation ptRoute) { - final List highways = getItineraryWays(ptRoute); - return highways.get(highways.size() - 1); - } - - public TreeSet getItinerariesInSameDirection(WaySequence thisRoute) { - final String wayInRelation = relation.getId() + "," + thisRoute.currentWay.getId(); + /** + * @param ws way sequence to analyse + * @return all the route relations that describe itineraries in the same sense + * from a lookup table + */ + public TreeSet getItinerariesInSameDirection(WaySequence ws) { + final String wayInRelation = relation.getId() + "," + ws.currentWay.getId(); if (parentRelationsForSameDirectionOfTravel.containsKey(wayInRelation)) { return parentRelationsForSameDirectionOfTravel.get(wayInRelation); } return null; } - public TreeSet getItinerariesInSameDirection(WaySequence thisRoute, + /** + * @param ws way sequence to analyse + * @return all the route relations that describe itineraries in the same sense + * calculated, and stored in the lookup table if there is a match + */ + public TreeSet getItinerariesInSameDirection(WaySequence ws, List parentRouteRelations) { - TreeSet r = getItinerariesInSameDirection(thisRoute); + TreeSet r = getItinerariesInSameDirection(ws); if (r != null) { return r; } else { @@ -308,20 +368,20 @@ public TreeSet getItinerariesInSameDirection(WaySequence thisRoute, for (Relation parentRoute : parentRouteRelations) { final List parentRouteHighways = getItineraryWays(parentRoute); if (!itinerariesInSameDirection.contains(parentRoute)) { - if (getFirstWay(parentRoute) == thisRoute.currentWay - && thisRoute.previousWay != null - && !thisRoute.previousWay.getNodes().contains(getSecondWay(parentRoute).getNode(0))) { + if (getFirstWay(parentRoute) == ws.currentWay + && ws.previousWay != null + && !ws.previousWay.getNodes().contains(getSecondWay(parentRoute).getNode(0))) { itinerariesInSameDirection.add(parentRoute); } - findPreviousAndNextWayInRoute(parentRouteHighways, thisRoute.currentWay).stream() - .filter(waysInParentRoute -> isItineraryInSameDirection(thisRoute, waysInParentRoute)) + findPreviousAndNextWayInRoute(parentRouteHighways, ws.currentWay).stream() + .filter(waysInParentRoute -> isItineraryInSameDirection(ws, waysInParentRoute)) .map(waysInParentRoute -> parentRoute) .forEachOrdered(itinerariesInSameDirection::add); } } - if (getMembershipCount(thisRoute.currentWay, relation) < 2) { + if (getMembershipCount(ws.currentWay, relation) < 2) { parentRelationsForSameDirectionOfTravel.put( - relation.getId() + "," + thisRoute.currentWay.getId(), + relation.getId() + "," + ws.currentWay.getId(), itinerariesInSameDirection); } return itinerariesInSameDirection; @@ -367,43 +427,43 @@ public List getIndicesFor(OsmPrimitive primitive, Relation routeRelatio return indices; } - public boolean isItineraryInSameDirection(WaySequence thisRoute, - WaySequence parentRoute) { - assert thisRoute.currentWay == parentRoute.currentWay : + public boolean isItineraryInSameDirection(WaySequence ws, + WaySequence parent_ws) { + assert ws.currentWay == parent_ws.currentWay : "this only works when comparing two equivalent way sequences" ; // if all ways are present, try the simple solution first - if (thisRoute.previousWay != null - && thisRoute.nextWay != null - && parentRoute.previousWay != null - && parentRoute.nextWay != null - && (thisRoute.previousWay == parentRoute.previousWay - || thisRoute.nextWay == parentRoute.nextWay) + if (ws.previousWay != null + && ws.nextWay != null + && parent_ws.previousWay != null + && parent_ws.nextWay != null + && (ws.previousWay == parent_ws.previousWay + || ws.nextWay == parent_ws.nextWay) ) { - return (!thisRoute.previousWay.equals(parentRoute.nextWay) && - !thisRoute.nextWay. equals(parentRoute.previousWay)); + return (!ws.previousWay.equals(parent_ws.nextWay) && + !ws.nextWay. equals(parent_ws.previousWay)); } // if not, compare on the nodes Node firstNodeCurrentWay = null; - if (thisRoute.previousWay != null) { + if (ws.previousWay != null) { firstNodeCurrentWay = WayUtils.findCommonFirstLastNode( - thisRoute.previousWay, thisRoute.currentWay).orElse(null); + ws.previousWay, ws.currentWay).orElse(null); } Node lastNodeCurrentWay = null; - if (thisRoute.nextWay != null) { + if (ws.nextWay != null) { lastNodeCurrentWay = WayUtils.findCommonFirstLastNode( - thisRoute.currentWay, thisRoute.nextWay).orElse(null); + ws.currentWay, ws.nextWay).orElse(null); } Node firstNodeWayOfParent = null; - if (parentRoute.previousWay != null) { + if (parent_ws.previousWay != null) { firstNodeWayOfParent = WayUtils.findCommonFirstLastNode( - parentRoute.previousWay, parentRoute.currentWay).orElse(null); + parent_ws.previousWay, parent_ws.currentWay).orElse(null); } Node lastNodeWayOfParent = null; - if (parentRoute.nextWay != null) { + if (parent_ws.nextWay != null) { lastNodeWayOfParent = WayUtils.findCommonFirstLastNode( - parentRoute.currentWay, parentRoute.nextWay).orElse(null); + parent_ws.currentWay, parent_ws.nextWay).orElse(null); } return (firstNodeCurrentWay != null && firstNodeCurrentWay.equals(firstNodeWayOfParent) @@ -534,7 +594,9 @@ public List getStreetNames() { streetName = rm.getWay().get("ref"); } if (streetName != null) { - streetNames.add(streetName); + if (!streetNames.contains(streetName)) { + streetNames.add(streetName); + } } } } @@ -647,7 +709,7 @@ public void updateTags() { String.format("%s(%s)", getFirstAndLastStreetNameOrRef(), lineIdentifiersSignature)); extractedRelation.put("route_ref", lineIdentifiersSignature); // extractedRelation.put("street_names", getStreetNamesSignature()); - extractedRelation.put("colour", getColoursSignature()); + // extractedRelation.put("colour", getColoursSignature()); } private void addPtSegment() { diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 99d05272..5689a7c4 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -8,10 +8,13 @@ import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; +import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.*; +import java.util.List; import static org.junit.Assert.*; import static org.openstreetmap.josm.io.OsmReader.parseDataSet; @@ -160,27 +163,6 @@ public void bus601_600_3_Test() { assertEquals("", segment1.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment1.getWayMembers()); - // The following code serves to create list of - // ways in the route relation to test with - //Relation bus600RouteRelation = allRelations.stream() - // .filter(relation -> relation.getId() == 955908) - // .findFirst().orElse(null); - //List members = bus600RouteRelation.getMembers(); - //for (int i = members.size() - 1; i >= 0; i--) { - // RelationMember member = members.get(i); - // if (member.isWay() && RouteUtils.isPTWay(member)) { - // Way way = member.getWay(); - // String id = String.valueOf(way.getId()); - // String name = ""; - // if (way.hasKey("name")) name = way.get("name"); - // name = name.replace("-","_"); - // name = name.replace(" ","_"); - // name += "_"; - // System.out.println(String.format("final int W_%s_%s%s_ = %s;", - // i, name, id, id)); - // } - //} - final int W_158_perron1and2terminus_78579065_B = 78579065; final int W_157_perron1and2_377814547_A = 377814547; @@ -202,8 +184,7 @@ public void bus601_600_3_Test() { W_157_perron1and2_377814547_A, W_158_perron1and2terminus_78579065_B, W_156_TiensevestToPerron1_79596986_A, null, "#1199DD;#229922;#771133;#77CCAA;#8899AA;#991199;#995511;#BB0022;#BBDD00;#C5AA77;#DD0077;#DD5555;#FF88AA;#FFCC11", - "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658" - ); + "1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658"); final int W_155_Tiensevest_5_79211473_A = 79211473; @@ -212,8 +193,7 @@ public void bus601_600_3_Test() { W_156_TiensevestToPerron1_79596986_A, W_156_TiensevestToPerron1_79596986_A, W_155_Tiensevest_5_79211473_A, "Tiensevest", null, - "305;306;310;318;358;410;433;475;485;601;658" - ); + "305;306;310;318;358;410;433;475;485;601;658"); final int W_154_Tiensevest_4_79211472_A = 79211472; @@ -222,8 +202,7 @@ public void bus601_600_3_Test() { W_155_Tiensevest_5_79211473_A, W_155_Tiensevest_5_79211473_A, W_154_Tiensevest_4_79211472_A, "Tiensevest", null, - "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658" - ); + "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"); final int W_153_Tiensevest_3_79175435_A = 79175435; @@ -232,8 +211,7 @@ public void bus601_600_3_Test() { W_154_Tiensevest_4_79211472_A, W_154_Tiensevest_4_79211472_A, W_153_Tiensevest_3_79175435_A, "Tiensevest", null, - "1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658" - ); + "2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"); final int W_152_Tiensevest_2_80458208_A = 80458208; @@ -242,8 +220,7 @@ public void bus601_600_3_Test() { W_153_Tiensevest_3_79175435_A, W_153_Tiensevest_3_79175435_A, W_152_Tiensevest_2_80458208_A, "Tiensevest", null, - "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658" - ); + "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658"); final int W_33_151_Tiensevest_1_19793164_A = 19793164; @@ -252,8 +229,7 @@ public void bus601_600_3_Test() { W_152_Tiensevest_2_80458208_A, W_152_Tiensevest_2_80458208_A, W_33_151_Tiensevest_1_19793164_A, "Tiensevest", null, - "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658" - ); + "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658"); final int W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D = 6184898; final int W_29_147_Diestsevest_1_8133608_A = 8133608; @@ -263,8 +239,7 @@ public void bus601_600_3_Test() { W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", null, - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658" - ); + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"); final int W_28_146_Artoisplein_2_254800931_A = 254800931; @@ -277,16 +252,14 @@ public void bus601_600_3_Test() { W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", null, - "305;318;334;335;358;410;513;601;630;651;652;658" - ); + "305;318;334;335;358;410;513;601;630;651;652;658"); RouteSegmentToExtract segment10 = segment9.addPTWayMember(145); Relation rel10 = extractAndAssertValues(145, segment9, segment10, cloneOfBus601RouteRelation, W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, W_145_Artoisplein_1_23691158_E, "Joanna-Maria Artoisplein", null, - "178;305;318;334;335;358;410;513;601;630;651;652;658" - ); + "178;305;318;334;335;358;410;513;601;630;651;652;658"); final int W_140_Lüdenscheidsingel_1_3993387_E = 3993387; final int W_136_Den_Boschsingel_2_23837544_A = 23837544; @@ -297,8 +270,7 @@ public void bus601_600_3_Test() { W_141_Lüdenscheidsingel_2_109267417_A, W_145_Artoisplein_1_23691158_E, W_140_Lüdenscheidsingel_1_3993387_E, "Lüdenscheidsingel", null, - "178;305;318;358;410;601;651;652;658" - ); + "178;305;318;358;410;601;651;652;658"); final int W_135_Den_Boschsingel_3_225605630_E = 225605630; final int W_131_Rennes_Singel_1_249333185_A = 249333185; @@ -309,8 +281,7 @@ public void bus601_600_3_Test() { W_136_Den_Boschsingel_2_23837544_A, W_140_Lüdenscheidsingel_1_3993387_E, W_135_Den_Boschsingel_3_225605630_E, "Den Boschsingel", null, - "318;358;410;601;651;658" - ); + "318;358;410;601;651;658"); final int W_99_130_Herestraat_1_249333184_AC = 249333184; // W_100_129_Herestraat_2_813970231_BB = 813970231; final int W_128_Herestraat_11_681081951_A = 681081951; @@ -321,8 +292,7 @@ public void bus601_600_3_Test() { W_131_Rennes_Singel_1_249333185_A, W_135_Den_Boschsingel_3_225605630_E, W_99_130_Herestraat_1_249333184_AC, "Herestraat", null, - "318;410;601" - ); + "318;410;601"); final int W_127_Herestraat_10_813970227_C = 813970227; final int W_125_Herestraat_8_8079995_A = 8079995; @@ -333,8 +303,7 @@ public void bus601_600_3_Test() { W_128_Herestraat_11_681081951_A, W_99_130_Herestraat_1_249333184_AC, W_127_Herestraat_10_813970227_C, "Herestraat", null, - "410;601" - ); + "410;601"); final int W_124_Rotonde_Het_Teken_41403538_B = 41403538; final int W_123_Ring_Zuid_79340950_A = 79340950; @@ -345,8 +314,7 @@ public void bus601_600_3_Test() { W_125_Herestraat_8_8079995_A, W_127_Herestraat_10_813970227_C, W_124_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", null, - "410;600;601" - ); + "410;600;601"); final int W_122_Ring_Zuid_11369123_A = 11369123; @@ -356,8 +324,7 @@ public void bus601_600_3_Test() { W_123_Ring_Zuid_79340950_A, W_124_Rotonde_Het_Teken_41403538_B, W_122_Ring_Zuid_11369123_A, "Ring Zuid", null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_121__159949154_A = 159949154; final int W_120__332258104_B = 332258104; @@ -369,8 +336,7 @@ public void bus601_600_3_Test() { W_122_Ring_Zuid_11369123_A, W_122_Ring_Zuid_11369123_A, W_121__159949154_A, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_118_GHB_p5_377918641_B = 377918641; final int W_117_GHB_p5_14508736_A = 14508736; @@ -380,8 +346,7 @@ public void bus601_600_3_Test() { W_121__159949154_A, W_121__159949154_A, W_120__332258104_B, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_116_Ring_Zuid_p45_109267436_A = 109267436; @@ -391,8 +356,7 @@ public void bus601_600_3_Test() { W_119_GHB_ingang_78852604_A, W_120__332258104_B, W_118_GHB_p5_377918641_B, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_115_Ring_Zuid_p3_14508739_A = 14508739; @@ -402,8 +366,7 @@ public void bus601_600_3_Test() { W_117_GHB_p5_14508736_A, W_118_GHB_p5_377918641_B, W_116_Ring_Zuid_p45_109267436_A, "Ring Zuid", null, - "3;317;395;410;601" - ); + "3;317;395;410;601"); final int W_114_Ring_Zuid_p2_14508740_A = 14508740; @@ -412,8 +375,7 @@ public void bus601_600_3_Test() { W_116_Ring_Zuid_p45_109267436_A, W_116_Ring_Zuid_p45_109267436_A, W_115_Ring_Zuid_p3_14508739_A, "Ring Zuid", null, - "3;317;395;410;600;601" - ); + "3;317;395;410;600;601"); final int W_113_Ring_Zuid_p1_502328838_D = 502328838; final int W_110_Rotonde_Het_Teken_78568660_A = 78568660; @@ -423,16 +385,14 @@ public void bus601_600_3_Test() { W_115_Ring_Zuid_p3_14508739_A, W_115_Ring_Zuid_p3_14508739_A, W_114_Ring_Zuid_p2_14508740_A, "Ring Zuid", null, - "3;317;334;335;395;410;600;601" - ); + "3;317;334;335;395;410;600;601"); RouteSegmentToExtract segment23 = segment22.addPTWayMember(113); extractAndAssertValues(113, segment22, segment23, cloneOfBus601RouteRelation, W_114_Ring_Zuid_p2_14508740_A, W_114_Ring_Zuid_p2_14508740_A, W_113_Ring_Zuid_p1_502328838_D, "Ring Zuid", null, - "3;317;334;335;380;395;410;600;601" - ); + "3;317;334;335;380;395;410;600;601"); final int W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A = 78873921; @@ -442,8 +402,7 @@ public void bus601_600_3_Test() { W_110_Rotonde_Het_Teken_78568660_A, W_113_Ring_Zuid_p1_502328838_D, W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, "Rotonde Het Teken", null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); final int W_108_Rotonde_Het_Teken_3752557_A = 3752557; @@ -452,8 +411,7 @@ public void bus601_600_3_Test() { W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, W_108_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); final int W_107_Rotonde_Het_Teken_VWBln_249333188_A = 249333188; @@ -462,8 +420,7 @@ public void bus601_600_3_Test() { W_108_Rotonde_Het_Teken_3752557_A, W_108_Rotonde_Het_Teken_3752557_A, W_107_Rotonde_Het_Teken_VWBln_249333188_A, "Rotonde Het Teken", null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); final int W_106_Rotonde_Het_Teken_249333187_A = 249333187; @@ -472,8 +429,7 @@ public void bus601_600_3_Test() { W_107_Rotonde_Het_Teken_VWBln_249333188_A, W_107_Rotonde_Het_Teken_VWBln_249333188_A, W_106_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", null, - "3;410;600;601" - ); + "3;410;600;601"); final int W_105_Herestraat_7_13067134_D = 13067134; final int W_102_Herestraat_4_813970228_A = 813970228; @@ -483,8 +439,7 @@ public void bus601_600_3_Test() { W_106_Rotonde_Het_Teken_249333187_A, W_106_Rotonde_Het_Teken_249333187_A, W_105_Herestraat_7_13067134_D, "Herestraat", null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_101_Herestraat_3_813970229_C = 813970229; // 99 and 100 are defined as 129 and 130 @@ -495,8 +450,7 @@ public void bus601_600_3_Test() { W_102_Herestraat_4_813970228_A, W_105_Herestraat_7_13067134_D, W_101_Herestraat_3_813970229_C, "Herestraat", null, - "410;600;601" - ); + "410;600;601"); final int W_98_Rennes_Singel_249333186_H = 249333186; final int W_91_Rennes_Singel_429706864_A = 429706864; @@ -507,8 +461,7 @@ public void bus601_600_3_Test() { W_99_130_Herestraat_1_249333184_AC, W_101_Herestraat_3_813970229_C, W_98_Rennes_Singel_249333186_H, "Rennes-Singel", null, - "601" - ); + "601"); final int W_90_Tervuursevest_99583853_K = 99583853; final int W_80_Tervuursevest_88361317_A = 88361317; @@ -519,8 +472,7 @@ public void bus601_600_3_Test() { W_91_Rennes_Singel_429706864_A, W_98_Rennes_Singel_249333186_H, W_90_Tervuursevest_99583853_K, "Tervuursevest", null, - "318;601" - ); + "318;601"); final int W_79_Tervuursevest_Kapucijnenvoer_461159345_A = 461159345; @@ -530,8 +482,7 @@ public void bus601_600_3_Test() { W_80_Tervuursevest_88361317_A, W_90_Tervuursevest_99583853_K, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, "Tervuursevest", null, - "601" - ); + "601"); final int W_78_Tervuursevest_461159362_K = 461159362; final int W_68_Tervuursevest_3677330_A = 3677330; @@ -541,8 +492,7 @@ public void bus601_600_3_Test() { W_79_Tervuursevest_Kapucijnenvoer_461159345_A, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, W_78_Tervuursevest_461159362_K, "Tervuursevest", null, - "178;179;306 (student);601" - ); + "178;179;306 (student);601"); final int W_67_Naamsevest_86164005_G = 86164005; final int W_61_Geldenaaksevest_24905257_A = 24905257; @@ -556,8 +506,7 @@ public void bus601_600_3_Test() { W_68_Tervuursevest_3677330_A, W_78_Tervuursevest_461159362_K, W_67_Naamsevest_86164005_G, "Naamsevest", null, - "178;179;306 (student);520;524;525;537;601" - ); + "178;179;306 (student);520;524;525;537;601"); final int W_52_Tiensepoort_16775171_D = 16775171; final int W_49_Tiensevest_Oostertunnel_8590231_A = 8590231; @@ -568,8 +517,7 @@ public void bus601_600_3_Test() { W_61_Geldenaaksevest_24905257_A, W_67_Naamsevest_86164005_G, W_60_Geldenaaksevest_608715605_H, "Geldenaaksevest", null, - "18;178;179;306 (student);337;601;616" - ); + "18;178;179;306 (student);337;601;616"); for (int n = 60; n >= 53; n--) {returnValueNull =segment35.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment36 = segment35.addPTWayMember(52); @@ -577,8 +525,7 @@ public void bus601_600_3_Test() { W_53_Geldenaaksevest_8130906_A, W_60_Geldenaaksevest_608715605_H, W_52_Tiensepoort_16775171_D, "Tiensepoort", null, - "18;178;179;306 (student);337;601;616;630" - ); + "18;178;179;306 (student);337;601;616;630"); final int W_48_Tiensevest_185988814_A = 185988814; @@ -588,8 +535,7 @@ public void bus601_600_3_Test() { W_49_Tiensevest_Oostertunnel_8590231_A, W_52_Tiensepoort_16775171_D, W_48_Tiensevest_185988814_A, "Tiensevest", null, - "7;8;9;18;178;179;306 (student);337;380;527;601;616;630" - ); + "7;8;9;18;178;179;306 (student);337;380;527;601;616;630"); final int W_47_Martelarenplein_76856823_D = 76856823; final int W_44__78815533_A = 78815533; @@ -599,8 +545,7 @@ public void bus601_600_3_Test() { W_48_Tiensevest_185988814_A, W_48_Tiensevest_185988814_A, W_47_Martelarenplein_76856823_D, "Martelarenplein", null, - "1;7;8;9;18;178;179;306 (student);337;380;527;601;616;630" - ); + "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;616;630"); final int W_43__79264899_A = 79264899; @@ -610,8 +555,7 @@ public void bus601_600_3_Test() { W_44__78815533_A, W_47_Martelarenplein_76856823_D, W_43__79264899_A, null, null, - "7;8;9;18;178;179;306 (student);337;380;527;601;630" - ); + "4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630"); final int W_42__377918635_A = 377918635; @@ -620,8 +564,7 @@ public void bus601_600_3_Test() { W_43__79264899_A, W_43__79264899_A, W_42__377918635_A, null, null, - "18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630" - ); + "4;5;6;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630"); final int W_41__79264888_A = 79264888; RouteSegmentToExtract segment41 = segment40.addPTWayMember(41); @@ -629,8 +572,7 @@ public void bus601_600_3_Test() { W_42__377918635_A, W_42__377918635_A, W_41__79264888_A, null, null, - "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601" - ); + "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"); final int W_40__79264897_B = 79264897; final int W_39__71754927_A = 71754927; @@ -640,8 +582,7 @@ public void bus601_600_3_Test() { W_41__79264888_A, W_41__79264888_A, W_40__79264897_B, null, null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601" - ); + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"); final int W_38__377918638_A_TEC18 = 377918638; @@ -651,8 +592,7 @@ public void bus601_600_3_Test() { W_39__71754927_A, W_40__79264897_B, W_38__377918638_A_TEC18, null, null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601" - ); + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"); final int W_37__79264891_A = 79264891; @@ -661,8 +601,7 @@ public void bus601_600_3_Test() { W_38__377918638_A_TEC18, W_38__377918638_A_TEC18, W_37__79264891_A, null, null, - "18;601" - ); + "18;601"); final int W_36_Tiensevest_78568409_A = 78568409; RouteSegmentToExtract segment46 = segment45.addPTWayMember(36); @@ -670,8 +609,7 @@ public void bus601_600_3_Test() { W_37__79264891_A, W_37__79264891_A, W_36_Tiensevest_78568409_A, "Tiensevest", null, - "18;601" - ); + "18;601"); final int W_35_Tiensevest_79193579_A = 79193579; RouteSegmentToExtract segment47 = segment46.addPTWayMember(35); @@ -679,8 +617,7 @@ public void bus601_600_3_Test() { W_36_Tiensevest_78568409_A, W_36_Tiensevest_78568409_A, W_35_Tiensevest_79193579_A, "Tiensevest", null, - "4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658" - ); + "4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658"); final int W_34_Bend_19793394_A = 19793394; // ways 28 to 33 are the same as 146 - 151 final int W_27_Zoutstraat_3992548_A = 3992548; @@ -690,8 +627,7 @@ public void bus601_600_3_Test() { W_35_Tiensevest_79193579_A, W_35_Tiensevest_79193579_A, W_34_Bend_19793394_A, null, null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658" - ); + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"); final int W_26_Havenkant_510790349_M = 510790349; final int W_14_Engels_Plein_338057820_A = 338057820; @@ -701,16 +637,14 @@ public void bus601_600_3_Test() { W_34_Bend_19793394_A, W_34_Bend_19793394_A, W_33_151_Tiensevest_1_19793164_A, "Tiensevest", null, - "334;335;513;601" - ); + "334;335;513;601"); RouteSegmentToExtract segment50 = segment49.addPTWayMember(32); Relation rel50 = extractAndAssertValues(32, segment49, segment50, cloneOfBus601RouteRelation, W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", null, - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658" - ); + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"); assertEquals(rel8.getId(), rel50.getId()); for (int n = 31; n >= 29; n--) {returnValueNull =segment50.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} @@ -719,8 +653,7 @@ public void bus601_600_3_Test() { W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", null, - "305;318;334;335;358;410;513;601;630;651;652;658" - ); + "305;318;334;335;358;410;513;601;630;651;652;658"); assertEquals(rel9.getId(), rel51.getId()); RouteSegmentToExtract segment52 = segment51.addPTWayMember(27); @@ -728,8 +661,7 @@ public void bus601_600_3_Test() { W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, W_27_Zoutstraat_3992548_A, "Zoutstraat", null, - "178;305;318;334;335;358;410;513;601;630;651;652;658" - ); + "178;305;318;334;335;358;410;513;601;630;651;652;658"); assertEquals(rel10.getId(), rel52.getId()); RouteSegmentToExtract segment53 = segment52.addPTWayMember(26); @@ -737,8 +669,7 @@ public void bus601_600_3_Test() { W_27_Zoutstraat_3992548_A, W_27_Zoutstraat_3992548_A, W_26_Havenkant_510790349_M, "Havenkant", null, - "334;335;513;601;630" - ); + "334;335;513;601;630"); for (int n = 25; n >= 14; n--) {returnValueNull =segment53.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment54 = segment53.addPTWayMember(13); @@ -746,8 +677,7 @@ public void bus601_600_3_Test() { W_14_Engels_Plein_338057820_A, W_26_Havenkant_510790349_M, 0, null, null, - "601" - ); + "601"); // *********************************************************** @@ -783,8 +713,7 @@ public void bus601_600_3_Test() { W_155_Havenkant_29283599_A, W_169_Engels_Plein_608715622_O, W_154_Havenkant_304241968_B, "Havenkant", null, - "600" - ); + "600"); final int W_152_Redersstraat_340265961_B = 340265961; final int W_151_Redersstraat_318825613_A = 318825613; @@ -795,8 +724,7 @@ public void bus601_600_3_Test() { W_153_Aarschotsesteenweg_304241967_A, W_154_Havenkant_304241968_B, W_152_Redersstraat_340265961_B, "Redersstraat", null, - "334;335;513;600;630" - ); + "334;335;513;600;630"); final int W_150_Redersstraat_340265962_A = 340265962; @@ -806,8 +734,7 @@ public void bus601_600_3_Test() { W_151_Redersstraat_318825613_A, W_152_Redersstraat_340265961_B, W_150_Redersstraat_340265962_A, "Redersstraat", null, - "600" - ); + "600"); final int W_149_Joanna_Maria_Artoisplein_254801390_B = 254801390; final int W_148_Joanna_Maria_Artoisplein_61540068_A = 61540068; @@ -817,8 +744,7 @@ public void bus601_600_3_Test() { W_150_Redersstraat_340265962_A, W_150_Redersstraat_340265962_A, W_149_Joanna_Maria_Artoisplein_254801390_B, "Joanna-Maria Artoisplein", null, - "333;334;335;513;600;630" - ); + "333;334;335;513;600;630"); final int W_147_Vuurkruisenlaan_23691160_C = 23691160; final int W_145_Diestsepoort_8109264_A = 8109264; @@ -829,8 +755,7 @@ public void bus601_600_3_Test() { W_148_Joanna_Maria_Artoisplein_61540068_A, W_149_Joanna_Maria_Artoisplein_254801390_B, W_147_Vuurkruisenlaan_23691160_C, "Vuurkruisenlaan", null, - "178;318;333;334;335;410;513;600;630;651;652;658" - ); + "178;305;318;333;334;335;410;513;600;630;651;652;658"); final int W_144_Diestsepoort_61556877_D = 61556877; final int W_141_Diestsepoort_584356745_A = 584356745; @@ -841,8 +766,7 @@ public void bus601_600_3_Test() { W_145_Diestsepoort_8109264_A, W_147_Vuurkruisenlaan_23691160_C, W_144_Diestsepoort_61556877_D, "Diestsepoort", null, - "333;334;335;513;600;630;651;652;658" - ); + "305;333;334;335;513;600;630;651;652;658"); final int W_140_Diestsepoort_198559166_E = 198559166; final int W_136_Diestsepoort_451873774_A = 451873774; @@ -853,8 +777,7 @@ public void bus601_600_3_Test() { W_141_Diestsepoort_584356745_A, W_144_Diestsepoort_61556877_D, W_140_Diestsepoort_198559166_E, "Diestsepoort", null, - "2;3;179;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658" - ); + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"); final int W_135__76867049_C = 76867049; // W_134__79264890_B = 79264890; @@ -866,8 +789,7 @@ public void bus601_600_3_Test() { W_136_Diestsepoort_451873774_A, W_140_Diestsepoort_198559166_E, W_135__76867049_C, null, null, - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658" - ); + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"); final int W_132__79596974_B = 79596974; final int W_131__79596982_A = 79596982; @@ -878,8 +800,7 @@ public void bus601_600_3_Test() { W_133__79596965_A, W_135__76867049_C, W_132__79596974_B, null, null, - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630" - ); + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"); final int W_130__79596987_C = 79596987; final int W_128__79596980_A = 79596980; @@ -890,8 +811,7 @@ public void bus601_600_3_Test() { W_131__79596982_A, W_132__79596974_B, W_130__79596987_C, null, null, - "3;333;334;335;433;600;630" - ); + "3;333;334;335;433;600;630"); final int W_127_Tiensevest_79193579_A = 79193579; for (int n = 129; n >= 128; n--) {returnValueNull =segment111.addPTWayMember(n); assertNull(returnValueNull);} @@ -900,8 +820,7 @@ public void bus601_600_3_Test() { W_128__79596980_A, W_130__79596987_C, W_127_Tiensevest_79193579_A, "Tiensevest", null, - "3;333;334;335;513;600;630" - ); + "3;333;334;335;513;600;630"); final int W_126_Tiensevest_258936980_A = 258936980; @@ -910,8 +829,7 @@ public void bus601_600_3_Test() { W_127_Tiensevest_79193579_A, W_127_Tiensevest_79193579_A, W_126_Tiensevest_258936980_A, "Tiensevest", null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658" - ); + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"); final int W_125_Tiensevest_79193580_A = 79193580; @@ -920,8 +838,7 @@ public void bus601_600_3_Test() { W_126_Tiensevest_258936980_A, W_126_Tiensevest_258936980_A, W_125_Tiensevest_79193580_A, "Tiensevest", null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658" - ); + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"); final int W_124_Tiensevest_79193581_A = 79193581; @@ -930,8 +847,7 @@ public void bus601_600_3_Test() { W_125_Tiensevest_79193580_A, W_125_Tiensevest_79193580_A, W_124_Tiensevest_79193581_A, "Tiensevest", null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" - ); + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); final int W_123_Tiensevest_78815505_A = 78815505; @@ -940,19 +856,17 @@ public void bus601_600_3_Test() { W_124_Tiensevest_79193581_A, W_124_Tiensevest_79193581_A, W_123_Tiensevest_78815505_A, "Tiensevest", null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" - ); + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - final int W_122_Tiensevest_84696751_A = 84696751; + final int W_122_Tiensevest_84696751_B = 84696751; final int W_121_Tiensevest_79265237_A = 79265237; RouteSegmentToExtract segment117 = segment116.addPTWayMember(122); extractAndAssertValues(122, segment116, segment117, cloneOfBus600RouteRelation, W_123_Tiensevest_78815505_A, W_123_Tiensevest_78815505_A, - W_122_Tiensevest_84696751_A, "Tiensevest", + W_122_Tiensevest_84696751_B, "Tiensevest", null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630" - ); + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); final int W_120_Tiensevest_89574079_B = 89574079; final int W_119_Tiensevest_81522744_A = 81522744; @@ -960,33 +874,24 @@ public void bus601_600_3_Test() { final int W_118_Tiensevest_19793223_B = 19793223; final int W_117_Tiensevest_185988814_A = 185988814; - RouteSegmentToExtract segment118 = segment117.addPTWayMember(121); - extractAndAssertValues(121, segment117, segment118, cloneOfBus600RouteRelation, - W_122_Tiensevest_84696751_A, W_122_Tiensevest_84696751_A, - W_121_Tiensevest_79265237_A, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630" - ); - - RouteSegmentToExtract segment119 = segment118.addPTWayMember(120); - extractAndAssertValues(120, segment118, segment119, cloneOfBus600RouteRelation, - W_121_Tiensevest_79265237_A, W_121_Tiensevest_79265237_A, + for (int n = 121; n >= 121; n--) {returnValueNull =segment117.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment118 = segment117.addPTWayMember(120); + extractAndAssertValues(120, segment117, segment118, cloneOfBus600RouteRelation, + W_121_Tiensevest_79265237_A, W_122_Tiensevest_84696751_B, W_120_Tiensevest_89574079_B, "Tiensevest", null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630" - ); + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"); final int W_116_Tiensevest_185988816_B = 185988816; final int W_115_Tiensevest_15083398_A = 15083398; - for (int n = 119; n >= 119; n--) {returnValueNull =segment119.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment119a = segment119.addPTWayMember(118); - extractAndAssertValues(118, segment119, segment119a, cloneOfBus600RouteRelation, + for (int n = 119; n >= 119; n--) {returnValueNull =segment118.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment119a = segment118.addPTWayMember(118); + extractAndAssertValues(118, segment118, segment119a, cloneOfBus600RouteRelation, W_119_Tiensevest_81522744_A, W_120_Tiensevest_89574079_B, W_118_Tiensevest_19793223_B, "Tiensevest", null, - "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630" - ); + "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"); for (int n = 117; n >= 117; n--) {returnValueNull =segment119a.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment119b = segment119a.addPTWayMember(116); @@ -994,8 +899,7 @@ public void bus601_600_3_Test() { W_117_Tiensevest_185988814_A, W_118_Tiensevest_19793223_B, W_116_Tiensevest_185988816_B, "Tiensevest", null, - "1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630" - ); + "1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630"); final int W_114_Tiensevest_8154434_E = 8154434; final int W_110_Tiensevest_521193611_A = 521193611; @@ -1006,8 +910,7 @@ public void bus601_600_3_Test() { W_115_Tiensevest_15083398_A, W_116_Tiensevest_185988816_B, W_114_Tiensevest_8154434_E, "Tiensevest", null, - "7;8;9;18;179;306 (student);337;380;600;616;630" - ); + "7;8;9;18;179;306 (student);337;380;600;616;630"); final int W_109_Tiensepoort_4003928_G = 4003928; final int W_103_Geldenaaksevest_199381120_A = 199381120; @@ -1018,8 +921,7 @@ public void bus601_600_3_Test() { W_110_Tiensevest_521193611_A, W_114_Tiensevest_8154434_E, W_109_Tiensepoort_4003928_G, "Tiensepoort", null, - "7;8;9;18;178;179;306 (student);337;380;600;616;630" - ); + "7;8;9;18;178;179;306 (student);337;380;600;616;630"); final int W_102_Geldenaaksevest_3991775_E = 3991775; final int W_99_Erasme_Ruelensvest_608715579_A = 608715579; @@ -1030,8 +932,7 @@ public void bus601_600_3_Test() { W_103_Geldenaaksevest_199381120_A, W_109_Tiensepoort_4003928_G, W_102_Geldenaaksevest_3991775_E, "Geldenaaksevest", null, - "18;178;179;306 (student);337;600;616;630" - ); + "18;178;179;306 (student);337;600;616;630"); final int W_98_Erasme_Ruelensvest_3677822_B = 3677822; final int W_97_Tervuursevest_120086003_A = 120086003; @@ -1042,8 +943,7 @@ public void bus601_600_3_Test() { W_99_Erasme_Ruelensvest_608715579_A, W_102_Geldenaaksevest_3991775_E, W_98_Erasme_Ruelensvest_3677822_B, "Erasme Ruelensvest", null, - "18;178;179;306 (student);337;600;616" - ); + "18;178;179;306 (student);337;600;616"); final int W_96_Tervuursevest_90168774_F = 90168774; final int W_92_Tervuursevest_85044922_A = 85044922; @@ -1056,8 +956,7 @@ public void bus601_600_3_Test() { W_97_Tervuursevest_120086003_A, W_98_Erasme_Ruelensvest_3677822_B, W_96_Tervuursevest_90168774_F, "Tervuursevest", null, - "178;179;306 (student);600" - ); + "178;179;306 (student);600"); for (int n = 95; n >= 92; n--) {returnValueNull =segment125.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment127 = segment125.addPTWayMember(91); @@ -1065,8 +964,7 @@ public void bus601_600_3_Test() { W_92_Tervuursevest_85044922_A, W_96_Tervuursevest_90168774_F, W_91_Tervuursevest_16771611_A, "Tervuursevest", null, - "178;179;306 (student);520;524;525;537;586;600" - ); + "178;179;306 (student);520;524;525;537;586;600"); final int W_90_Tervuursevest_13246158_A = 13246158; @@ -1078,8 +976,7 @@ public void bus601_600_3_Test() { W_91_Tervuursevest_16771611_A, W_91_Tervuursevest_16771611_A, W_90_Tervuursevest_13246158_A, "Tervuursevest", null, - "178;520;524;525;537;586;600" - ); + "178;520;524;525;537;586;600"); final int W_87_Tervuursevest_608715518_J = 608715518; final int W_78_Tervuursevest_3677945_A = 3677945; @@ -1089,8 +986,7 @@ public void bus601_600_3_Test() { W_90_Tervuursevest_13246158_A, W_90_Tervuursevest_13246158_A, W_89_Tervuursevest_260405216_B, "Tervuursevest", null, - "7;8;9;178;520;524;525;527;537;586;600" - ); + "7;8;9;178;520;524;525;527;537;586;600"); for (int n = 88; n >= 88; n--) {returnValueNull =segment129.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment130 = segment129.addPTWayMember(87); @@ -1098,8 +994,7 @@ public void bus601_600_3_Test() { W_88_Tervuursevest_16771609_A, W_89_Tervuursevest_260405216_B, W_87_Tervuursevest_608715518_J, "Tervuursevest", null, - "7;8;9;178;527;600" - ); + "7;8;9;178;527;600"); final int W_77_Rennes_Singel_192559627_E = 192559627; final int W_73_Rennes_Singel_28982660_A = 28982660; @@ -1112,8 +1007,7 @@ public void bus601_600_3_Test() { W_78_Tervuursevest_3677945_A, W_87_Tervuursevest_608715518_J, W_77_Rennes_Singel_192559627_E, "Rennes-Singel", null, - "178;600" - ); + "178;600"); final int W_71_Herestraat_813970227_C = 813970227; final int W_69_Herestraat_8079995_A = 8079995; @@ -1124,8 +1018,7 @@ public void bus601_600_3_Test() { W_73_Rennes_Singel_28982660_A, W_77_Rennes_Singel_192559627_E, W_72_Herestraat_78568455_A, "Herestraat", null, - "178;318;600" - ); + "178;318;600"); final int W_68_Rotonde_Het_Teken_41403538_B = 41403538; final int W_67_Ring_Zuid_79340950_A = 79340950; @@ -1135,8 +1028,7 @@ public void bus601_600_3_Test() { W_72_Herestraat_78568455_A, W_72_Herestraat_78568455_A, W_71_Herestraat_813970227_C, "Herestraat", null, - "600" - ); + "600"); for (int n = 70; n >= 69; n--) {returnValueNull =segment133.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment134 = segment133.addPTWayMember(68); @@ -1144,8 +1036,7 @@ public void bus601_600_3_Test() { W_69_Herestraat_8079995_A, W_71_Herestraat_813970227_C, W_68_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", null, - "410;600;601" - ); + "410;600;601"); final int W_66_Ring_Zuid_11369123_A = 11369123; @@ -1155,8 +1046,7 @@ public void bus601_600_3_Test() { W_67_Ring_Zuid_79340950_A, W_68_Rotonde_Het_Teken_41403538_B, W_66_Ring_Zuid_11369123_A, "Ring Zuid", null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_65__159949154_A = 159949154; @@ -1168,16 +1058,14 @@ public void bus601_600_3_Test() { W_66_Ring_Zuid_11369123_A, W_66_Ring_Zuid_11369123_A, W_65__159949154_A, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); RouteSegmentToExtract segment137 = segment136.addPTWayMember(64); extractAndAssertValues(64, segment136, segment137, cloneOfBus600RouteRelation, W_65__159949154_A, W_65__159949154_A, W_64__332258104_B, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_62__14508735_A = 14508735; @@ -1187,8 +1075,7 @@ public void bus601_600_3_Test() { W_63__78852604_A, W_64__332258104_B, W_62__14508735_A, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_61__318878531_B = 318878531; final int W_60__14506241_A = 14506241; @@ -1198,8 +1085,7 @@ public void bus601_600_3_Test() { W_62__14508735_A, W_62__14508735_A, W_61__318878531_B, null, null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600"); final int W_59_Ring_Zuid_109267436_A = 109267436; @@ -1209,8 +1095,7 @@ public void bus601_600_3_Test() { W_60__14506241_A, W_61__318878531_B, W_59_Ring_Zuid_109267436_A, "Ring Zuid", null, - "3;317;395;410;600" - ); + "3;317;395;410;600"); final int W_58_Ring_Zuid_14508739_A = 14508739; @@ -1219,8 +1104,7 @@ public void bus601_600_3_Test() { W_59_Ring_Zuid_109267436_A, W_59_Ring_Zuid_109267436_A, W_58_Ring_Zuid_14508739_A, "Ring Zuid", null, - "3;317;395;410;600;601" - ); + "3;317;395;410;600;601"); final int W_57_Ring_Zuid_14508740_A = 14508740; @@ -1229,8 +1113,7 @@ public void bus601_600_3_Test() { W_58_Ring_Zuid_14508739_A, W_58_Ring_Zuid_14508739_A, W_57_Ring_Zuid_14508740_A, "Ring Zuid", null, - "3;317;334;335;395;410;600;601" - ); + "3;317;334;335;395;410;600;601"); final int W_56_Ring_Zuid_502328838_D = 502328838; final int W_53_Rotonde_Het_Teken_78568660_A = 78568660; @@ -1240,8 +1123,7 @@ public void bus601_600_3_Test() { W_57_Ring_Zuid_14508740_A, W_57_Ring_Zuid_14508740_A, W_56_Ring_Zuid_502328838_D, "Ring Zuid", null, - "3;317;334;335;380;395;410;600;601" - ); + "3;317;334;335;380;395;410;600;601"); final int W_52_Rotonde_Het_Teken_78873921_A = 78873921; @@ -1251,8 +1133,7 @@ public void bus601_600_3_Test() { W_53_Rotonde_Het_Teken_78568660_A, W_56_Ring_Zuid_502328838_D, W_52_Rotonde_Het_Teken_78873921_A, "Rotonde Het Teken", null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); final int W_51_Rotonde_Het_Teken_3752557_A = 3752557; @@ -1261,8 +1142,7 @@ public void bus601_600_3_Test() { W_52_Rotonde_Het_Teken_78873921_A, W_52_Rotonde_Het_Teken_78873921_A, W_51_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); final int W_50_Rotonde_Het_Teken_249333188_A = 249333188; @@ -1271,8 +1151,7 @@ public void bus601_600_3_Test() { W_51_Rotonde_Het_Teken_3752557_A, W_51_Rotonde_Het_Teken_3752557_A, W_50_Rotonde_Het_Teken_249333188_A, "Rotonde Het Teken", null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); final int W_49_Rotonde_Het_Teken_249333187_A = 249333187; @@ -1281,8 +1160,7 @@ public void bus601_600_3_Test() { W_50_Rotonde_Het_Teken_249333188_A, W_50_Rotonde_Het_Teken_249333188_A, W_49_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", null, - "3;410;600;601" - ); + "3;410;600;601"); final int W_48_Herestraat_13067134_D = 13067134; final int W_45_Herestraat_813970228_A = 813970228; @@ -1292,8 +1170,7 @@ public void bus601_600_3_Test() { W_49_Rotonde_Het_Teken_249333187_A, W_49_Rotonde_Het_Teken_249333187_A, W_48_Herestraat_13067134_D, "Herestraat", null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601" - ); + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); final int W_44_Herestraat_270181177_A = 270181177; @@ -1303,8 +1180,7 @@ public void bus601_600_3_Test() { W_45_Herestraat_813970228_A, W_48_Herestraat_13067134_D, W_44_Herestraat_270181177_A, "Herestraat", null, - "410;600;601" - ); + "410;600;601"); final int W_43_Rennes_Singel_78568454_B = 78568454; final int W_42_Rennes_Singel_225605633_A = 225605633; @@ -1314,8 +1190,7 @@ public void bus601_600_3_Test() { W_44_Herestraat_270181177_A, W_44_Herestraat_270181177_A, W_43_Rennes_Singel_78568454_B, "Rennes-Singel", null, - "410;600" - ); + "410;600"); final int W_41_Rennes_Singel_8131123_D = 8131123; final int W_38_Den_Boschsingel_23837543_A = 23837543; @@ -1326,8 +1201,7 @@ public void bus601_600_3_Test() { W_42_Rennes_Singel_225605633_A, W_43_Rennes_Singel_78568454_B, W_41_Rennes_Singel_8131123_D, "Rennes-Singel", null, - "178;318;410;600" - ); + "178;318;410;600"); final int W_37_Den_Boschsingel_146171867_D = 146171867; final int W_34_Lüdenscheidsingel_85048201_A = 85048201; @@ -1338,8 +1212,7 @@ public void bus601_600_3_Test() { W_38_Den_Boschsingel_23837543_A, W_41_Rennes_Singel_8131123_D, W_37_Den_Boschsingel_146171867_D, "Den Boschsingel", null, - "318;410;600" - ); + "318;410;600"); final int W_33_Lüdenscheidsingel_12891213_D = 12891213; final int W_30_Joanna_Maria_Artoisplein_61540098_A = 61540098; @@ -1350,8 +1223,7 @@ public void bus601_600_3_Test() { W_34_Lüdenscheidsingel_85048201_A, W_37_Den_Boschsingel_146171867_D, W_33_Lüdenscheidsingel_12891213_D, "Lüdenscheidsingel", null, - "318;410;600;651;658" - ); + "318;410;600;651;658"); final int W_29_Joanna_Maria_Artoisplein_254801390_B = 254801390; final int W_28_Joanna_Maria_Artoisplein_61540068_A = 61540068; @@ -1362,8 +1234,7 @@ public void bus601_600_3_Test() { W_30_Joanna_Maria_Artoisplein_61540098_A, W_33_Lüdenscheidsingel_12891213_D, W_29_Joanna_Maria_Artoisplein_254801390_B, "Joanna-Maria Artoisplein", null, - "178;318;410;600;651;652;658" - ); + "178;305;318;410;600;651;652;658"); final int W_27_Vuurkruisenlaan_23691160_C = 23691160; final int W_25_Diestsepoort_8109264_A = 8109264; @@ -1374,8 +1245,7 @@ public void bus601_600_3_Test() { W_28_Joanna_Maria_Artoisplein_61540068_A, W_29_Joanna_Maria_Artoisplein_254801390_B, W_27_Vuurkruisenlaan_23691160_C, "Vuurkruisenlaan", null, - "178;318;333;334;335;410;513;600;630;651;652;658" - ); + "178;305;318;333;334;335;410;513;600;630;651;652;658"); final int W_24_Diestsepoort_61556877_D = 61556877; final int W_21_Diestsepoort_584356745_A = 584356745; @@ -1386,8 +1256,7 @@ public void bus601_600_3_Test() { W_25_Diestsepoort_8109264_A, W_27_Vuurkruisenlaan_23691160_C, W_24_Diestsepoort_61556877_D, "Diestsepoort", null, - "333;334;335;513;600;630;651;652;658" - ); + "305;333;334;335;513;600;630;651;652;658"); final int W_20_Diestsepoort_198559166_E = 198559166; final int W_16_Diestsepoort_451873774_A = 451873774; @@ -1398,8 +1267,7 @@ public void bus601_600_3_Test() { W_21_Diestsepoort_584356745_A, W_24_Diestsepoort_61556877_D, W_20_Diestsepoort_198559166_E, "Diestsepoort", null, - "2;3;179;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658" - ); + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"); final int W_15_Diestsepoort_116797180_B = 116797180; final int W_14_Diestsepoort_23691157_A = 23691157; @@ -1410,8 +1278,7 @@ public void bus601_600_3_Test() { W_16_Diestsepoort_451873774_A, W_20_Diestsepoort_198559166_E, W_15_Diestsepoort_116797180_B, "Diestsepoort", null, - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658" - ); + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"); final int W_13_p12_to_Diestsepoort_78815527_B = 78815527; final int W_12_perron_12_377918658_A = 377918658; @@ -1422,23 +1289,21 @@ public void bus601_600_3_Test() { W_14_Diestsepoort_23691157_A, W_15_Diestsepoort_116797180_B, W_13_p12_to_Diestsepoort_78815527_B, null, null, - "4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658" - ); + "4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658"); RouteSegmentToExtract segment163 = segment162.addPTWayMember(12); extractAndAssertValues(12, segment162, segment163, cloneOfBus600RouteRelation, W_12_perron_12_377918658_A, W_13_p12_to_Diestsepoort_78815527_B, 0, null, null, - "395;600;651;652" - ); + "395;600;651;652"); // *********************************************************** // Line 3 has the particularity that there are 2 variants // The longer version has a spoon to serve another hospital + // The following test block is for the last stretch of the shorter version // *********************************************************** - Relation bus3_GHB_Lubbeek_RouteRelation = allRelations.stream() .filter(relation -> relation.getId() == 3297543) .findFirst().orElse(null); @@ -1477,16 +1342,14 @@ public void bus601_600_3_Test() { W_191_Dorpskring_112917099_A, W_194_Dorpskring_27684829_D, W_190_Dorpskring_125835538_A, "Dorpskring", null, - "3" - ); + "3"); RouteSegmentToExtract segment203 = segment202.addPTWayMember(189); extractAndAssertValues(189, segment202, segment203, bus3_GHB_Lubbeek_RouteRelation, W_190_Dorpskring_125835538_A, W_190_Dorpskring_125835538_A, W_189_Bollenberg_81197019_Z, "Bollenberg", null, - "3;373;485" - ); + "3;373;485"); for (int n = 188; n >= 179; n--) {returnValueNull =segment203.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment204 = segment203.addPTWayMember(178); @@ -1494,8 +1357,7 @@ public void bus601_600_3_Test() { W_179_Kapelstraat_16377612_A, W_189_Bollenberg_81197019_Z, W_178_Lostraat_40189518_Z, "Lostraat", null, - "3" - ); + "3"); for (int n = 177; n >= 130; n--) {returnValueNull =segment204.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment205 = segment204.addPTWayMember(129); @@ -1503,16 +1365,14 @@ public void bus601_600_3_Test() { W_130_Oude_Diestsesteenweg_10230617_A, W_178_Lostraat_40189518_Z, W_129_Diestsesteenweg_23707243_A, "Diestsesteenweg", null, - "3" - ); + "3"); RouteSegmentToExtract segment206 = segment205.addPTWayMember(128); extractAndAssertValues(128, segment205, segment206, bus3_GHB_Lubbeek_RouteRelation, W_129_Diestsesteenweg_23707243_A, W_129_Diestsesteenweg_23707243_A, W_128_Diestsesteenweg_23707244_B, "Diestsesteenweg", null, - "3;370;371;373;374;475;485;524;525" - ); + "3;370;371;373;374;475;485;524;525"); for (int n = 127; n >= 127; n--) {returnValueNull =segment206.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} RouteSegmentToExtract segment207 = segment206.addPTWayMember(126); @@ -1520,8 +1380,865 @@ public void bus601_600_3_Test() { W_127_Diestsesteenweg_12715116_A, W_128_Diestsesteenweg_23707244_B, W_126_Diestsepoort_61556877_D, "Diestsepoort", null, - "2;3;179;306 (student);310;370;371;373;374;433;475;485;520;524;525" - ); + "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"); + + // *********************************************************** + // Line 3 has the particularity that there are 2 variants + // The longer version has a spoon to serve another hospital + // This is testing the longer version completely + // *********************************************************** + + Relation bus3_GHB_Pellenberg_Lubbeek_RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 2815) + .findFirst().orElse(null); + + assertNotNull(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); + RouteSegmentToExtract segment301 = new RouteSegmentToExtract(bus3_GHB_Pellenberg_Lubbeek_RouteRelation, ds); + assertEquals(bus3_GHB_Pellenberg_Lubbeek_RouteRelation.get("ref"), segment301.getLineIdentifiersSignature()); + assertEquals(bus3_GHB_Pellenberg_Lubbeek_RouteRelation.get("colour"), segment301.getColoursSignature()); + + assertNull(segment301.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment301.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment301.getWayMembers()); + + final int W_217_Dorpskring_27684829_D = 27684829; + final int W_214_Dorpskring_112917099_A = 112917099; + + final int W_213_Dorpskring_125835538_A = 125835538; + + final int W_212_Bollenberg_81197019_Z = 81197019; + final int W_202_Kapelstraat_16377612_A = 16377612; + + final int W_201_Ganzendries_112917224_F = 112917224; + final int W_196__847554912_A = 847554912; + + final int W_195__27686453_G = 27686453; + final int W_189__112917225_A = 112917225; + + final int W_188__847554912_F = 847554912; + final int W_183_Ganzendries_112917224_A = 112917224; + + final int W_182_Lostraat_40189518_Z = 40189518; + final int W_134_Oude_Diestsesteenweg_10230617_A = 10230617; + + final int W_133_Diestsesteenweg_23707243_A = 23707243; + + final int W_132_Diestsesteenweg_23707244_B = 23707244; + final int W_131_Diestsesteenweg_12715116_A = 12715116; + + final int W_130_Diestsepoort_61556877_D = 61556877; + final int W_127_Diestsepoort_584356745_A = 584356745; + + final int W_126_Diestsepoort_198559166_E = 198559166; + final int W_122_Diestsepoort_451873774_A = 451873774; + + final int W_121__76867049_C = 76867049; + final int W_119__79596965_A = 79596965; + + final int W_118__79596974_B = 79596974; + final int W_117__79596982_A = 79596982; + + final int W_116__79596987_C = 79596987; + final int W_114__79596980_A = 79596980; + + final int W_113_Tiensevest_79193579_A = 79193579; + + final int W_112_Tiensevest_258936980_A = 258936980; + + final int W_111_Tiensevest_79193580_A = 79193580; + + final int W_110_Tiensevest_79193581_A = 79193581; + + final int W_109_Tiensevest_78815505_A = 78815505; + + final int W_108_Tiensevest_84696751_B = 84696751; + final int W_107_Tiensevest_79265237_A = 79265237; + + final int W_106_Tiensevest_89574079_B = 89574079; + final int W_105_Tiensevest_81522744_A = 81522744; + + final int W_104_Bondgenotenlaan_305434579_H = 305434579; + final int W_97_Rector_De_Somerplein_521211977_A = 521211977; + + final int W_96_Rector_De_Somerplein_521211976_B = 521211976; + final int W_95_Rector_De_Somerplein_16771741_A = 16771741; + + final int W_94_Margarethaplein_3991635_M = 3991635; + final int W_82_Brouwersstraat_284664268_A = 284664268; + + final int W_81_Brouwersstraat_608715545_E = 608715545; + final int W_77_Brouwersstraat_284664272_A = 284664272; + + final int W_76_Tessenstraat___Fonteinstraat_147856945_B = 147856945; + final int W_75_Kapucijnenvoer_123929547_A = 123929547; + + final int W_74_Biezenstraat_3358673_E = 3358673; + final int W_70_Sint_Hubertusstraat_123929615_A = 123929615; + + final int W_69_Monseigneur_Van_Waeyenberghlaan_189453003_G = 189453003; + final int W_63_Monseigneur_Van_Waeyenberghlaan_249333181_A = 249333181; + + final int W_62_Rotonde_Het_Teken_249333187_A = 249333187; + final int W_61_Rotonde_Het_Teken_813970230_B = 813970230; + + final int W_60_Rotonde_Het_Teken_41403540_A = 41403540; + final int W_59_Rotonde_Het_Teken_41403538_B = 41403538; + + final int W_58_Ring_Zuid_79340950_A = 79340950; + + final int W_57_Ring_Zuid_11369123_A = 11369123; + + final int W_56__159949154_A = 159949154; + + final int W_55__332258104_B = 332258104; + final int W_54__78852604_A = 78852604; + + final int W_53__14508735_A = 14508735; + + final int W_52__109267438_A = 109267438; + + final int W_51__318878532_A = 318878532; + + final int W_50__100687528_A = 100687528; + + final int W_49_Ring_Zuid_14508739_A = 14508739; + + final int W_48_Ring_Zuid_14508740_A = 14508740; + + final int W_47_Ring_Zuid_502328838_D = 502328838; + final int W_44_Rotonde_Het_Teken_78568660_A = 78568660; + + final int W_43_Ring_Noord_15945426_G = 15945426; + final int W_37_Ring_Noord_377918625_A = 377918625; + + for (int n = 217; n >= 214; n--) {returnValueNull =segment301.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment302 = segment301.addPTWayMember(213); + extractAndAssertValues(213, segment301, segment302, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_214_Dorpskring_112917099_A, W_217_Dorpskring_27684829_D, + W_213_Dorpskring_125835538_A, "Dorpskring", + null, + "3"); + + RouteSegmentToExtract segment303 = segment302.addPTWayMember(212); + extractAndAssertValues(212, segment302, segment303, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_213_Dorpskring_125835538_A, W_213_Dorpskring_125835538_A, + W_212_Bollenberg_81197019_Z, "Bollenberg", + null, + "3;373;485"); + + for (int n = 211; n >= 202; n--) {returnValueNull =segment303.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment304 = segment303.addPTWayMember(201); + extractAndAssertValues(201, segment303, segment304, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_202_Kapelstraat_16377612_A, W_212_Bollenberg_81197019_Z, + W_201_Ganzendries_112917224_F, "Ganzendries", + null, + "3"); + + for (int n = 200; n >= 196; n--) {returnValueNull =segment304.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment305 = segment304.addPTWayMember(195); + extractAndAssertValues(195, segment304, segment305, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_196__847554912_A, W_201_Ganzendries_112917224_F, + W_195__27686453_G, null, + null, + "3"); + + for (int n = 194; n >= 189; n--) {returnValueNull =segment305.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment306 = segment305.addPTWayMember(188); + extractAndAssertValues(188, segment305, segment306, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_189__112917225_A, W_195__27686453_G, + W_188__847554912_F, null, + null, + "3"); + + for (int n = 187; n >= 183; n--) {returnValueNull =segment306.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment307 = segment306.addPTWayMember(182); + extractAndAssertValues(182, segment306, segment307, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_183_Ganzendries_112917224_A, W_188__847554912_F, + W_182_Lostraat_40189518_Z, "Lostraat", + null, + "3"); + + for (int n = 181; n >= 134; n--) {returnValueNull =segment307.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment308 = segment307.addPTWayMember(133); + extractAndAssertValues(133, segment307, segment308, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_134_Oude_Diestsesteenweg_10230617_A, W_182_Lostraat_40189518_Z, + W_133_Diestsesteenweg_23707243_A, "Diestsesteenweg", + null, + "3"); + + RouteSegmentToExtract segment309 = segment308.addPTWayMember(132); + extractAndAssertValues(132, segment308, segment309, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_133_Diestsesteenweg_23707243_A, W_133_Diestsesteenweg_23707243_A, + W_132_Diestsesteenweg_23707244_B, "Diestsesteenweg", + null, + "3;370;371;373;374;475;485;524;525"); + + for (int n = 131; n >= 131; n--) {returnValueNull =segment309.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment310 = segment309.addPTWayMember(130); + extractAndAssertValues(130, segment309, segment310, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_131_Diestsesteenweg_12715116_A, W_132_Diestsesteenweg_23707244_B, + W_130_Diestsepoort_61556877_D, "Diestsepoort", + null, + "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"); + + for (int n = 129; n >= 127; n--) {returnValueNull =segment310.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment311 = segment310.addPTWayMember(126); + extractAndAssertValues(126, segment310, segment311, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_127_Diestsepoort_584356745_A, W_130_Diestsepoort_61556877_D, + W_126_Diestsepoort_198559166_E, "Diestsepoort", + null, + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"); + + for (int n = 125; n >= 122; n--) {returnValueNull =segment311.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment312 = segment311.addPTWayMember(121); + extractAndAssertValues(121, segment311, segment312, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_122_Diestsepoort_451873774_A, W_126_Diestsepoort_198559166_E, + W_121__76867049_C, null, + null, + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"); + + for (int n = 120; n >= 119; n--) {returnValueNull =segment312.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment313 = segment312.addPTWayMember(118); + extractAndAssertValues(118, segment312, segment313, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_119__79596965_A, W_121__76867049_C, + W_118__79596974_B, null, + null, + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"); + + for (int n = 117; n >= 117; n--) {returnValueNull =segment313.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment314 = segment313.addPTWayMember(116); + extractAndAssertValues(116, segment313, segment314, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_117__79596982_A, W_118__79596974_B, + W_116__79596987_C, null, + null, + "3;333;334;335;433;600;630"); + + for (int n = 115; n >= 114; n--) {returnValueNull =segment314.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment315 = segment314.addPTWayMember(113); + extractAndAssertValues(113, segment314, segment315, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_114__79596980_A, W_116__79596987_C, + W_113_Tiensevest_79193579_A, "Tiensevest", + null, + "3;333;334;335;513;600;630"); + + RouteSegmentToExtract segment316 = segment315.addPTWayMember(112); + extractAndAssertValues(112, segment315, segment316, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_113_Tiensevest_79193579_A, W_113_Tiensevest_79193579_A, + W_112_Tiensevest_258936980_A, "Tiensevest", + null, + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"); + + RouteSegmentToExtract segment317 = segment316.addPTWayMember(111); + extractAndAssertValues(111, segment316, segment317, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_112_Tiensevest_258936980_A, W_112_Tiensevest_258936980_A, + W_111_Tiensevest_79193580_A, "Tiensevest", + null, + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"); + + RouteSegmentToExtract segment318 = segment317.addPTWayMember(110); + extractAndAssertValues(110, segment317, segment318, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_111_Tiensevest_79193580_A, W_111_Tiensevest_79193580_A, + W_110_Tiensevest_79193581_A, "Tiensevest", + null, + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); + + RouteSegmentToExtract segment319 = segment318.addPTWayMember(109); + extractAndAssertValues(109, segment318, segment319, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_110_Tiensevest_79193581_A, W_110_Tiensevest_79193581_A, + W_109_Tiensevest_78815505_A, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); + + RouteSegmentToExtract segment320 = segment319.addPTWayMember(108); + extractAndAssertValues(108, segment319, segment320, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_109_Tiensevest_78815505_A, W_109_Tiensevest_78815505_A, + W_108_Tiensevest_84696751_B, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); + + for (int n = 107; n >= 107; n--) {returnValueNull =segment320.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment321 = segment320.addPTWayMember(106); + extractAndAssertValues(106, segment320, segment321, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_107_Tiensevest_79265237_A, W_108_Tiensevest_84696751_B, + W_106_Tiensevest_89574079_B, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"); + + for (int n = 105; n >= 105; n--) {returnValueNull =segment321.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment322 = segment321.addPTWayMember(104); + extractAndAssertValues(104, segment321, segment322, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_105_Tiensevest_81522744_A, W_106_Tiensevest_89574079_B, + W_104_Bondgenotenlaan_305434579_H, "Bondgenotenlaan", + null, + "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"); + + for (int n = 103; n >= 97; n--) {returnValueNull =segment322.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment323 = segment322.addPTWayMember(96); + extractAndAssertValues(96, segment322, segment323, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_97_Rector_De_Somerplein_521211977_A, W_104_Bondgenotenlaan_305434579_H, + W_96_Rector_De_Somerplein_521211976_B, "Rector De Somerplein", + null, + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"); + + for (int n = 95; n >= 95; n--) {returnValueNull =segment323.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment324 = segment323.addPTWayMember(94); + extractAndAssertValues(94, segment323, segment324, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_95_Rector_De_Somerplein_16771741_A, W_96_Rector_De_Somerplein_521211976_B, + W_94_Margarethaplein_3991635_M, "Margarethaplein", + null, + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"); + + for (int n = 93; n >= 82; n--) {returnValueNull =segment324.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment325 = segment324.addPTWayMember(81); + extractAndAssertValues(81, segment324, segment325, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_82_Brouwersstraat_284664268_A, W_94_Margarethaplein_3991635_M, + W_81_Brouwersstraat_608715545_E, "Brouwersstraat", + null, + "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"); + + for (int n = 80; n >= 77; n--) {returnValueNull =segment325.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment326 = segment325.addPTWayMember(76); + extractAndAssertValues(76, segment325, segment326, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_77_Brouwersstraat_284664272_A, W_81_Brouwersstraat_608715545_E, + W_76_Tessenstraat___Fonteinstraat_147856945_B, "Tessenstraat - Fonteinstraat", + null, + "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"); + + for (int n = 75; n >= 75; n--) {returnValueNull =segment326.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment327 = segment326.addPTWayMember(74); + extractAndAssertValues(74, segment326, segment327, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_75_Kapucijnenvoer_123929547_A, W_76_Tessenstraat___Fonteinstraat_147856945_B, + W_74_Biezenstraat_3358673_E, "Biezenstraat", + null, + "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"); + + for (int n = 73; n >= 70; n--) {returnValueNull =segment327.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment328 = segment327.addPTWayMember(69); + extractAndAssertValues(69, segment327, segment328, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_70_Sint_Hubertusstraat_123929615_A, W_74_Biezenstraat_3358673_E, + W_69_Monseigneur_Van_Waeyenberghlaan_189453003_G, "Monseigneur Van Waeyenberghlaan", + null, + "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513"); + + for (int n = 68; n >= 63; n--) {returnValueNull =segment328.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment329 = segment328.addPTWayMember(62); + extractAndAssertValues(62, segment328, segment329, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_63_Monseigneur_Van_Waeyenberghlaan_249333181_A, W_69_Monseigneur_Van_Waeyenberghlaan_189453003_G, + W_62_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;513"); + + RouteSegmentToExtract segment330 = segment329.addPTWayMember(61); + extractAndAssertValues(61, segment329, segment330, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_62_Rotonde_Het_Teken_249333187_A, W_62_Rotonde_Het_Teken_249333187_A, + W_61_Rotonde_Het_Teken_813970230_B, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + for (int n = 60; n >= 60; n--) {returnValueNull =segment330.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment331 = segment330.addPTWayMember(59); + extractAndAssertValues(59, segment330, segment331, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_60_Rotonde_Het_Teken_41403540_A, W_61_Rotonde_Het_Teken_813970230_B, + W_59_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;513"); + + for (int n = 58; n >= 58; n--) {returnValueNull =segment331.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment332 = segment331.addPTWayMember(57); + extractAndAssertValues(57, segment331, segment332, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_58_Ring_Zuid_79340950_A, W_59_Rotonde_Het_Teken_41403538_B, + W_57_Ring_Zuid_11369123_A, "Ring Zuid", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + RouteSegmentToExtract segment333 = segment332.addPTWayMember(56); + extractAndAssertValues(56, segment332, segment333, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_57_Ring_Zuid_11369123_A, W_57_Ring_Zuid_11369123_A, + W_56__159949154_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + RouteSegmentToExtract segment334 = segment333.addPTWayMember(55); + extractAndAssertValues(55, segment333, segment334, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_56__159949154_A, W_56__159949154_A, + W_55__332258104_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + for (int n = 54; n >= 54; n--) {returnValueNull =segment334.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment335 = segment334.addPTWayMember(53); + extractAndAssertValues(53, segment334, segment335, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_54__78852604_A, W_55__332258104_B, + W_53__14508735_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + RouteSegmentToExtract segment336 = segment335.addPTWayMember(52); + extractAndAssertValues(52, segment335, segment336, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_53__14508735_A, W_53__14508735_A, + W_52__109267438_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600"); + + RouteSegmentToExtract segment337 = segment336.addPTWayMember(51); + extractAndAssertValues(51, segment336, segment337, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_52__109267438_A, W_52__109267438_A, + W_51__318878532_A, null, + null, + "3;333;334;335;370;371;373;374;380;513"); + + RouteSegmentToExtract segment338 = segment337.addPTWayMember(50); + extractAndAssertValues(50, segment337, segment338, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_51__318878532_A, W_51__318878532_A, + W_50__100687528_A, null, + null, + "3;333;334;335;513"); + + RouteSegmentToExtract segment339 = segment338.addPTWayMember(49); + extractAndAssertValues(49, segment338, segment339, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_50__100687528_A, W_50__100687528_A, + W_49_Ring_Zuid_14508739_A, "Ring Zuid", + null, + "3;334;335"); + + RouteSegmentToExtract segment340 = segment339.addPTWayMember(48); + extractAndAssertValues(48, segment339, segment340, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_49_Ring_Zuid_14508739_A, W_49_Ring_Zuid_14508739_A, + W_48_Ring_Zuid_14508740_A, "Ring Zuid", + null, + "3;317;334;335;395;410;600;601"); + + RouteSegmentToExtract segment341 = segment340.addPTWayMember(47); + extractAndAssertValues(47, segment340, segment341, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_48_Ring_Zuid_14508740_A, W_48_Ring_Zuid_14508740_A, + W_47_Ring_Zuid_502328838_D, "Ring Zuid", + null, + "3;317;334;335;380;395;410;600;601"); + + for (int n = 46; n >= 44; n--) {returnValueNull =segment341.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment342 = segment341.addPTWayMember(43); + extractAndAssertValues(43, segment341, segment342, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_44_Rotonde_Het_Teken_78568660_A, W_47_Ring_Zuid_502328838_D, + W_43_Ring_Noord_15945426_G, "Ring Noord", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); + + for (int n = 42; n >= 37; n--) {returnValueNull =segment342.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment343 = segment342.addPTWayMember(36); + extractAndAssertValues(36, segment342, segment343, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, + W_37_Ring_Noord_377918625_A, W_43_Ring_Noord_15945426_G, + 0, null, + null, + "3"); + + // *********************************************************** + // Line 3 has the particularity that there are 2 variants + // The longer version has a spoon to serve another hospital + // This is testing the longer version completely + // From Lubbeek, over Pellenberg to Leuven Gasthuisberg + // *********************************************************** + + Relation bus3_Lubbeek_Pellenberg_GHB_RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 1583303) + .findFirst().orElse(null); + + assertNotNull(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); + RouteSegmentToExtract segment401 = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation, ds); + assertEquals(bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("ref"), segment401.getLineIdentifiersSignature()); + assertEquals(bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("colour"), segment401.getColoursSignature()); + + assertNull(segment401.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment401.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment401.getWayMembers()); + final int W_221_Ring_Noord_377918626_I = 377918626; + final int W_213_Ring_Noord_112917239_A = 112917239; + final int W_212_Rotonde_Het_Teken_3752557_A = 3752557; + final int W_211_Rotonde_Het_Teken_249333188_A = 249333188; + final int W_210_Rotonde_Het_Teken_249333187_A = 249333187; + final int W_209_Rotonde_Het_Teken_813970230_B = 813970230; + final int W_208_Rotonde_Het_Teken_41403540_A = 41403540; + final int W_207_Rotonde_Het_Teken_41403538_B = 41403538; + final int W_206_Ring_Zuid_79340950_A = 79340950; + final int W_205_Ring_Zuid_11369123_A = 11369123; + final int W_204__159949154_A = 159949154; + final int W_203__332258104_B = 332258104; + final int W_202__78852604_A = 78852604; + final int W_201__377918641_B = 377918641; + final int W_200__14508736_A = 14508736; + final int W_199_Ring_Zuid_109267436_A = 109267436; + final int W_198_Ring_Zuid_14508739_A = 14508739; + final int W_197_Ring_Zuid_14508740_A = 14508740; + final int W_196_Ring_Zuid_502328838_D = 502328838; + final int W_193_Rotonde_Het_Teken_78568660_A = 78568660; + final int W_192_Rotonde_Het_Teken_78873921_A = 78873921; + final int W_191_Rotonde_Het_Teken_3752557_A = 3752557; + final int W_190_Monseigneur_Van_Waeyenberghlaan_249333183_G = 249333183; + final int W_184_Monseigneur_Van_Waeyenberghlaan_189453003_A = 189453003; + final int W_183_Sint_Hubertusstraat_123929615_E = 123929615; + final int W_179_Biezenstraat_3358673_A = 3358673; + final int W_178_Kapucijnenvoer_123929547_B = 123929547; + final int W_177_Tessenstraat___Fonteinstraat_147856945_A = 147856945; + final int W_176_Brouwersstraat_284664272_E = 284664272; + final int W_172_Brouwersstraat_608715545_A = 608715545; + final int W_171_Brouwersstraat_284664268_M = 284664268; + final int W_159_Margarethaplein_3991635_A = 3991635; + final int W_158_Rector_De_Somerplein_16771741_J = 16771741; + final int W_149_Bondgenotenlaan_305434579_A = 305434579; + final int W_148_Tiensevest_81522744_B = 81522744; + final int W_147_Tiensevest_89574079_A = 89574079; + final int W_146_Tiensevest_79265237_A = 79265237; + final int W_145_Tiensevest_79211473_A = 79211473; + final int W_144__79605527_F = 79605527; + final int W_139__79596971_A = 79596971; + final int W_138__377918635_A = 377918635; + final int W_137__79264888_A = 79264888; + final int W_136__79264897_B = 79264897; + final int W_135__71754927_A = 71754927; + final int W_134__79596965_C = 79596965; + final int W_132__76867049_A = 76867049; + final int W_131_Diestsepoort_451873774_B = 451873774; + final int W_130_Diestsepoort_584356742_A = 584356742; + final int W_129_Diestsepoort_451873773_G = 451873773; + final int W_123_Diestsepoort_61556877_A = 61556877; + final int W_122_Diestsepoort_8109264_C = 8109264; + final int W_120_Diestsesteenweg_23707244_A = 23707244; + final int W_119_Diestsesteenweg_23707243_A = 23707243; + final int W_118_Oude_Diestsesteenweg_10230617_Z = 10230617; + final int W_70_Lostraat_40189518_A = 40189518; + final int W_69_Ganzendries_112917224_F = 112917224; + final int W_64__847554912_A = 847554912; + final int W_63__27686453_G = 27686453; + final int W_57_Sint_Barbaradreef_112917225_A = 112917225; + final int W_56__847554912_F = 847554912; + final int W_51_Ganzendries_112917224_A = 112917224; + final int W_50_Kapelstraat_16377612_K = 16377612; + final int W_40_Bollenberg_81197019_A = 81197019; + final int W_39_Dorpskring_125835541_A = 125835541; + final int W_38_Dorpskring_81083332_C = 81083332; + final int W_37_Dorpskring_125835543_B = 125835543; + final int W_36_Dorpskring_608754701_A = 608754701; + + for (int n = 221; n >= 213; n--) {returnValueNull =segment401.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment402 = segment401.addPTWayMember(212); + extractAndAssertValues(212, segment401, segment402, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_213_Ring_Noord_112917239_A, W_221_Ring_Noord_377918626_I, + W_212_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", + null, + "3"); + + RouteSegmentToExtract segment403 = segment402.addPTWayMember(211); + extractAndAssertValues(211, segment402, segment403, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_212_Rotonde_Het_Teken_3752557_A, W_212_Rotonde_Het_Teken_3752557_A, + W_211_Rotonde_Het_Teken_249333188_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); + + RouteSegmentToExtract segment404 = segment403.addPTWayMember(210); + extractAndAssertValues(210, segment403, segment404, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_211_Rotonde_Het_Teken_249333188_A, W_211_Rotonde_Het_Teken_249333188_A, + W_210_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", + null, + "3;410;600;601"); + + RouteSegmentToExtract segment405 = segment404.addPTWayMember(209); + extractAndAssertValues(209, segment404, segment405, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_210_Rotonde_Het_Teken_249333187_A, W_210_Rotonde_Het_Teken_249333187_A, + W_209_Rotonde_Het_Teken_813970230_B, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + for (int n = 208; n >= 208; n--) {returnValueNull =segment405.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment406 = segment405.addPTWayMember(207); + extractAndAssertValues(207, segment405, segment406, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_208_Rotonde_Het_Teken_41403540_A, W_209_Rotonde_Het_Teken_813970230_B, + W_207_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;513"); + + for (int n = 206; n >= 206; n--) {returnValueNull =segment406.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment407 = segment406.addPTWayMember(205); + extractAndAssertValues(205, segment406, segment407, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_206_Ring_Zuid_79340950_A, W_207_Rotonde_Het_Teken_41403538_B, + W_205_Ring_Zuid_11369123_A, "Ring Zuid", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + RouteSegmentToExtract segment408 = segment407.addPTWayMember(204); + extractAndAssertValues(204, segment407, segment408, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_205_Ring_Zuid_11369123_A, W_205_Ring_Zuid_11369123_A, + W_204__159949154_A, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + RouteSegmentToExtract segment409 = segment408.addPTWayMember(203); + extractAndAssertValues(203, segment408, segment409, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_204__159949154_A, W_204__159949154_A, + W_203__332258104_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + for (int n = 202; n >= 202; n--) {returnValueNull =segment409.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment410 = segment409.addPTWayMember(201); + extractAndAssertValues(201, segment409, segment410, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_202__78852604_A, W_203__332258104_B, + W_201__377918641_B, null, + null, + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); + + for (int n = 200; n >= 200; n--) {returnValueNull =segment410.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment411 = segment410.addPTWayMember(199); + extractAndAssertValues(199, segment410, segment411, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_200__14508736_A, W_201__377918641_B, + W_199_Ring_Zuid_109267436_A, "Ring Zuid", + null, + "3;317;395;410;601"); + + RouteSegmentToExtract segment412 = segment411.addPTWayMember(198); + extractAndAssertValues(198, segment411, segment412, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_199_Ring_Zuid_109267436_A, W_199_Ring_Zuid_109267436_A, + W_198_Ring_Zuid_14508739_A, "Ring Zuid", + null, + "3;317;395;410;600;601"); + + RouteSegmentToExtract segment413 = segment412.addPTWayMember(197); + extractAndAssertValues(197, segment412, segment413, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_198_Ring_Zuid_14508739_A, W_198_Ring_Zuid_14508739_A, + W_197_Ring_Zuid_14508740_A, "Ring Zuid", + null, + "3;317;334;335;395;410;600;601"); + + RouteSegmentToExtract segment414 = segment413.addPTWayMember(196); + extractAndAssertValues(196, segment413, segment414, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_197_Ring_Zuid_14508740_A, W_197_Ring_Zuid_14508740_A, + W_196_Ring_Zuid_502328838_D, "Ring Zuid", + null, + "3;317;334;335;380;395;410;600;601"); + + for (int n = 195; n >= 193; n--) {returnValueNull =segment414.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment415 = segment414.addPTWayMember(192); + extractAndAssertValues(192, segment414, segment415, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_193_Rotonde_Het_Teken_78568660_A, W_196_Ring_Zuid_502328838_D, + W_192_Rotonde_Het_Teken_78873921_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); + + RouteSegmentToExtract segment416 = segment415.addPTWayMember(191); + extractAndAssertValues(191, segment415, segment416, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_192_Rotonde_Het_Teken_78873921_A, W_192_Rotonde_Het_Teken_78873921_A, + W_191_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); + + RouteSegmentToExtract segment417 = segment416.addPTWayMember(190); + extractAndAssertValues(190, segment416, segment417, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_191_Rotonde_Het_Teken_3752557_A, W_191_Rotonde_Het_Teken_3752557_A, + W_190_Monseigneur_Van_Waeyenberghlaan_249333183_G, "Monseigneur Van Waeyenberghlaan", + null, + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); + + for (int n = 189; n >= 184; n--) {returnValueNull =segment417.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment418 = segment417.addPTWayMember(183); + extractAndAssertValues(183, segment417, segment418, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_184_Monseigneur_Van_Waeyenberghlaan_189453003_A, W_190_Monseigneur_Van_Waeyenberghlaan_249333183_G, + W_183_Sint_Hubertusstraat_123929615_E, "Sint-Hubertusstraat", + null, + "3;317;333;334;335;370;371;373;374;380;395"); + + for (int n = 182; n >= 179; n--) {returnValueNull =segment418.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment419 = segment418.addPTWayMember(178); + extractAndAssertValues(178, segment418, segment419, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_179_Biezenstraat_3358673_A, W_183_Sint_Hubertusstraat_123929615_E, + W_178_Kapucijnenvoer_123929547_B, "Kapucijnenvoer", + null, + "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395"); + + for (int n = 177; n >= 177; n--) {returnValueNull =segment419.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment420 = segment419.addPTWayMember(176); + extractAndAssertValues(176, segment419, segment420, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_177_Tessenstraat___Fonteinstraat_147856945_A, W_178_Kapucijnenvoer_123929547_B, + W_176_Brouwersstraat_284664272_E, "Brouwersstraat", + null, + "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"); + + for (int n = 175; n >= 172; n--) {returnValueNull =segment420.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment421 = segment420.addPTWayMember(171); + extractAndAssertValues(171, segment420, segment421, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_172_Brouwersstraat_608715545_A, W_176_Brouwersstraat_284664272_E, + W_171_Brouwersstraat_284664268_M, "Brouwersstraat", + null, + "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"); + + for (int n = 170; n >= 159; n--) {returnValueNull =segment421.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment422 = segment421.addPTWayMember(158); + extractAndAssertValues(158, segment421, segment422, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_159_Margarethaplein_3991635_A, W_171_Brouwersstraat_284664268_M, + W_158_Rector_De_Somerplein_16771741_J, "Rector De Somerplein", + null, + "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"); + + for (int n = 157; n >= 149; n--) {returnValueNull =segment422.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment423 = segment422.addPTWayMember(148); + extractAndAssertValues(148, segment422, segment423, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_149_Bondgenotenlaan_305434579_A, W_158_Rector_De_Somerplein_16771741_J, + W_148_Tiensevest_81522744_B, "Tiensevest", + null, + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586"); + + for (int n = 147; n >= 147; n--) {returnValueNull =segment423.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment424 = segment423.addPTWayMember(146); + extractAndAssertValues(146, segment423, segment424, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_147_Tiensevest_89574079_A, W_148_Tiensevest_81522744_B, + W_146_Tiensevest_79265237_A, "Tiensevest", + null, + "1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586;616"); + + RouteSegmentToExtract segment425 = segment424.addPTWayMember(145); + extractAndAssertValues(145, segment424, segment425, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_146_Tiensevest_79265237_A, W_146_Tiensevest_79265237_A, + W_145_Tiensevest_79211473_A, "Tiensevest", + null, + "1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586;616"); + + RouteSegmentToExtract segment426 = segment425.addPTWayMember(144); + extractAndAssertValues(144, segment425, segment426, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_145_Tiensevest_79211473_A, W_145_Tiensevest_79211473_A, + W_144__79605527_F, null, + null, + "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"); + + for (int n = 143; n >= 139; n--) {returnValueNull =segment426.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment428 = segment426.addPTWayMember(138); + extractAndAssertValues(138, segment426, segment428, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_139__79596971_A, W_144__79605527_F, + W_138__377918635_A, null, + null, + "3;4;5;6;7;8;9"); + + RouteSegmentToExtract segment429 = segment428.addPTWayMember(137); + extractAndAssertValues(137, segment428, segment429, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_138__377918635_A, W_138__377918635_A, + W_137__79264888_A, null, + null, + "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"); + + RouteSegmentToExtract segment430 = segment429.addPTWayMember(136); + extractAndAssertValues(136, segment429, segment430, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_137__79264888_A, W_137__79264888_A, + W_136__79264897_B, null, + null, + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"); + + for (int n = 135; n >= 135; n--) {returnValueNull =segment430.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment432 = segment430.addPTWayMember(134); + extractAndAssertValues(134, segment430, segment432, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_135__71754927_A, W_136__79264897_B, + W_134__79596965_C, null, + null, + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"); + + for (int n = 133; n >= 132; n--) {returnValueNull =segment432.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment433 = segment432.addPTWayMember(131); + extractAndAssertValues(131, segment432, segment433, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_132__76867049_A, W_134__79596965_C, + W_131_Diestsepoort_451873774_B, "Diestsepoort", + null, + "2;3;4;5;6;7;8;9;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525"); + + for (int n = 130; n >= 130; n--) {returnValueNull =segment433.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment434 = segment433.addPTWayMember(129); + extractAndAssertValues(129, segment433, segment434, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_130_Diestsepoort_584356742_A, W_131_Diestsepoort_451873774_B, + W_129_Diestsepoort_451873773_G, "Diestsepoort", + null, + "2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525"); + + for (int n = 128; n >= 123; n--) {returnValueNull =segment434.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment436 = segment434.addPTWayMember(122); + extractAndAssertValues(122, segment434, segment436, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_123_Diestsepoort_61556877_A, W_129_Diestsepoort_451873773_G, + W_122_Diestsepoort_8109264_C, "Diestsepoort", + null, + "2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"); + + for (int n = 121; n >= 120; n--) {returnValueNull =segment436.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment437 = segment436.addPTWayMember(119); + extractAndAssertValues(119, segment436, segment437, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_120_Diestsesteenweg_23707244_A, W_122_Diestsepoort_8109264_C, + W_119_Diestsesteenweg_23707243_A, "Diestsesteenweg", + null, + "2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"); + + RouteSegmentToExtract segment438 = segment437.addPTWayMember(118); + extractAndAssertValues(118, segment437, segment438, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_119_Diestsesteenweg_23707243_A, W_119_Diestsesteenweg_23707243_A, + W_118_Oude_Diestsesteenweg_10230617_Z, "Oude Diestsesteenweg", + null, + "3;370;371;373;374;475;485;524;525"); + + for (int n = 117; n >= 70; n--) {returnValueNull =segment438.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment439 = segment438.addPTWayMember(69); + extractAndAssertValues(69, segment438, segment439, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_70_Lostraat_40189518_A, W_118_Oude_Diestsesteenweg_10230617_Z, + W_69_Ganzendries_112917224_F, "Ganzendries", + null, + "3"); + + for (int n = 68; n >= 64; n--) {returnValueNull =segment439.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment440 = segment439.addPTWayMember(63); + extractAndAssertValues(63, segment439, segment440, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_64__847554912_A, W_69_Ganzendries_112917224_F, + W_63__27686453_G, null, + null, + "3"); + + for (int n = 62; n >= 57; n--) {returnValueNull =segment440.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment441 = segment440.addPTWayMember(56); + extractAndAssertValues(56, segment440, segment441, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_57_Sint_Barbaradreef_112917225_A, W_63__27686453_G, + W_56__847554912_F, null, + null, + "3"); + + for (int n = 55; n >= 51; n--) {returnValueNull =segment441.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment442 = segment441.addPTWayMember(50); + extractAndAssertValues(50, segment441, segment442, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_51_Ganzendries_112917224_A, W_56__847554912_F, + W_50_Kapelstraat_16377612_K, "Kapelstraat", + null, + "3"); + + for (int n = 49; n >= 40; n--) {returnValueNull =segment442.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment443 = segment442.addPTWayMember(39); + extractAndAssertValues(39, segment442, segment443, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_40_Bollenberg_81197019_A, W_50_Kapelstraat_16377612_K, + W_39_Dorpskring_125835541_A, "Dorpskring", + null, + "3"); + + RouteSegmentToExtract segment444 = segment443.addPTWayMember(38); + extractAndAssertValues(38, segment443, segment444, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_39_Dorpskring_125835541_A, W_39_Dorpskring_125835541_A, + W_38_Dorpskring_81083332_C, "Dorpskring", + null, + "3;373;485"); + + // todo This is not the behaviour I wanted. It shouldn't actually split at index 36 + for (int n = 37; n >= 37; n--) {returnValueNull =segment444.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} + RouteSegmentToExtract segment445 = segment444.addPTWayMember(36); + extractAndAssertValues(36, segment444, segment445, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_37_Dorpskring_125835543_B, W_38_Dorpskring_81083332_C, + W_36_Dorpskring_608754701_A, "Dorpskring", + null, + "3;373;485"); + + RouteSegmentToExtract segment446 = segment445.addPTWayMember(35); + extractAndAssertValues(35, segment445, segment446, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, + W_36_Dorpskring_608754701_A, W_36_Dorpskring_608754701_A, + 0, null, + null, + "3;373;485"); } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, @@ -1533,7 +2250,8 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS assertEquals(String.format("%d first way not correct %s%s\n%s%s\n", index, rc, firstWayId, rc, extractedRelation.firstMember().getWay().getId()), firstWayId, extractedRelation.firstMember().getWay().getId()); assertEquals(String.format("%d last way not correct %s%s\n%s%s\n", index, rc, lastWayId, rc, extractedRelation.lastMember().getWay().getId()), lastWayId, extractedRelation.lastMember().getWay().getId()); if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); - assertEquals(expectedRouteRef, createdSegment.getLineIdentifiersSignature()); + final String actualRouteRef = createdSegment.getLineIdentifiersSignature(); + assertEquals(expectedRouteRef, actualRouteRef); assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); // newSegment should have the last way we tried to add to this segment @@ -1545,4 +2263,27 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS } return extractedRelation; } + + /** + * This creates a list of variable definitions to be used in unit tests + * + * @param relation the route relation to print a list of ways with their ids for + */ + @SuppressWarnings("unused") + public void printListOfWays(Relation relation) { + List members = relation.getMembers(); + for (int i = members.size() - 1; i >= 0; i--) { + RelationMember member = members.get(i); + if (member.isWay() && RouteUtils.isPTWay(member)) { + Way way = member.getWay(); + String id = String.valueOf(way.getId()); + String name = ""; + if (way.hasKey("name")) name = way.get("name"); + name = name.replace("-", "_"); + name = name.replace(" ", "_"); + name += "_"; + System.out.printf("final int W_%s_%s%s_ = %s;%n", i, name, id, id); + } + } + } } From 5448f8f31b54be3c8b242f7e9fd77cce0a999385 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 16 Oct 2020 17:38:34 +0200 Subject: [PATCH 38/52] Added tests for cycle route. Removed constructor that takes DataSet as a parameter and created a setter for it. It seems cleaner. --- gradle.properties | 4 +- .../data/RouteSegmentToExtract.java | 21 +- test/data/F74_F75.osm | 9575 +++++++++++++++++ .../plugins/pt_assistant/AbstractTest.java | 2 + .../data/RouteSegmentToExtractTest.java | 47 +- 5 files changed, 9627 insertions(+), 22 deletions(-) create mode 100644 test/data/F74_F75.osm diff --git a/gradle.properties b/gradle.properties index 6e49aa95..16383898 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -plugin.author=Biswesh Mohapatra , simon04, Rodion Scherbakov +plugin.author=Polyglot , simon04, Rodion Scherbakov plugin.class=org.openstreetmap.josm.plugins.pt_assistant.PTAssistantPlugin plugin.description=Provides validation and fixing for public transport route according to version 2 of the public transport schema # plugin.description=Displays stops of selected public transport routes as graph @@ -12,4 +12,4 @@ plugin.icon=images/bus.svg # Minimum JOSM version (any numeric version) plugin.main.version=15238 # JOSM version to compile against (any numeric version available for download, or the special values "tested" or "latest") -plugin.compile.version=16812 +plugin.compile.version=17201 diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index d1dc6fb2..28e728f5 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -36,6 +36,11 @@ public class RouteSegmentToExtract { private static final Map ptSegments; private static final Map> parentRelationsForSameDirectionOfTravel; private static final Map> itineraryWays; + + public void setActiveDataSet(DataSet activeDataSet) { + this.activeDataSet = activeDataSet; + } + private DataSet activeDataSet; private Relation relation; private Relation extractedRelation; @@ -89,19 +94,6 @@ public RouteSegmentToExtract(Relation relation) { addColour(relation.get("colour")); } - /** - * Constructor - * - * @param relation The route or superroute relation for which this route segment is created - * use addPTWay() to add ways one by one - * @param ds for the unit tests the dataset is the one of the file loaded - * if it's determined automatically it weirdly uses another DataSet - */ - public RouteSegmentToExtract(Relation relation, DataSet ds) { - this(relation); - activeDataSet = ds; - } - /** * Constructor for use with non PT route relations * @@ -270,7 +262,8 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } } if (startNewSegment) { - RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation, activeDataSet); + RouteSegmentToExtract newSegment = new RouteSegmentToExtract(relation); + newSegment.setActiveDataSet(activeDataSet); newSegment.addPTWayMember(index); newSegment.itinerariesInSameDirection = itinerariesInSameDirection; newSegment.populateLineIdentifierAndColourLists(); diff --git a/test/data/F74_F75.osm b/test/data/F74_F75.osm new file mode 100644 index 00000000..e5bc3b22 --- /dev/null +++ b/test/data/F74_F75.osm @@ -0,0 +1,9575 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java index 05de4d9c..ccc18814 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/AbstractTest.java @@ -67,6 +67,8 @@ public abstract class AbstractTest { public static final String PATH_TO_PT_BEFORE_SPLITTING_TEST = "test/data/buses_before_splitting.osm"; + public static final String PATH_TO_F74_F75_TEST = "test/data/F74_F75.osm"; + /** * Initiates the basic parts of JOSM. */ diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 5689a7c4..1a0d1355 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -25,6 +25,8 @@ public class RouteSegmentToExtractTest extends AbstractTest{ private static DataSet ds; private static Collection allRelations; private static Collection allWays; + private static DataSet ds2; + private static Collection allRelations2; private final static String rc = " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way"; @BeforeClass @@ -32,6 +34,8 @@ public static void init() throws FileNotFoundException, IllegalDataException { ds = parseDataSet(new FileInputStream(PATH_TO_PT_BEFORE_SPLITTING_TEST), null); allRelations = ds.getRelations(); allWays = ds.getWays(); + ds2 = parseDataSet(new FileInputStream(PATH_TO_F74_F75_TEST), null); + allRelations2 = ds2.getRelations(); } @Test @@ -65,7 +69,8 @@ public void isItineraryInSameDirectionTest() { bus371RouteRelation.getMembers().get(132).getWay(), bus371RouteRelation.getMembers().get(133).getWay(), bus371RouteRelation.getMembers().get(134).getWay()); - RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation, ds); + RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation); + segment601_1.setActiveDataSet(ds); assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358)); assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371)); @@ -145,6 +150,26 @@ public void isItineraryInSameDirectionTest() { } + @Test + public void f74_F75_Test() { + Relation f75BicycleRouteRelation = allRelations2.stream() + .filter(relation -> relation.getId() == 11021011) + .findFirst().orElse(null); + assertNotNull(f75BicycleRouteRelation); + assertEquals(30, f75BicycleRouteRelation.getMembersCount()); + + RouteSegmentToExtract s1 = new RouteSegmentToExtract( + f75BicycleRouteRelation, + Arrays.asList(23, 24, 25)); + s1.setActiveDataSet(ds2); + s1.put("state", "proposed"); + + assertEquals(3, s1.getWayMembers().size()); + Relation rel1 = s1.extractToRelation(Arrays.asList("type", "route"), true); + assertEquals(28, f75BicycleRouteRelation.getMembersCount()); + assertEquals("proposed", rel1.get("state")); + } + @Test public void bus601_600_3_Test() { Relation bus601RouteRelation = allRelations.stream() @@ -154,7 +179,9 @@ public void bus601_600_3_Test() { assertNotNull(bus601RouteRelation); Relation cloneOfBus601RouteRelation = new Relation(bus601RouteRelation); assertNotNull(cloneOfBus601RouteRelation); - RouteSegmentToExtract segment1 = new RouteSegmentToExtract(cloneOfBus601RouteRelation, ds); + RouteSegmentToExtract segment1 = new RouteSegmentToExtract(cloneOfBus601RouteRelation); + segment1.setActiveDataSet(ds); + assertEquals(cloneOfBus601RouteRelation.get("ref"), segment1.getLineIdentifiersSignature()); assertEquals(cloneOfBus601RouteRelation.get("colour"), segment1.getColoursSignature()); @@ -692,7 +719,9 @@ public void bus601_600_3_Test() { assertNotNull(bus600RouteRelation); Relation cloneOfBus600RouteRelation = new Relation(bus600RouteRelation); assertNotNull(cloneOfBus600RouteRelation); - RouteSegmentToExtract segment101 = new RouteSegmentToExtract(cloneOfBus600RouteRelation, ds); + RouteSegmentToExtract segment101 = new RouteSegmentToExtract(cloneOfBus600RouteRelation); + segment101.setActiveDataSet(ds); + assertEquals(cloneOfBus600RouteRelation.get("ref"), segment101.getLineIdentifiersSignature()); assertEquals(cloneOfBus600RouteRelation.get("colour"), segment101.getColoursSignature()); @@ -1309,7 +1338,9 @@ public void bus601_600_3_Test() { .findFirst().orElse(null); assertNotNull(bus3_GHB_Lubbeek_RouteRelation); - RouteSegmentToExtract segment201 = new RouteSegmentToExtract(bus3_GHB_Lubbeek_RouteRelation, ds); + RouteSegmentToExtract segment201 = new RouteSegmentToExtract(bus3_GHB_Lubbeek_RouteRelation); + segment201.setActiveDataSet(ds); + assertEquals(bus3_GHB_Lubbeek_RouteRelation.get("ref"), segment201.getLineIdentifiersSignature()); assertEquals(bus3_GHB_Lubbeek_RouteRelation.get("colour"), segment201.getColoursSignature()); @@ -1393,7 +1424,9 @@ public void bus601_600_3_Test() { .findFirst().orElse(null); assertNotNull(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); - RouteSegmentToExtract segment301 = new RouteSegmentToExtract(bus3_GHB_Pellenberg_Lubbeek_RouteRelation, ds); + RouteSegmentToExtract segment301 = new RouteSegmentToExtract(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); + segment301.setActiveDataSet(ds); + assertEquals(bus3_GHB_Pellenberg_Lubbeek_RouteRelation.get("ref"), segment301.getLineIdentifiersSignature()); assertEquals(bus3_GHB_Pellenberg_Lubbeek_RouteRelation.get("colour"), segment301.getColoursSignature()); @@ -1844,7 +1877,9 @@ public void bus601_600_3_Test() { .findFirst().orElse(null); assertNotNull(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); - RouteSegmentToExtract segment401 = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation, ds); + RouteSegmentToExtract segment401 = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); + segment401.setActiveDataSet(ds); + assertEquals(bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("ref"), segment401.getLineIdentifiersSignature()); assertEquals(bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("colour"), segment401.getColoursSignature()); From 41a9649b4ae917b541b1cdbdee1dbcd7465425de Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Tue, 20 Oct 2020 23:26:45 +0200 Subject: [PATCH 39/52] Rewrote the entire test suite. It works with an array of known values now. I also created code to autogenerate such tests for a given relation. Oddly some of these tests are generated wrongly where bus 3 goes through the station, but not when processing line 3 itself. I haven't been able to figure out where this comes from. --- .../data/RouteSegmentToExtract.java | 55 +- .../data/RouteSegmentToExtractTest.java | 4151 +++++++++-------- 2 files changed, 2224 insertions(+), 1982 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 28e728f5..634ee853 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -173,6 +173,9 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; WaySequence ws = new WaySequence(relation, index); + if (ws.currentWay == null && ws.nextWay != null) { + return this; // make sure all segments are processed + } if (ws.currentWay == null || ws.hasGap) { return null; } @@ -201,8 +204,8 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { .filter(RouteUtils::isVersionTwoPTRoute) .collect(Collectors.toList()); for (Relation sr : segmentRelations) { - RouteSegmentToExtract existingSegment = new RouteSegmentToExtract(sr, true); - if (existingSegment.getLastWay().equals(ws.currentWay)) { + RouteSegmentToExtract existingSegment = new RouteSegmentToExtract(sr, false); + if (existingSegment.isLastWay(ws.currentWay)) { final int existingSegmentSize = existingSegment.getWayMembers().size(); if (existingSegmentSize < 2) break; final int startIndexOfRange = index - existingSegmentSize + 1; @@ -214,7 +217,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } } parentRouteRelations.addAll(sr.getReferrers().stream() - .filter(r -> Objects.equals(r.getType(), Relation.class) && "superroute".equals(r.get("type"))) + .filter(r -> "superroute".equals(r.get("type"))) .map(r -> (Relation) r) .collect(Collectors.toList())); } @@ -222,11 +225,10 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(ws, parentRouteRelations); if (this.itinerariesInSameDirection != null - && itinerariesInSameDirection.size() != 0 - && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) - && !(getMembershipCount(ws.currentWay, relation) > 1 - && ws.currentWay.equals(getFirstWay(relation))) - ) { + && itinerariesInSameDirection.size() != 0 + && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) + && !(isFirstWay(ws.currentWay) && getMembershipCount(ws.currentWay, relation) < 2) + ) { startNewSegment = true; } else { this.itinerariesInSameDirection = itinerariesInSameDirection; @@ -278,10 +280,18 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } /** - * @return The last way of the relation that is being processed + * @return The first way of the relation that is being processed + */ + public boolean isFirstWay(Way way) { + return wayMembers.get(0).getWay().equals(way); + } + + /** + * @param way to compare + * @return is this the last way of the relation that is being processed */ - public Way getLastWay() { - return wayMembers.get(wayMembers.size() - 1).getWay(); + public boolean isLastWay(Way way) { + return wayMembers.get(wayMembers.size() - 1).getWay().equals(way); } /** @@ -361,7 +371,7 @@ public TreeSet getItinerariesInSameDirection(WaySequence ws, for (Relation parentRoute : parentRouteRelations) { final List parentRouteHighways = getItineraryWays(parentRoute); if (!itinerariesInSameDirection.contains(parentRoute)) { - if (getFirstWay(parentRoute) == ws.currentWay + if (ws.currentWay.equals(getFirstWay(parentRoute)) && ws.previousWay != null && !ws.previousWay.getNodes().contains(getSecondWay(parentRoute).getNode(0))) { itinerariesInSameDirection.add(parentRoute); @@ -539,9 +549,7 @@ public void addColour(String colour) { } public TreeSet getLineIdentifiers() { - if (lineIdentifiers.size() < 2) { - populateLineIdentifierAndColourLists(); - } + populateLineIdentifierAndColourLists(); return lineIdentifiers; } @@ -599,6 +607,7 @@ public List getStreetNames() { /** * @return All the distinct street names or refs of the Way members as a ; delimited string */ + @SuppressWarnings("unused") public String getStreetNamesSignature() { return String.join(";", getStreetNames()); } @@ -671,10 +680,8 @@ public Relation extractToRelation(List tagsToTransfer, Boolean substitut } if (atLeast1MemberAddedToExtractedRelation || extractedRelationAlreadyExists) { + updateTags(); if (extractedRelation.getId() <= 0 && !extractedRelationAlreadyExists) { - if (relation.hasTag("public_transport:version", "2")) { - updateTags(); - } getExtractRelationCommand().executeCommand(); addPtSegment(); } @@ -696,13 +703,13 @@ public Command getExtractRelationCommand() { return new SequenceCommand(tr("Extract sub relation"), commands); } + public String getNote() { + return String.format("%s(%s)", getFirstAndLastStreetNameOrRef(), getLineIdentifiersSignature()); + } + public void updateTags() { - final String lineIdentifiersSignature = getLineIdentifiersSignature(); - extractedRelation.put("note", - String.format("%s(%s)", getFirstAndLastStreetNameOrRef(), lineIdentifiersSignature)); - extractedRelation.put("route_ref", lineIdentifiersSignature); - // extractedRelation.put("street_names", getStreetNamesSignature()); - // extractedRelation.put("colour", getColoursSignature()); + extractedRelation.put("note", getNote()); + extractedRelation.put("route_ref", getLineIdentifiersSignature()); } private void addPtSegment() { diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 1a0d1355..df1d59ee 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -19,6 +19,39 @@ import static org.junit.Assert.*; import static org.openstreetmap.josm.io.OsmReader.parseDataSet; +/** + * An ExpectedValue for each index + */ +@SuppressWarnings("unused") +class Val { + int index; + int iDOfNextWay; + String nameOfNextWay; + int iDOfFirstWay; + int iDOfLastWay; + String note = null; + String expectedRouteRef = null; + + public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, + String nameOfNextWay, String note, String expectedRouteRef) { + this.index = index; + this.nameOfNextWay = nameOfNextWay; + this.iDOfFirstWay = iDOfFirstWay; + this.iDOfLastWay = iDOfLastWay; + this.iDOfNextWay = iDOfNextWay; + this.note = note; + this.expectedRouteRef = expectedRouteRef; + } + + public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, String nameOfNextWay) { + this.index = index; + this.nameOfNextWay = nameOfNextWay; + this.iDOfFirstWay = iDOfFirstWay; + this.iDOfLastWay = iDOfLastWay; + this.iDOfNextWay = iDOfNextWay; + } +} + @SuppressWarnings("NonAsciiCharacters") public class RouteSegmentToExtractTest extends AbstractTest{ @@ -190,522 +223,375 @@ public void bus601_600_3_Test() { assertEquals("", segment1.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment1.getWayMembers()); - final int W_158_perron1and2terminus_78579065_B = 78579065; - final int W_157_perron1and2_377814547_A = 377814547; - - final int W_156_TiensevestToPerron1_79596986_A = 79596986; RouteSegmentToExtract returnValueNull; - for (int n = 158; n >= 157; n--) {returnValueNull =segment1.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment2 = segment1.addPTWayMember(156); - - final Way veryLastWay = segment1.getWayMembers().get(1).getWay(); - assertEquals("perron 1 & 2", veryLastWay.get("ref")); - assertEquals(W_158_perron1and2terminus_78579065_B, veryLastWay.getId()); - final Way beforeLastWay = segment1.getWayMembers().get(0).getWay(); - assertEquals("perron 1 & 2", beforeLastWay.get("ref")); - assertEquals(W_157_perron1and2_377814547_A, beforeLastWay.getId()); - - // segment2 was created, extract segment1 to its own relation - extractAndAssertValues(156, segment1, segment2, cloneOfBus601RouteRelation, - W_157_perron1and2_377814547_A, W_158_perron1and2terminus_78579065_B, - W_156_TiensevestToPerron1_79596986_A, null, - "#1199DD;#229922;#771133;#77CCAA;#8899AA;#991199;#995511;#BB0022;#BBDD00;#C5AA77;#DD0077;#DD5555;#FF88AA;#FFCC11", - "1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658"); - - final int W_155_Tiensevest_5_79211473_A = 79211473; - - RouteSegmentToExtract segment3 = segment2.addPTWayMember(155); - extractAndAssertValues(155, segment2, segment3, cloneOfBus601RouteRelation, - W_156_TiensevestToPerron1_79596986_A, W_156_TiensevestToPerron1_79596986_A, - W_155_Tiensevest_5_79211473_A, "Tiensevest", - null, - "305;306;310;318;358;410;433;475;485;601;658"); - - final int W_154_Tiensevest_4_79211472_A = 79211472; - - RouteSegmentToExtract segment4 = segment3.addPTWayMember(154); - extractAndAssertValues(154, segment3, segment4, cloneOfBus601RouteRelation, - W_155_Tiensevest_5_79211473_A, W_155_Tiensevest_5_79211473_A, - W_154_Tiensevest_4_79211472_A, "Tiensevest", - null, - "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"); - - final int W_153_Tiensevest_3_79175435_A = 79175435; - - RouteSegmentToExtract segment5 = segment4.addPTWayMember(153); - extractAndAssertValues(153, segment4, segment5, cloneOfBus601RouteRelation, - W_154_Tiensevest_4_79211472_A, W_154_Tiensevest_4_79211472_A, - W_153_Tiensevest_3_79175435_A, "Tiensevest", - null, - "2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"); - - final int W_152_Tiensevest_2_80458208_A = 80458208; - - RouteSegmentToExtract segment6 = segment5.addPTWayMember(152); - extractAndAssertValues(152, segment5, segment6, cloneOfBus601RouteRelation, - W_153_Tiensevest_3_79175435_A, W_153_Tiensevest_3_79175435_A, - W_152_Tiensevest_2_80458208_A, "Tiensevest", - null, - "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658"); - - final int W_33_151_Tiensevest_1_19793164_A = 19793164; - - RouteSegmentToExtract segment7 = segment6.addPTWayMember(151); - extractAndAssertValues(151, segment6, segment7, cloneOfBus601RouteRelation, - W_152_Tiensevest_2_80458208_A, W_152_Tiensevest_2_80458208_A, - W_33_151_Tiensevest_1_19793164_A, "Tiensevest", - null, - "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658"); - - final int W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D = 6184898; - final int W_29_147_Diestsevest_1_8133608_A = 8133608; - - RouteSegmentToExtract segment8 = segment7.addPTWayMember(150); - Relation rel8 = extractAndAssertValues(150, segment7, segment8, cloneOfBus601RouteRelation, - W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, - W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", - null, - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"); - - final int W_28_146_Artoisplein_2_254800931_A = 254800931; - - final int W_145_Artoisplein_1_23691158_E = 23691158; - final int W_141_Lüdenscheidsingel_2_109267417_A = 109267417; - - for (int n = 149; n >= 147; n--) {returnValueNull =segment8.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment9 = segment8.addPTWayMember(146); - Relation rel9 = extractAndAssertValues(146, segment8, segment9, cloneOfBus601RouteRelation, - W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, - W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", - null, - "305;318;334;335;358;410;513;601;630;651;652;658"); - - RouteSegmentToExtract segment10 = segment9.addPTWayMember(145); - Relation rel10 = extractAndAssertValues(145, segment9, segment10, cloneOfBus601RouteRelation, - W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, - W_145_Artoisplein_1_23691158_E, "Joanna-Maria Artoisplein", - null, - "178;305;318;334;335;358;410;513;601;630;651;652;658"); - - final int W_140_Lüdenscheidsingel_1_3993387_E = 3993387; - final int W_136_Den_Boschsingel_2_23837544_A = 23837544; - - for (int n = 144; n >= 141; n--) {returnValueNull =segment10.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment11 = segment10.addPTWayMember(140); - extractAndAssertValues(140, segment10, segment11, cloneOfBus601RouteRelation, - W_141_Lüdenscheidsingel_2_109267417_A, W_145_Artoisplein_1_23691158_E, - W_140_Lüdenscheidsingel_1_3993387_E, "Lüdenscheidsingel", - null, - "178;305;318;358;410;601;651;652;658"); - - final int W_135_Den_Boschsingel_3_225605630_E = 225605630; - final int W_131_Rennes_Singel_1_249333185_A = 249333185; - - for (int n = 139; n >= 136; n--) {returnValueNull =segment11.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment12 = segment11.addPTWayMember(135); - extractAndAssertValues(135, segment11, segment12, cloneOfBus601RouteRelation, - W_136_Den_Boschsingel_2_23837544_A, W_140_Lüdenscheidsingel_1_3993387_E, - W_135_Den_Boschsingel_3_225605630_E, "Den Boschsingel", - null, - "318;358;410;601;651;658"); - final int W_99_130_Herestraat_1_249333184_AC = 249333184; - // W_100_129_Herestraat_2_813970231_BB = 813970231; - final int W_128_Herestraat_11_681081951_A = 681081951; - - for (int n = 134; n >= 131; n--) {returnValueNull =segment12.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment13 = segment12.addPTWayMember(130); - extractAndAssertValues(130, segment12, segment13, cloneOfBus601RouteRelation, - W_131_Rennes_Singel_1_249333185_A, W_135_Den_Boschsingel_3_225605630_E, - W_99_130_Herestraat_1_249333184_AC, "Herestraat", - null, - "318;410;601"); - - final int W_127_Herestraat_10_813970227_C = 813970227; - final int W_125_Herestraat_8_8079995_A = 8079995; - - for (int n = 129; n >= 128; n--) {returnValueNull =segment13.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment14 = segment13.addPTWayMember(127); - extractAndAssertValues(127, segment13, segment14, cloneOfBus601RouteRelation, - W_128_Herestraat_11_681081951_A, W_99_130_Herestraat_1_249333184_AC, - W_127_Herestraat_10_813970227_C, "Herestraat", - null, - "410;601"); - - final int W_124_Rotonde_Het_Teken_41403538_B = 41403538; - final int W_123_Ring_Zuid_79340950_A = 79340950; - - for (int n = 126; n >= 125; n--) {returnValueNull =segment14.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment15 = segment14.addPTWayMember(124); - extractAndAssertValues(124, segment14, segment15, cloneOfBus601RouteRelation, - W_125_Herestraat_8_8079995_A, W_127_Herestraat_10_813970227_C, - W_124_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", - null, - "410;600;601"); - - final int W_122_Ring_Zuid_11369123_A = 11369123; - - returnValueNull =segment15.addPTWayMember(123); assertNull(returnValueNull); - RouteSegmentToExtract segment16 = segment15.addPTWayMember(122); - extractAndAssertValues(122, segment15, segment16, cloneOfBus601RouteRelation, - W_123_Ring_Zuid_79340950_A, W_124_Rotonde_Het_Teken_41403538_B, - W_122_Ring_Zuid_11369123_A, "Ring Zuid", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_121__159949154_A = 159949154; - final int W_120__332258104_B = 332258104; - - final int W_119_GHB_ingang_78852604_A = 78852604; - - RouteSegmentToExtract segment17 = segment16.addPTWayMember(121); - extractAndAssertValues(121, segment16, segment17, cloneOfBus601RouteRelation, - W_122_Ring_Zuid_11369123_A, W_122_Ring_Zuid_11369123_A, - W_121__159949154_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_118_GHB_p5_377918641_B = 377918641; - final int W_117_GHB_p5_14508736_A = 14508736; - - RouteSegmentToExtract segment18 = segment17.addPTWayMember(120); - extractAndAssertValues(120, segment17, segment18, cloneOfBus601RouteRelation, - W_121__159949154_A, W_121__159949154_A, - W_120__332258104_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_116_Ring_Zuid_p45_109267436_A = 109267436; - - returnValueNull =segment18.addPTWayMember(119); assertNull(returnValueNull); - RouteSegmentToExtract segment19 = segment18.addPTWayMember(118); - extractAndAssertValues(118, segment18, segment19, cloneOfBus601RouteRelation, - W_119_GHB_ingang_78852604_A, W_120__332258104_B, - W_118_GHB_p5_377918641_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_115_Ring_Zuid_p3_14508739_A = 14508739; - - returnValueNull =segment19.addPTWayMember(117); assertNull(returnValueNull); - RouteSegmentToExtract segment20 = segment19.addPTWayMember(116); - extractAndAssertValues(116, segment19, segment20, cloneOfBus601RouteRelation, - W_117_GHB_p5_14508736_A, W_118_GHB_p5_377918641_B, - W_116_Ring_Zuid_p45_109267436_A, "Ring Zuid", - null, - "3;317;395;410;601"); - - final int W_114_Ring_Zuid_p2_14508740_A = 14508740; - - RouteSegmentToExtract segment21 = segment20.addPTWayMember(115); - extractAndAssertValues(115, segment20, segment21, cloneOfBus601RouteRelation, - W_116_Ring_Zuid_p45_109267436_A, W_116_Ring_Zuid_p45_109267436_A, - W_115_Ring_Zuid_p3_14508739_A, "Ring Zuid", - null, - "3;317;395;410;600;601"); - - final int W_113_Ring_Zuid_p1_502328838_D = 502328838; - final int W_110_Rotonde_Het_Teken_78568660_A = 78568660; - - RouteSegmentToExtract segment22 = segment21.addPTWayMember(114); - extractAndAssertValues(114, segment21, segment22, cloneOfBus601RouteRelation, - W_115_Ring_Zuid_p3_14508739_A, W_115_Ring_Zuid_p3_14508739_A, - W_114_Ring_Zuid_p2_14508740_A, "Ring Zuid", - null, - "3;317;334;335;395;410;600;601"); - - RouteSegmentToExtract segment23 = segment22.addPTWayMember(113); - extractAndAssertValues(113, segment22, segment23, cloneOfBus601RouteRelation, - W_114_Ring_Zuid_p2_14508740_A, W_114_Ring_Zuid_p2_14508740_A, - W_113_Ring_Zuid_p1_502328838_D, "Ring Zuid", - null, - "3;317;334;335;380;395;410;600;601"); - - final int W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A = 78873921; - - for (int n = 112; n >= 110; n--) {returnValueNull =segment23.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment24 = segment23.addPTWayMember(109); - extractAndAssertValues(109, segment23, segment24, cloneOfBus601RouteRelation, - W_110_Rotonde_Het_Teken_78568660_A, W_113_Ring_Zuid_p1_502328838_D, - W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - final int W_108_Rotonde_Het_Teken_3752557_A = 3752557; - - RouteSegmentToExtract segment25 = segment24.addPTWayMember(108); - extractAndAssertValues(108, segment24, segment25, cloneOfBus601RouteRelation, - W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, W_109_Rotonde_Het_Teken_Ring_Noord_bus3_78873921_A, - W_108_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - final int W_107_Rotonde_Het_Teken_VWBln_249333188_A = 249333188; - - RouteSegmentToExtract segment26 = segment25.addPTWayMember(107); - extractAndAssertValues(107, segment25, segment26, cloneOfBus601RouteRelation, - W_108_Rotonde_Het_Teken_3752557_A, W_108_Rotonde_Het_Teken_3752557_A, - W_107_Rotonde_Het_Teken_VWBln_249333188_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - final int W_106_Rotonde_Het_Teken_249333187_A = 249333187; - - RouteSegmentToExtract segment27 = segment26.addPTWayMember(106); - extractAndAssertValues(106, segment26, segment27, cloneOfBus601RouteRelation, - W_107_Rotonde_Het_Teken_VWBln_249333188_A, W_107_Rotonde_Het_Teken_VWBln_249333188_A, - W_106_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", - null, - "3;410;600;601"); - - final int W_105_Herestraat_7_13067134_D = 13067134; - final int W_102_Herestraat_4_813970228_A = 813970228; - - RouteSegmentToExtract segment28 = segment27.addPTWayMember(105); - extractAndAssertValues(105, segment27, segment28, cloneOfBus601RouteRelation, - W_106_Rotonde_Het_Teken_249333187_A, W_106_Rotonde_Het_Teken_249333187_A, - W_105_Herestraat_7_13067134_D, "Herestraat", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_101_Herestraat_3_813970229_C = 813970229; - // 99 and 100 are defined as 129 and 130 - - for (int n = 104; n >= 102; n--) {returnValueNull =segment28.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment29 = segment28.addPTWayMember(101); - extractAndAssertValues(101, segment28, segment29, cloneOfBus601RouteRelation, - W_102_Herestraat_4_813970228_A, W_105_Herestraat_7_13067134_D, - W_101_Herestraat_3_813970229_C, "Herestraat", - null, - "410;600;601"); - - final int W_98_Rennes_Singel_249333186_H = 249333186; - final int W_91_Rennes_Singel_429706864_A = 429706864; - - for (int n = 100; n >= 99; n--) {returnValueNull =segment29.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment30 = segment29.addPTWayMember(98); - extractAndAssertValues(98, segment29, segment30, cloneOfBus601RouteRelation, - W_99_130_Herestraat_1_249333184_AC, W_101_Herestraat_3_813970229_C, - W_98_Rennes_Singel_249333186_H, "Rennes-Singel", - null, - "601"); - - final int W_90_Tervuursevest_99583853_K = 99583853; - final int W_80_Tervuursevest_88361317_A = 88361317; - - for (int n = 97; n >= 91; n--) {returnValueNull =segment30.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment31 = segment30.addPTWayMember(90); - extractAndAssertValues(90, segment30, segment31, cloneOfBus601RouteRelation, - W_91_Rennes_Singel_429706864_A, W_98_Rennes_Singel_249333186_H, - W_90_Tervuursevest_99583853_K, "Tervuursevest", - null, - "318;601"); - - final int W_79_Tervuursevest_Kapucijnenvoer_461159345_A = 461159345; - - for (int n = 89; n >= 80; n--) {returnValueNull =segment31.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment32 = segment31.addPTWayMember(79); - extractAndAssertValues(79, segment31, segment32, cloneOfBus601RouteRelation, - W_80_Tervuursevest_88361317_A, W_90_Tervuursevest_99583853_K, - W_79_Tervuursevest_Kapucijnenvoer_461159345_A, "Tervuursevest", - null, - "601"); - - final int W_78_Tervuursevest_461159362_K = 461159362; - final int W_68_Tervuursevest_3677330_A = 3677330; - - RouteSegmentToExtract segment33 = segment32.addPTWayMember(78); - extractAndAssertValues(78, segment32, segment33, cloneOfBus601RouteRelation, - W_79_Tervuursevest_Kapucijnenvoer_461159345_A, W_79_Tervuursevest_Kapucijnenvoer_461159345_A, - W_78_Tervuursevest_461159362_K, "Tervuursevest", - null, - "178;179;306 (student);601"); - - final int W_67_Naamsevest_86164005_G = 86164005; - final int W_61_Geldenaaksevest_24905257_A = 24905257; - - final int W_60_Geldenaaksevest_608715605_H = 608715605; - final int W_53_Geldenaaksevest_8130906_A = 8130906; - - for (int n = 77; n >= 68; n--) {returnValueNull =segment33.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment34 = segment33.addPTWayMember(67); - extractAndAssertValues(67, segment33, segment34, cloneOfBus601RouteRelation, - W_68_Tervuursevest_3677330_A, W_78_Tervuursevest_461159362_K, - W_67_Naamsevest_86164005_G, "Naamsevest", - null, - "178;179;306 (student);520;524;525;537;601"); - - final int W_52_Tiensepoort_16775171_D = 16775171; - final int W_49_Tiensevest_Oostertunnel_8590231_A = 8590231; - - for (int n = 66; n >= 61; n--) {returnValueNull =segment34.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment35 = segment34.addPTWayMember(60); - extractAndAssertValues(60, segment34, segment35, cloneOfBus601RouteRelation, - W_61_Geldenaaksevest_24905257_A, W_67_Naamsevest_86164005_G, - W_60_Geldenaaksevest_608715605_H, "Geldenaaksevest", - null, - "18;178;179;306 (student);337;601;616"); - - for (int n = 60; n >= 53; n--) {returnValueNull =segment35.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment36 = segment35.addPTWayMember(52); - extractAndAssertValues(52, segment35, segment36, cloneOfBus601RouteRelation, - W_53_Geldenaaksevest_8130906_A, W_60_Geldenaaksevest_608715605_H, - W_52_Tiensepoort_16775171_D, "Tiensepoort", - null, - "18;178;179;306 (student);337;601;616;630"); - - final int W_48_Tiensevest_185988814_A = 185988814; - - for (int n = 51; n >= 49; n--) {returnValueNull =segment36.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment37 = segment36.addPTWayMember(48); - extractAndAssertValues(48, segment36, segment37, cloneOfBus601RouteRelation, - W_49_Tiensevest_Oostertunnel_8590231_A, W_52_Tiensepoort_16775171_D, - W_48_Tiensevest_185988814_A, "Tiensevest", - null, - "7;8;9;18;178;179;306 (student);337;380;527;601;616;630"); - - final int W_47_Martelarenplein_76856823_D = 76856823; - final int W_44__78815533_A = 78815533; - - RouteSegmentToExtract segment38 = segment37.addPTWayMember(47); - extractAndAssertValues(47, segment37, segment38, cloneOfBus601RouteRelation, - W_48_Tiensevest_185988814_A, W_48_Tiensevest_185988814_A, - W_47_Martelarenplein_76856823_D, "Martelarenplein", - null, - "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;616;630"); - - final int W_43__79264899_A = 79264899; - - for (int n = 46; n >= 44; n--) {returnValueNull =segment38.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment39 = segment38.addPTWayMember(43); - extractAndAssertValues(43, segment38, segment39, cloneOfBus601RouteRelation, - W_44__78815533_A, W_47_Martelarenplein_76856823_D, - W_43__79264899_A, null, - null, - "4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630"); - - final int W_42__377918635_A = 377918635; - - RouteSegmentToExtract segment40 = segment39.addPTWayMember(42); - extractAndAssertValues(42, segment39, segment40, cloneOfBus601RouteRelation, - W_43__79264899_A, W_43__79264899_A, - W_42__377918635_A, null, - null, - "4;5;6;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630"); - final int W_41__79264888_A = 79264888; - - RouteSegmentToExtract segment41 = segment40.addPTWayMember(41); - extractAndAssertValues(41, segment40, segment41, cloneOfBus601RouteRelation, - W_42__377918635_A, W_42__377918635_A, - W_41__79264888_A, null, - null, - "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"); - - final int W_40__79264897_B = 79264897; - final int W_39__71754927_A = 71754927; - - RouteSegmentToExtract segment42 = segment41.addPTWayMember(40); - extractAndAssertValues(40, segment41, segment42, cloneOfBus601RouteRelation, - W_41__79264888_A, W_41__79264888_A, - W_40__79264897_B, null, - null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"); - - final int W_38__377918638_A_TEC18 = 377918638; - - returnValueNull =segment42.addPTWayMember(39); assertNull(returnValueNull); - RouteSegmentToExtract segment44 = segment42.addPTWayMember(38); - extractAndAssertValues(38, segment42, segment44, cloneOfBus601RouteRelation, - W_39__71754927_A, W_40__79264897_B, - W_38__377918638_A_TEC18, null, - null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"); - - final int W_37__79264891_A = 79264891; - - RouteSegmentToExtract segment45 = segment44.addPTWayMember(37); - extractAndAssertValues(37, segment44, segment45, cloneOfBus601RouteRelation, - W_38__377918638_A_TEC18, W_38__377918638_A_TEC18, - W_37__79264891_A, null, - null, - "18;601"); - final int W_36_Tiensevest_78568409_A = 78568409; - - RouteSegmentToExtract segment46 = segment45.addPTWayMember(36); - extractAndAssertValues(36, segment45, segment46, cloneOfBus601RouteRelation, - W_37__79264891_A, W_37__79264891_A, - W_36_Tiensevest_78568409_A, "Tiensevest", - null, - "18;601"); - final int W_35_Tiensevest_79193579_A = 79193579; - - RouteSegmentToExtract segment47 = segment46.addPTWayMember(35); - extractAndAssertValues(35, segment46, segment47, cloneOfBus601RouteRelation, - W_36_Tiensevest_78568409_A, W_36_Tiensevest_78568409_A, - W_35_Tiensevest_79193579_A, "Tiensevest", - null, - "4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658"); - final int W_34_Bend_19793394_A = 19793394; - // ways 28 to 33 are the same as 146 - 151 - final int W_27_Zoutstraat_3992548_A = 3992548; - - RouteSegmentToExtract segment48 = segment47.addPTWayMember(34); - extractAndAssertValues(34, segment47, segment48, cloneOfBus601RouteRelation, - W_35_Tiensevest_79193579_A, W_35_Tiensevest_79193579_A, - W_34_Bend_19793394_A, null, - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"); - - final int W_26_Havenkant_510790349_M = 510790349; - final int W_14_Engels_Plein_338057820_A = 338057820; - - RouteSegmentToExtract segment49 = segment48.addPTWayMember(33); - extractAndAssertValues(33, segment48, segment49, cloneOfBus601RouteRelation, - W_34_Bend_19793394_A, W_34_Bend_19793394_A, - W_33_151_Tiensevest_1_19793164_A, "Tiensevest", - null, - "334;335;513;601"); - - RouteSegmentToExtract segment50 = segment49.addPTWayMember(32); - Relation rel50 = extractAndAssertValues(32, segment49, segment50, cloneOfBus601RouteRelation, - W_33_151_Tiensevest_1_19793164_A, W_33_151_Tiensevest_1_19793164_A, - W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, "Diestsevest", - null, - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"); - assertEquals(rel8.getId(), rel50.getId()); - - for (int n = 31; n >= 29; n--) {returnValueNull =segment50.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment51 = segment50.addPTWayMember(28); - Relation rel51 = extractAndAssertValues(28, segment50, segment51, cloneOfBus601RouteRelation, - W_29_147_Diestsevest_1_8133608_A, W_32_150_Diestsevest_4_NextToOostertunnel_6184898_D, - W_28_146_Artoisplein_2_254800931_A, "Joanna-Maria Artoisplein", - null, - "305;318;334;335;358;410;513;601;630;651;652;658"); - assertEquals(rel9.getId(), rel51.getId()); - - RouteSegmentToExtract segment52 = segment51.addPTWayMember(27); - Relation rel52 = extractAndAssertValues(27, segment51, segment52, cloneOfBus601RouteRelation, - W_28_146_Artoisplein_2_254800931_A, W_28_146_Artoisplein_2_254800931_A, - W_27_Zoutstraat_3992548_A, "Zoutstraat", - null, - "178;305;318;334;335;358;410;513;601;630;651;652;658"); - assertEquals(rel10.getId(), rel52.getId()); - - RouteSegmentToExtract segment53 = segment52.addPTWayMember(26); - extractAndAssertValues(26, segment52, segment53, cloneOfBus601RouteRelation, - W_27_Zoutstraat_3992548_A, W_27_Zoutstraat_3992548_A, - W_26_Havenkant_510790349_M, "Havenkant", - null, - "334;335;513;601;630"); - - for (int n = 25; n >= 14; n--) {returnValueNull =segment53.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus601RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment54 = segment53.addPTWayMember(13); - extractAndAssertValues(13, segment53, segment54, cloneOfBus601RouteRelation, - W_14_Engels_Plein_338057820_A, W_26_Havenkant_510790349_M, - 0, null, - null, - "601"); + List expectedValues = Arrays.asList( + new Val( 158, 78579065, 78579065, 78579065, null), + new Val( 157, 377814547, 78579065, 377814547, null), + + new Val( 156, 377814547, 78579065, 79596986, null, + "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", + "1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658"), + + + new Val( 155, 79596986, 79596986, 79211473, "Tiensevest", + "(305;306;310;318;358;410;433;475;485;601;658)", + "305;306;310;318;358;410;433;475;485;601;658"), + + + new Val( 154, 79211473, 79211473, 79211472, "Tiensevest", + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", + "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), + + + new Val( 153, 79211472, 79211472, 79175435, "Tiensevest", + "Tiensevest (2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", + "2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), + + + new Val( 152, 79175435, 79175435, 80458208, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)", + "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658"), + + + new Val( 151, 80458208, 80458208, 19793164, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658)", + "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658"), + + + new Val( 150, 19793164, 19793164, 6184898, "Diestsevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658)", + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"), + + new Val( 149, 81457878, 6184898, 81457878, "Diestsevest"), + new Val( 148, 4003924, 6184898, 4003924, "Diestsevest"), + new Val( 147, 8133608, 6184898, 8133608, "Diestsevest"), + + new Val( 146, 8133608, 6184898, 254800931, "Joanna-Maria Artoisplein", + "Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", + "305;318;334;335;358;410;513;601;630;651;652;658"), + + + new Val( 145, 254800931, 254800931, 23691158, "Joanna-Maria Artoisplein", + "Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", + "178;305;318;334;335;358;410;513;601;630;651;652;658"), + + new Val( 144, 254800932, 23691158, 254800932, "Lüdenscheidsingel"), + new Val( 143, 44932921, 23691158, 44932921, "Lüdenscheidsingel"), + new Val( 142, 3993388, 23691158, 3993388, "Lüdenscheidsingel"), + new Val( 141, 109267417, 23691158, 109267417, "Lüdenscheidsingel"), + + new Val( 140, 109267417, 23691158, 3993387, "Lüdenscheidsingel", + "Lüdenscheidsingel - Joanna-Maria Artoisplein (178;305;318;358;410;601;651;652;658)", + "178;305;318;358;410;601;651;652;658"), + + new Val( 139, 8131125, 3993387, 8131125, null), + new Val( 138, 3877105, 3993387, 3877105, null), + new Val( 137, 146171871, 3993387, 146171871, "Den Boschsingel"), + new Val( 136, 23837544, 3993387, 23837544, "Den Boschsingel"), + + new Val( 135, 23837544, 3993387, 225605630, "Den Boschsingel", + "Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)", + "318;358;410;601;651;658"), + + new Val( 134, 8131121, 225605630, 8131121, "Den Boschsingel"), + new Val( 133, 3680456, 225605630, 3680456, "Rennes-Singel"), + new Val( 132, 3994257, 225605630, 3994257, "Rennes-Singel"), + new Val( 131, 249333185, 225605630, 249333185, "Rennes-Singel"), + + new Val( 130, 249333185, 225605630, 249333184, "Herestraat", + "Rennes-Singel - Den Boschsingel (318;410;601)", + "318;410;601"), + + new Val( 129, 813970231, 249333184, 813970231, "Herestraat"), + new Val( 128, 681081951, 249333184, 681081951, "Herestraat"), + + new Val( 127, 681081951, 249333184, 813970227, "Herestraat", + "Herestraat (410;601)", + "410;601"), + + new Val( 126, 41403544, 813970227, 41403544, "Herestraat"), + new Val( 125, 8079995, 813970227, 8079995, "Herestraat"), + + new Val( 124, 8079995, 813970227, 41403538, "Rotonde Het Teken", + "Herestraat (410;600;601)", + "410;600;601"), + + new Val( 123, 79340950, 41403538, 79340950, "Ring Zuid"), + + new Val( 122, 79340950, 41403538, 11369123, "Ring Zuid", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 121, 11369123, 11369123, 159949154, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 120, 159949154, 159949154, 332258104, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 119, 78852604, 332258104, 78852604, null), + + new Val( 118, 78852604, 332258104, 377918641, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 117, 14508736, 377918641, 14508736, null), + + new Val( 116, 14508736, 377918641, 109267436, "Ring Zuid", + "(3;317;395;410;601)", + "3;317;395;410;601"), + + + new Val( 115, 109267436, 109267436, 14508739, "Ring Zuid", + "Ring Zuid (3;317;395;410;600;601)", + "3;317;395;410;600;601"), + + + new Val( 114, 14508739, 14508739, 14508740, "Ring Zuid", + "Ring Zuid (3;317;334;335;395;410;600;601)", + "3;317;334;335;395;410;600;601"), + + + new Val( 113, 14508740, 14508740, 502328838, "Ring Zuid", + "Ring Zuid (3;317;334;335;380;395;410;600;601)", + "3;317;334;335;380;395;410;600;601"), + + new Val( 112, 502328837, 502328838, 502328837, "Ring Zuid"), + new Val( 111, 8080023, 502328838, 8080023, "Ring Zuid"), + new Val( 110, 78568660, 502328838, 78568660, "Rotonde Het Teken"), + + new Val( 109, 78568660, 502328838, 78873921, "Rotonde Het Teken", + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 108, 78873921, 78873921, 3752557, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 107, 3752557, 3752557, 249333188, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 106, 249333188, 249333188, 249333187, "Rotonde Het Teken", + "Rotonde Het Teken (3;410;600;601)", + "3;410;600;601"), + + + new Val( 105, 249333187, 249333187, 13067134, "Herestraat", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 104, 813970232, 13067134, 813970232, "Herestraat"), + new Val( 103, 813970226, 13067134, 813970226, "Herestraat"), + new Val( 102, 813970228, 13067134, 813970228, "Herestraat"), + + new Val( 101, 813970228, 13067134, 813970229, "Herestraat", + "Herestraat (410;600;601)", + "410;600;601"), + + new Val( 100, 813970231, 813970229, 813970231, "Herestraat"), + new Val( 99, 249333184, 813970229, 249333184, "Herestraat"), + + new Val( 98, 249333184, 813970229, 249333186, "Rennes-Singel", + "Herestraat (601)", + "601"), + + new Val( 97, 192559628, 249333186, 192559628, "Rennes-Singel"), + new Val( 96, 161166589, 249333186, 161166589, "Rennes-Singel"), + new Val( 95, 813979470, 249333186, 813979470, "Rennes-Singel"), + new Val( 94, 79289746, 249333186, 79289746, "Rennes-Singel"), + new Val( 93, 813979472, 249333186, 813979472, "Rennes-Singel"), + new Val( 92, 8131120, 249333186, 8131120, "Rennes-Singel"), + new Val( 91, 429706864, 249333186, 429706864, "Rennes-Singel"), + + new Val( 90, 429706864, 249333186, 99583853, "Tervuursevest", + "Rennes-Singel (318;601)", + "318;601"), + + new Val( 89, 521193379, 99583853, 521193379, "Tervuursevest"), + new Val( 88, 521193380, 99583853, 521193380, "Tervuursevest"), + new Val( 87, 813979465, 99583853, 813979465, "Tervuursevest"), + new Val( 86, 174338458, 99583853, 174338458, "Tervuursevest"), + new Val( 85, 608715520, 99583853, 608715520, "Tervuursevest"), + new Val( 84, 608715521, 99583853, 608715521, "Tervuursevest"), + new Val( 83, 3677944, 99583853, 3677944, "Tervuursevest"), + new Val( 82, 174338459, 99583853, 174338459, "Tervuursevest"), + new Val( 81, 429706866, 99583853, 429706866, "Tervuursevest"), + new Val( 80, 88361317, 99583853, 88361317, "Tervuursevest"), + + new Val( 79, 88361317, 99583853, 461159345, "Tervuursevest", + "Tervuursevest (601)", + "601"), + + + new Val( 78, 461159345, 461159345, 461159362, "Tervuursevest", + "Tervuursevest (178;179;306 (student);601)", + "178;179;306 (student);601"), + + new Val( 77, 344507822, 461159362, 344507822, "Tervuursevest"), + new Val( 76, 461159367, 461159362, 461159367, "Tervuursevest"), + new Val( 75, 3677335, 461159362, 3677335, "Tervuursevest"), + new Val( 74, 31474001, 461159362, 31474001, "Tervuursevest"), + new Val( 73, 23237288, 461159362, 23237288, "Tervuursevest"), + new Val( 72, 90168773, 461159362, 90168773, "Tervuursevest"), + new Val( 71, 23237287, 461159362, 23237287, "Tervuursevest"), + new Val( 70, 608715561, 461159362, 608715561, "Tervuursevest"), + new Val( 69, 608715562, 461159362, 608715562, "Tervuursevest"), + new Val( 68, 3677330, 461159362, 3677330, "Tervuursevest"), + + new Val( 67, 3677330, 461159362, 86164005, "Naamsevest", + "Tervuursevest (178;179;306 (student);520;524;525;537;601)", + "178;179;306 (student);520;524;525;537;601"), + + new Val( 66, 655251293, 86164005, 655251293, "Naamsevest"), + new Val( 65, 131571763, 86164005, 131571763, "Naamsevest"), + new Val( 64, 661733369, 86164005, 661733369, "Naamsevest"), + new Val( 63, 655251292, 86164005, 655251292, "Naamsevest"), + new Val( 62, 3677823, 86164005, 3677823, "Naamsevest"), + new Val( 61, 24905257, 86164005, 24905257, "Geldenaaksevest"), + + new Val( 60, 24905257, 86164005, 608715605, "Geldenaaksevest", + "Geldenaaksevest - Naamsevest (18;178;179;306 (student);337;601;616)", + "18;178;179;306 (student);337;601;616"), + + new Val( 59, 608715606, 608715605, 608715606, "Geldenaaksevest"), + new Val( 58, 79299303, 608715605, 79299303, "Geldenaaksevest"), + new Val( 57, 10296368, 608715605, 10296368, "Geldenaaksevest"), + new Val( 56, 521193607, 608715605, 521193607, "Geldenaaksevest"), + new Val( 55, 94585453, 608715605, 94585453, "Geldenaaksevest"), + new Val( 54, 586268893, 608715605, 586268893, "Geldenaaksevest"), + new Val( 53, 8130906, 608715605, 8130906, "Geldenaaksevest"), + + new Val( 52, 8130906, 608715605, 16775171, "Tiensepoort", + "Geldenaaksevest (18;178;179;306 (student);337;601;616;630)", + "18;178;179;306 (student);337;601;616;630"), + + new Val( 51, 8131717, 16775171, 8131717, "Tiensevest"), + new Val( 50, 12712557, 16775171, 12712557, "Tiensevest"), + new Val( 49, 8590231, 16775171, 8590231, "Tiensevest"), + + new Val( 48, 8590231, 16775171, 185988814, "Tiensevest", + "Tiensevest - Tiensepoort (7;8;9;18;178;179;306 (student);337;380;527;601;616;630)", + "7;8;9;18;178;179;306 (student);337;380;527;601;616;630"), + + + new Val( 47, 185988814, 185988814, 76856823, "Martelarenplein", + "Tiensevest (1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;616;630)", + "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;616;630"), + + new Val( 46, 459446598, 76856823, 459446598, "Martelarenplein"), + new Val( 45, 459446600, 76856823, 459446600, "Martelarenplein"), + new Val( 44, 78815533, 76856823, 78815533, null), + + new Val( 43, 78815533, 76856823, 79264899, null, + "Martelarenplein (4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630)", + "4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630"), + + + new Val( 42, 79264899, 79264899, 377918635, null, + "(4;5;6;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630)", + "4;5;6;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630"), + + + new Val( 41, 377918635, 377918635, 79264888, null, + "(3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601)", + "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"), + + + new Val( 40, 79264888, 79264888, 79264897, null, + "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601)", + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"), + + new Val( 39, 71754927, 79264897, 71754927, null), + + new Val( 38, 71754927, 79264897, 377918638, null, + "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601)", + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"), + + + new Val( 37, 377918638, 377918638, 79264891, null, + "(18;601)", + "18;601"), + + + new Val( 36, 79264891, 79264891, 78568409, "Tiensevest", + "(18;601)", + "18;601"), + + + new Val( 35, 78568409, 78568409, 79193579, "Tiensevest", + "Tiensevest (4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658)", + "4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658"), + + + new Val( 34, 79193579, 79193579, 19793394, null, + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"), + + + new Val( 33, 19793394, 19793394, 19793164, "Tiensevest", + "(334;335;513;601)", + "334;335;513;601"), + + + new Val( 32, 19793164, 19793164, 6184898, "Diestsevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658)", + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"), + + new Val( 31, 81457878, 6184898, 81457878, "Diestsevest"), + new Val( 30, 4003924, 6184898, 4003924, "Diestsevest"), + new Val( 29, 8133608, 6184898, 8133608, "Diestsevest"), + + new Val( 28, 8133608, 6184898, 254800931, "Joanna-Maria Artoisplein", + "Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", + "305;318;334;335;358;410;513;601;630;651;652;658"), + + + new Val( 27, 254800931, 254800931, 3992548, "Zoutstraat", + "Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", + "178;305;318;334;335;358;410;513;601;630;651;652;658"), + + + new Val( 26, 3992548, 3992548, 510790349, "Havenkant", + "Zoutstraat (334;335;513;601;630)", + "334;335;513;601;630"), + + new Val( 25, 510790348, 510790349, 510790348, "Havenkant"), + new Val( 24, 314635787, 510790349, 314635787, "Havenkant"), + new Val( 23, 843534478, 510790349, 843534478, "Havenkant"), + new Val( 22, 406205781, 510790349, 406205781, "Havenkant"), + new Val( 21, 270181176, 510790349, 270181176, "Havenkant"), + new Val( 20, 330300725, 510790349, 330300725, "Havenkant"), + new Val( 19, 3869822, 510790349, 3869822, "Burchtstraat"), + new Val( 18, 330300723, 510790349, 330300723, "Achter de latten"), + new Val( 17, 659297690, 510790349, 659297690, "Wolvengang"), + new Val( 16, 25928482, 510790349, 25928482, "Wolvengang"), + new Val( 15, 3869812, 510790349, 3869812, "Engels Plein"), + new Val( 14, 338057820, 510790349, 338057820, "Engels Plein"), + + new Val( 13, 338057820, 510790349, 338057820, "Engels Plein", + "Engels Plein - Havenkant (601)", + "601") + ); RouteSegmentToExtract previousSegment = new RouteSegmentToExtract(cloneOfBus601RouteRelation); + previousSegment.setActiveDataSet(ds); + RouteSegmentToExtract segment; + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, cloneOfBus601RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + } + System.out.print("\n"); // *********************************************************** // *********************************************************** @@ -730,602 +616,410 @@ public void bus601_600_3_Test() { assertEquals("", segment101.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment101.getWayMembers()); - final int W_169_Engels_Plein_608715622_O = 608715622; - final int W_155_Havenkant_29283599_A = 29283599; - - final int W_154_Havenkant_304241968_B = 304241968; - final int W_153_Aarschotsesteenweg_304241967_A = 304241967; - - for (int n = 169; n >= 155; n--) {returnValueNull =segment101.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment102 = segment101.addPTWayMember(154); - extractAndAssertValues(154, segment101, segment102, cloneOfBus600RouteRelation, - W_155_Havenkant_29283599_A, W_169_Engels_Plein_608715622_O, - W_154_Havenkant_304241968_B, "Havenkant", - null, - "600"); - - final int W_152_Redersstraat_340265961_B = 340265961; - final int W_151_Redersstraat_318825613_A = 318825613; - - returnValueNull =segment102.addPTWayMember(153); assertNull(returnValueNull); - RouteSegmentToExtract segment103 = segment102.addPTWayMember(152); - extractAndAssertValues(152, segment102, segment103, cloneOfBus600RouteRelation, - W_153_Aarschotsesteenweg_304241967_A, W_154_Havenkant_304241968_B, - W_152_Redersstraat_340265961_B, "Redersstraat", - null, - "334;335;513;600;630"); - - final int W_150_Redersstraat_340265962_A = 340265962; - - returnValueNull =segment103.addPTWayMember(151); assertNull(returnValueNull); - RouteSegmentToExtract segment104 = segment103.addPTWayMember(150); - extractAndAssertValues(150, segment103, segment104, cloneOfBus600RouteRelation, - W_151_Redersstraat_318825613_A, W_152_Redersstraat_340265961_B, - W_150_Redersstraat_340265962_A, "Redersstraat", - null, - "600"); - - final int W_149_Joanna_Maria_Artoisplein_254801390_B = 254801390; - final int W_148_Joanna_Maria_Artoisplein_61540068_A = 61540068; - - RouteSegmentToExtract segment105 = segment104.addPTWayMember(149); - extractAndAssertValues(149, segment104, segment105, cloneOfBus600RouteRelation, - W_150_Redersstraat_340265962_A, W_150_Redersstraat_340265962_A, - W_149_Joanna_Maria_Artoisplein_254801390_B, "Joanna-Maria Artoisplein", - null, - "333;334;335;513;600;630"); - - final int W_147_Vuurkruisenlaan_23691160_C = 23691160; - final int W_145_Diestsepoort_8109264_A = 8109264; - - returnValueNull =segment105.addPTWayMember(148); assertNull(returnValueNull); - RouteSegmentToExtract segment106 = segment105.addPTWayMember(147); - extractAndAssertValues(147, segment105, segment106, cloneOfBus600RouteRelation, - W_148_Joanna_Maria_Artoisplein_61540068_A, W_149_Joanna_Maria_Artoisplein_254801390_B, - W_147_Vuurkruisenlaan_23691160_C, "Vuurkruisenlaan", - null, - "178;305;318;333;334;335;410;513;600;630;651;652;658"); - - final int W_144_Diestsepoort_61556877_D = 61556877; - final int W_141_Diestsepoort_584356745_A = 584356745; - - for (int n = 146; n >= 145; n--) {returnValueNull =segment106.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment107 = segment106.addPTWayMember(144); - extractAndAssertValues(144, segment106, segment107, cloneOfBus600RouteRelation, - W_145_Diestsepoort_8109264_A, W_147_Vuurkruisenlaan_23691160_C, - W_144_Diestsepoort_61556877_D, "Diestsepoort", - null, - "305;333;334;335;513;600;630;651;652;658"); - - final int W_140_Diestsepoort_198559166_E = 198559166; - final int W_136_Diestsepoort_451873774_A = 451873774; - - for (int n = 143; n >= 141; n--) {returnValueNull =segment107.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment108 = segment107.addPTWayMember(140); - extractAndAssertValues(140, segment107, segment108, cloneOfBus600RouteRelation, - W_141_Diestsepoort_584356745_A, W_144_Diestsepoort_61556877_D, - W_140_Diestsepoort_198559166_E, "Diestsepoort", - null, - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"); - - final int W_135__76867049_C = 76867049; - // W_134__79264890_B = 79264890; - final int W_133__79596965_A = 79596965; - - for (int n = 139; n >= 136; n--) {returnValueNull =segment108.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment109 = segment108.addPTWayMember(135); - extractAndAssertValues(135, segment108, segment109, cloneOfBus600RouteRelation, - W_136_Diestsepoort_451873774_A, W_140_Diestsepoort_198559166_E, - W_135__76867049_C, null, - null, - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"); - - final int W_132__79596974_B = 79596974; - final int W_131__79596982_A = 79596982; - - for (int n = 134; n >= 133; n--) {returnValueNull =segment109.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment110 = segment109.addPTWayMember(132); - extractAndAssertValues(132, segment109, segment110, cloneOfBus600RouteRelation, - W_133__79596965_A, W_135__76867049_C, - W_132__79596974_B, null, - null, - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"); - - final int W_130__79596987_C = 79596987; - final int W_128__79596980_A = 79596980; - - returnValueNull =segment110.addPTWayMember(131); assertNull(returnValueNull); - RouteSegmentToExtract segment111 = segment110.addPTWayMember(130); - extractAndAssertValues(130, segment110, segment111, cloneOfBus600RouteRelation, - W_131__79596982_A, W_132__79596974_B, - W_130__79596987_C, null, - null, - "3;333;334;335;433;600;630"); - final int W_127_Tiensevest_79193579_A = 79193579; - - for (int n = 129; n >= 128; n--) {returnValueNull =segment111.addPTWayMember(n); assertNull(returnValueNull);} - RouteSegmentToExtract segment112 = segment111.addPTWayMember(127); - extractAndAssertValues(127, segment111, segment112, cloneOfBus600RouteRelation, - W_128__79596980_A, W_130__79596987_C, - W_127_Tiensevest_79193579_A, "Tiensevest", - null, - "3;333;334;335;513;600;630"); - - final int W_126_Tiensevest_258936980_A = 258936980; - - RouteSegmentToExtract segment113 = segment112.addPTWayMember(126); - extractAndAssertValues(126, segment112, segment113, cloneOfBus600RouteRelation, - W_127_Tiensevest_79193579_A, W_127_Tiensevest_79193579_A, - W_126_Tiensevest_258936980_A, "Tiensevest", - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"); - - final int W_125_Tiensevest_79193580_A = 79193580; - - RouteSegmentToExtract segment114 = segment113.addPTWayMember(125); - extractAndAssertValues(125, segment113, segment114, cloneOfBus600RouteRelation, - W_126_Tiensevest_258936980_A, W_126_Tiensevest_258936980_A, - W_125_Tiensevest_79193580_A, "Tiensevest", - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"); - - final int W_124_Tiensevest_79193581_A = 79193581; - - RouteSegmentToExtract segment115 = segment114.addPTWayMember(124); - extractAndAssertValues(124, segment114, segment115, cloneOfBus600RouteRelation, - W_125_Tiensevest_79193580_A, W_125_Tiensevest_79193580_A, - W_124_Tiensevest_79193581_A, "Tiensevest", - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - - final int W_123_Tiensevest_78815505_A = 78815505; - - RouteSegmentToExtract segment116 = segment115.addPTWayMember(123); - extractAndAssertValues(123, segment115, segment116, cloneOfBus600RouteRelation, - W_124_Tiensevest_79193581_A, W_124_Tiensevest_79193581_A, - W_123_Tiensevest_78815505_A, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - - final int W_122_Tiensevest_84696751_B = 84696751; - final int W_121_Tiensevest_79265237_A = 79265237; - - RouteSegmentToExtract segment117 = segment116.addPTWayMember(122); - extractAndAssertValues(122, segment116, segment117, cloneOfBus600RouteRelation, - W_123_Tiensevest_78815505_A, W_123_Tiensevest_78815505_A, - W_122_Tiensevest_84696751_B, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - - final int W_120_Tiensevest_89574079_B = 89574079; - final int W_119_Tiensevest_81522744_A = 81522744; - - final int W_118_Tiensevest_19793223_B = 19793223; - final int W_117_Tiensevest_185988814_A = 185988814; - - for (int n = 121; n >= 121; n--) {returnValueNull =segment117.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment118 = segment117.addPTWayMember(120); - extractAndAssertValues(120, segment117, segment118, cloneOfBus600RouteRelation, - W_121_Tiensevest_79265237_A, W_122_Tiensevest_84696751_B, - W_120_Tiensevest_89574079_B, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"); - - final int W_116_Tiensevest_185988816_B = 185988816; - final int W_115_Tiensevest_15083398_A = 15083398; - - for (int n = 119; n >= 119; n--) {returnValueNull =segment118.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment119a = segment118.addPTWayMember(118); - extractAndAssertValues(118, segment118, segment119a, cloneOfBus600RouteRelation, - W_119_Tiensevest_81522744_A, W_120_Tiensevest_89574079_B, - W_118_Tiensevest_19793223_B, "Tiensevest", - null, - "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"); - - for (int n = 117; n >= 117; n--) {returnValueNull =segment119a.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment119b = segment119a.addPTWayMember(116); - extractAndAssertValues(116, segment119a, segment119b, cloneOfBus600RouteRelation, - W_117_Tiensevest_185988814_A, W_118_Tiensevest_19793223_B, - W_116_Tiensevest_185988816_B, "Tiensevest", - null, - "1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630"); - - final int W_114_Tiensevest_8154434_E = 8154434; - final int W_110_Tiensevest_521193611_A = 521193611; - - returnValueNull =segment119b.addPTWayMember(115); assertNull(returnValueNull); - RouteSegmentToExtract segment120 = segment119b.addPTWayMember(114); - extractAndAssertValues(114, segment119b, segment120, cloneOfBus600RouteRelation, - W_115_Tiensevest_15083398_A, W_116_Tiensevest_185988816_B, - W_114_Tiensevest_8154434_E, "Tiensevest", - null, - "7;8;9;18;179;306 (student);337;380;600;616;630"); - - final int W_109_Tiensepoort_4003928_G = 4003928; - final int W_103_Geldenaaksevest_199381120_A = 199381120; - - for (int n = 113; n >= 110; n--) {returnValueNull =segment120.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment121 = segment120.addPTWayMember(109); - extractAndAssertValues(109, segment120, segment121, cloneOfBus600RouteRelation, - W_110_Tiensevest_521193611_A, W_114_Tiensevest_8154434_E, - W_109_Tiensepoort_4003928_G, "Tiensepoort", - null, - "7;8;9;18;178;179;306 (student);337;380;600;616;630"); - - final int W_102_Geldenaaksevest_3991775_E = 3991775; - final int W_99_Erasme_Ruelensvest_608715579_A = 608715579; - - for (int n = 108; n >= 103; n--) {returnValueNull =segment121.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment122 = segment121.addPTWayMember(102); - extractAndAssertValues(102, segment121, segment122, cloneOfBus600RouteRelation, - W_103_Geldenaaksevest_199381120_A, W_109_Tiensepoort_4003928_G, - W_102_Geldenaaksevest_3991775_E, "Geldenaaksevest", - null, - "18;178;179;306 (student);337;600;616;630"); - - final int W_98_Erasme_Ruelensvest_3677822_B = 3677822; - final int W_97_Tervuursevest_120086003_A = 120086003; - - for (int n = 100; n >= 99; n--) {returnValueNull =segment122.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment123 = segment122.addPTWayMember(98); - extractAndAssertValues(98, segment122, segment123, cloneOfBus600RouteRelation, - W_99_Erasme_Ruelensvest_608715579_A, W_102_Geldenaaksevest_3991775_E, - W_98_Erasme_Ruelensvest_3677822_B, "Erasme Ruelensvest", - null, - "18;178;179;306 (student);337;600;616"); - - final int W_96_Tervuursevest_90168774_F = 90168774; - final int W_92_Tervuursevest_85044922_A = 85044922; - - final int W_91_Tervuursevest_16771611_A = 16771611; - - returnValueNull =segment123.addPTWayMember(97); assertNull(String.format("%d %s%s\n", 97, rc, cloneOfBus600RouteRelation.getMember(97).getMember().getId()), returnValueNull); - RouteSegmentToExtract segment125 = segment123.addPTWayMember(96); - extractAndAssertValues(96, segment123, segment125, cloneOfBus600RouteRelation, - W_97_Tervuursevest_120086003_A, W_98_Erasme_Ruelensvest_3677822_B, - W_96_Tervuursevest_90168774_F, "Tervuursevest", - null, - "178;179;306 (student);600"); - - for (int n = 95; n >= 92; n--) {returnValueNull =segment125.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment127 = segment125.addPTWayMember(91); - extractAndAssertValues(91, segment125, segment127, cloneOfBus600RouteRelation, - W_92_Tervuursevest_85044922_A, W_96_Tervuursevest_90168774_F, - W_91_Tervuursevest_16771611_A, "Tervuursevest", - null, - "178;179;306 (student);520;524;525;537;586;600"); - - final int W_90_Tervuursevest_13246158_A = 13246158; - - final int W_89_Tervuursevest_260405216_B = 260405216; - final int W_88_Tervuursevest_16771609_A = 16771609; - - RouteSegmentToExtract segment128 = segment127.addPTWayMember(90); - extractAndAssertValues(90, segment127, segment128, cloneOfBus600RouteRelation, - W_91_Tervuursevest_16771611_A, W_91_Tervuursevest_16771611_A, - W_90_Tervuursevest_13246158_A, "Tervuursevest", - null, - "178;520;524;525;537;586;600"); - - final int W_87_Tervuursevest_608715518_J = 608715518; - final int W_78_Tervuursevest_3677945_A = 3677945; - - RouteSegmentToExtract segment129 = segment128.addPTWayMember(89); - extractAndAssertValues(89, segment128, segment129, cloneOfBus600RouteRelation, - W_90_Tervuursevest_13246158_A, W_90_Tervuursevest_13246158_A, - W_89_Tervuursevest_260405216_B, "Tervuursevest", - null, - "7;8;9;178;520;524;525;527;537;586;600"); - - for (int n = 88; n >= 88; n--) {returnValueNull =segment129.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment130 = segment129.addPTWayMember(87); - extractAndAssertValues(87, segment129, segment130, cloneOfBus600RouteRelation, - W_88_Tervuursevest_16771609_A, W_89_Tervuursevest_260405216_B, - W_87_Tervuursevest_608715518_J, "Tervuursevest", - null, - "7;8;9;178;527;600"); - - final int W_77_Rennes_Singel_192559627_E = 192559627; - final int W_73_Rennes_Singel_28982660_A = 28982660; - - final int W_72_Herestraat_78568455_A = 78568455; - - for (int n = 86; n >= 78; n--) {returnValueNull =segment130.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment131 = segment130.addPTWayMember(77); - extractAndAssertValues(77, segment130, segment131, cloneOfBus600RouteRelation, - W_78_Tervuursevest_3677945_A, W_87_Tervuursevest_608715518_J, - W_77_Rennes_Singel_192559627_E, "Rennes-Singel", - null, - "178;600"); - - final int W_71_Herestraat_813970227_C = 813970227; - final int W_69_Herestraat_8079995_A = 8079995; - - for (int n = 76; n >= 73; n--) {returnValueNull =segment131.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment132 = segment131.addPTWayMember(72); - extractAndAssertValues(72, segment131, segment132, cloneOfBus600RouteRelation, - W_73_Rennes_Singel_28982660_A, W_77_Rennes_Singel_192559627_E, - W_72_Herestraat_78568455_A, "Herestraat", - null, - "178;318;600"); - - final int W_68_Rotonde_Het_Teken_41403538_B = 41403538; - final int W_67_Ring_Zuid_79340950_A = 79340950; - - RouteSegmentToExtract segment133 = segment132.addPTWayMember(71); - extractAndAssertValues(71, segment132, segment133, cloneOfBus600RouteRelation, - W_72_Herestraat_78568455_A, W_72_Herestraat_78568455_A, - W_71_Herestraat_813970227_C, "Herestraat", - null, - "600"); - - for (int n = 70; n >= 69; n--) {returnValueNull =segment133.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, cloneOfBus600RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment134 = segment133.addPTWayMember(68); - extractAndAssertValues(68, segment133, segment134, cloneOfBus600RouteRelation, - W_69_Herestraat_8079995_A, W_71_Herestraat_813970227_C, - W_68_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", - null, - "410;600;601"); - - final int W_66_Ring_Zuid_11369123_A = 11369123; - - for (int n = 67; n >= 67; n--) {returnValueNull =segment134.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment135 = segment134.addPTWayMember(66); - extractAndAssertValues(66, segment134, segment135, cloneOfBus600RouteRelation, - W_67_Ring_Zuid_79340950_A, W_68_Rotonde_Het_Teken_41403538_B, - W_66_Ring_Zuid_11369123_A, "Ring Zuid", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_65__159949154_A = 159949154; - - final int W_64__332258104_B = 332258104; - final int W_63__78852604_A = 78852604; - - RouteSegmentToExtract segment136 = segment135.addPTWayMember(65); - extractAndAssertValues(65, segment135, segment136, cloneOfBus600RouteRelation, - W_66_Ring_Zuid_11369123_A, W_66_Ring_Zuid_11369123_A, - W_65__159949154_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - RouteSegmentToExtract segment137 = segment136.addPTWayMember(64); - extractAndAssertValues(64, segment136, segment137, cloneOfBus600RouteRelation, - W_65__159949154_A, W_65__159949154_A, - W_64__332258104_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_62__14508735_A = 14508735; - - for (int n = 63; n >= 63; n--) {returnValueNull =segment137.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment138 = segment137.addPTWayMember(62); - extractAndAssertValues(62, segment137, segment138, cloneOfBus600RouteRelation, - W_63__78852604_A, W_64__332258104_B, - W_62__14508735_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_61__318878531_B = 318878531; - final int W_60__14506241_A = 14506241; - - RouteSegmentToExtract segment139 = segment138.addPTWayMember(61); - extractAndAssertValues(61, segment138, segment139, cloneOfBus600RouteRelation, - W_62__14508735_A, W_62__14508735_A, - W_61__318878531_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600"); - - final int W_59_Ring_Zuid_109267436_A = 109267436; - - for (int n = 60; n >= 60; n--) {returnValueNull =segment139.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment142 = segment139.addPTWayMember(59); - extractAndAssertValues(59, segment139, segment142, cloneOfBus600RouteRelation, - W_60__14506241_A, W_61__318878531_B, - W_59_Ring_Zuid_109267436_A, "Ring Zuid", - null, - "3;317;395;410;600"); - - final int W_58_Ring_Zuid_14508739_A = 14508739; - - RouteSegmentToExtract segment143 = segment142.addPTWayMember(58); - extractAndAssertValues(58, segment142, segment143, cloneOfBus600RouteRelation, - W_59_Ring_Zuid_109267436_A, W_59_Ring_Zuid_109267436_A, - W_58_Ring_Zuid_14508739_A, "Ring Zuid", - null, - "3;317;395;410;600;601"); - - final int W_57_Ring_Zuid_14508740_A = 14508740; - - RouteSegmentToExtract segment144 = segment143.addPTWayMember(57); - extractAndAssertValues(57, segment143, segment144, cloneOfBus600RouteRelation, - W_58_Ring_Zuid_14508739_A, W_58_Ring_Zuid_14508739_A, - W_57_Ring_Zuid_14508740_A, "Ring Zuid", - null, - "3;317;334;335;395;410;600;601"); - - final int W_56_Ring_Zuid_502328838_D = 502328838; - final int W_53_Rotonde_Het_Teken_78568660_A = 78568660; - - RouteSegmentToExtract segment145 = segment144.addPTWayMember(56); - extractAndAssertValues(56, segment144, segment145, cloneOfBus600RouteRelation, - W_57_Ring_Zuid_14508740_A, W_57_Ring_Zuid_14508740_A, - W_56_Ring_Zuid_502328838_D, "Ring Zuid", - null, - "3;317;334;335;380;395;410;600;601"); - - final int W_52_Rotonde_Het_Teken_78873921_A = 78873921; - - for (int n = 55; n >= 53; n--) {returnValueNull =segment145.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment146 = segment145.addPTWayMember(52); - extractAndAssertValues(52, segment145, segment146, cloneOfBus600RouteRelation, - W_53_Rotonde_Het_Teken_78568660_A, W_56_Ring_Zuid_502328838_D, - W_52_Rotonde_Het_Teken_78873921_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - final int W_51_Rotonde_Het_Teken_3752557_A = 3752557; - - RouteSegmentToExtract segment148 = segment146.addPTWayMember(51); - extractAndAssertValues(51, segment146, segment148, cloneOfBus600RouteRelation, - W_52_Rotonde_Het_Teken_78873921_A, W_52_Rotonde_Het_Teken_78873921_A, - W_51_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - final int W_50_Rotonde_Het_Teken_249333188_A = 249333188; - - RouteSegmentToExtract segment149 = segment148.addPTWayMember(50); - extractAndAssertValues(50, segment148, segment149, cloneOfBus600RouteRelation, - W_51_Rotonde_Het_Teken_3752557_A, W_51_Rotonde_Het_Teken_3752557_A, - W_50_Rotonde_Het_Teken_249333188_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - final int W_49_Rotonde_Het_Teken_249333187_A = 249333187; - - RouteSegmentToExtract segment150 = segment149.addPTWayMember(49); - extractAndAssertValues(49, segment149, segment150, cloneOfBus600RouteRelation, - W_50_Rotonde_Het_Teken_249333188_A, W_50_Rotonde_Het_Teken_249333188_A, - W_49_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", - null, - "3;410;600;601"); - - final int W_48_Herestraat_13067134_D = 13067134; - final int W_45_Herestraat_813970228_A = 813970228; - - RouteSegmentToExtract segment151 = segment150.addPTWayMember(48); - extractAndAssertValues(48, segment150, segment151, cloneOfBus600RouteRelation, - W_49_Rotonde_Het_Teken_249333187_A, W_49_Rotonde_Het_Teken_249333187_A, - W_48_Herestraat_13067134_D, "Herestraat", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - final int W_44_Herestraat_270181177_A = 270181177; - - for (int n = 47; n >= 45; n--) {returnValueNull =segment151.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment152 = segment151.addPTWayMember(44); - extractAndAssertValues(44, segment151, segment152, cloneOfBus600RouteRelation, - W_45_Herestraat_813970228_A, W_48_Herestraat_13067134_D, - W_44_Herestraat_270181177_A, "Herestraat", - null, - "410;600;601"); - - final int W_43_Rennes_Singel_78568454_B = 78568454; - final int W_42_Rennes_Singel_225605633_A = 225605633; - - RouteSegmentToExtract segment153 = segment152.addPTWayMember(43); - extractAndAssertValues(43, segment152, segment153, cloneOfBus600RouteRelation, - W_44_Herestraat_270181177_A, W_44_Herestraat_270181177_A, - W_43_Rennes_Singel_78568454_B, "Rennes-Singel", - null, - "410;600"); - - final int W_41_Rennes_Singel_8131123_D = 8131123; - final int W_38_Den_Boschsingel_23837543_A = 23837543; - - for (int n = 42; n >= 42; n--) {returnValueNull =segment153.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment154 = segment153.addPTWayMember(41); - extractAndAssertValues(41, segment153, segment154, cloneOfBus600RouteRelation, - W_42_Rennes_Singel_225605633_A, W_43_Rennes_Singel_78568454_B, - W_41_Rennes_Singel_8131123_D, "Rennes-Singel", - null, - "178;318;410;600"); - - final int W_37_Den_Boschsingel_146171867_D = 146171867; - final int W_34_Lüdenscheidsingel_85048201_A = 85048201; - - for (int n = 40; n >= 38; n--) {returnValueNull =segment154.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment155 = segment154.addPTWayMember(37); - extractAndAssertValues(37, segment154, segment155, cloneOfBus600RouteRelation, - W_38_Den_Boschsingel_23837543_A, W_41_Rennes_Singel_8131123_D, - W_37_Den_Boschsingel_146171867_D, "Den Boschsingel", - null, - "318;410;600"); - - final int W_33_Lüdenscheidsingel_12891213_D = 12891213; - final int W_30_Joanna_Maria_Artoisplein_61540098_A = 61540098; - - for (int n = 36; n >= 34; n--) {returnValueNull =segment155.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment156 = segment155.addPTWayMember(33); - extractAndAssertValues(33, segment155, segment156, cloneOfBus600RouteRelation, - W_34_Lüdenscheidsingel_85048201_A, W_37_Den_Boschsingel_146171867_D, - W_33_Lüdenscheidsingel_12891213_D, "Lüdenscheidsingel", - null, - "318;410;600;651;658"); - - final int W_29_Joanna_Maria_Artoisplein_254801390_B = 254801390; - final int W_28_Joanna_Maria_Artoisplein_61540068_A = 61540068; - - for (int n = 32; n >= 30; n--) {returnValueNull =segment156.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment157 = segment156.addPTWayMember(29); - extractAndAssertValues(29, segment156, segment157, cloneOfBus600RouteRelation, - W_30_Joanna_Maria_Artoisplein_61540098_A, W_33_Lüdenscheidsingel_12891213_D, - W_29_Joanna_Maria_Artoisplein_254801390_B, "Joanna-Maria Artoisplein", - null, - "178;305;318;410;600;651;652;658"); - - final int W_27_Vuurkruisenlaan_23691160_C = 23691160; - final int W_25_Diestsepoort_8109264_A = 8109264; - - for (int n = 28; n >= 28; n--) {returnValueNull =segment157.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment158 = segment157.addPTWayMember(27); - extractAndAssertValues(27, segment157, segment158, cloneOfBus600RouteRelation, - W_28_Joanna_Maria_Artoisplein_61540068_A, W_29_Joanna_Maria_Artoisplein_254801390_B, - W_27_Vuurkruisenlaan_23691160_C, "Vuurkruisenlaan", - null, - "178;305;318;333;334;335;410;513;600;630;651;652;658"); - - final int W_24_Diestsepoort_61556877_D = 61556877; - final int W_21_Diestsepoort_584356745_A = 584356745; - - for (int n = 26; n >= 25; n--) {returnValueNull =segment158.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment159 = segment158.addPTWayMember(24); - extractAndAssertValues(24, segment158, segment159, cloneOfBus600RouteRelation, - W_25_Diestsepoort_8109264_A, W_27_Vuurkruisenlaan_23691160_C, - W_24_Diestsepoort_61556877_D, "Diestsepoort", - null, - "305;333;334;335;513;600;630;651;652;658"); - - final int W_20_Diestsepoort_198559166_E = 198559166; - final int W_16_Diestsepoort_451873774_A = 451873774; - - for (int n = 23; n >= 21; n--) {returnValueNull =segment159.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment160 = segment159.addPTWayMember(20); - extractAndAssertValues(20, segment159, segment160, cloneOfBus600RouteRelation, - W_21_Diestsepoort_584356745_A, W_24_Diestsepoort_61556877_D, - W_20_Diestsepoort_198559166_E, "Diestsepoort", - null, - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"); - - final int W_15_Diestsepoort_116797180_B = 116797180; - final int W_14_Diestsepoort_23691157_A = 23691157; - - for (int n = 19; n >= 16; n--) {returnValueNull =segment160.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment161 = segment160.addPTWayMember(15); - extractAndAssertValues(15, segment160, segment161, cloneOfBus600RouteRelation, - W_16_Diestsepoort_451873774_A, W_20_Diestsepoort_198559166_E, - W_15_Diestsepoort_116797180_B, "Diestsepoort", - null, - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"); - - final int W_13_p12_to_Diestsepoort_78815527_B = 78815527; - final int W_12_perron_12_377918658_A = 377918658; - - for (int n = 15; n >= 14; n--) {returnValueNull =segment161.addPTWayMember(n); assertNull(n + " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way" + cloneOfBus600RouteRelation.getMember(n).getMember().getId() + "\n", returnValueNull);} - RouteSegmentToExtract segment162 = segment161.addPTWayMember(13); - extractAndAssertValues(13, segment161, segment162, cloneOfBus600RouteRelation, - W_14_Diestsepoort_23691157_A, W_15_Diestsepoort_116797180_B, - W_13_p12_to_Diestsepoort_78815527_B, null, - null, - "4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658"); - - RouteSegmentToExtract segment163 = segment162.addPTWayMember(12); - extractAndAssertValues(12, segment162, segment163, cloneOfBus600RouteRelation, - W_12_perron_12_377918658_A, W_13_p12_to_Diestsepoort_78815527_B, - 0, null, - null, - "395;600;651;652"); + expectedValues = Arrays.asList( + new Val( 169, 608715622, 608715622, 608715622, "Engels Plein"), + new Val( 168, 338057819, 608715622, 338057819, "Engels Plein"), + new Val( 167, 305316104, 608715622, 305316104, "Engels Plein"), + new Val( 166, 3869812, 608715622, 3869812, "Engels Plein"), + new Val( 165, 25928482, 608715622, 25928482, "Wolvengang"), + new Val( 164, 659297690, 608715622, 659297690, "Wolvengang"), + new Val( 163, 330300723, 608715622, 330300723, "Achter de latten"), + new Val( 162, 3869822, 608715622, 3869822, "Burchtstraat"), + new Val( 161, 330300725, 608715622, 330300725, "Havenkant"), + new Val( 160, 270181176, 608715622, 270181176, "Havenkant"), + new Val( 159, 406205781, 608715622, 406205781, "Havenkant"), + new Val( 158, 843534478, 608715622, 843534478, "Havenkant"), + new Val( 157, 314635787, 608715622, 314635787, "Havenkant"), + new Val( 156, 510790348, 608715622, 510790348, "Havenkant"), + new Val( 155, 29283599, 608715622, 29283599, "Havenkant"), + + new Val( 154, 29283599, 608715622, 304241968, "Havenkant", + "Havenkant - Engels Plein (600)", + "600"), + + new Val( 153, 304241967, 304241968, 304241967, "Aarschotsesteenweg"), + + new Val( 152, 304241967, 304241968, 340265961, "Redersstraat", + "Aarschotsesteenweg - Havenkant (334;335;513;600;630)", + "334;335;513;600;630"), + + new Val( 151, 318825613, 340265961, 318825613, "Redersstraat"), + + new Val( 150, 318825613, 340265961, 340265962, "Redersstraat", + "Redersstraat (600)", + "600"), + + + new Val( 149, 340265962, 340265962, 254801390, "Joanna-Maria Artoisplein", + "Redersstraat (333;334;335;513;600;630)", + "333;334;335;513;600;630"), + + new Val( 148, 61540068, 254801390, 61540068, "Joanna-Maria Artoisplein"), + + new Val( 147, 61540068, 254801390, 23691160, "Vuurkruisenlaan", + "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)", + "178;305;318;333;334;335;410;513;600;630;651;652;658"), + + new Val( 146, 4061640, 23691160, 4061640, "Vuurkruisenlaan"), + new Val( 145, 8109264, 23691160, 8109264, "Diestsepoort"), + + new Val( 144, 8109264, 23691160, 61556877, "Diestsepoort", + "Diestsepoort - Vuurkruisenlaan (305;333;334;335;513;600;630;651;652;658)", + "305;333;334;335;513;600;630;651;652;658"), + + new Val( 143, 663770966, 61556877, 663770966, "Diestsepoort"), + new Val( 142, 584356749, 61556877, 584356749, "Diestsepoort"), + new Val( 141, 584356745, 61556877, 584356745, "Diestsepoort"), + + new Val( 140, 584356745, 61556877, 198559166, "Diestsepoort", + "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + + new Val( 139, 584356751, 198559166, 584356751, "Diestsepoort"), + new Val( 138, 451873773, 198559166, 451873773, "Diestsepoort"), + new Val( 137, 584356742, 198559166, 584356742, "Diestsepoort"), + new Val( 136, 451873774, 198559166, 451873774, "Diestsepoort"), + + new Val( 135, 451873774, 198559166, 76867049, null, + "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + + new Val( 134, 79264890, 76867049, 79264890, null), + new Val( 133, 79596965, 76867049, 79596965, null), + + new Val( 132, 79596965, 76867049, 79596974, null, + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + + new Val( 131, 79596982, 79596974, 79596982, null), + + new Val( 130, 79596982, 79596974, 79596987, null, + "perron 11 & 12 (3;333;334;335;433;600;630)", + "3;333;334;335;433;600;630"), + + new Val( 129, 377918658, 79596987, 377918658, null), + new Val( 128, 79596980, 79596987, 79596980, null), + + new Val( 127, 79596980, 79596987, 79193579, "Tiensevest", + "perron 11 & 12 (3;333;334;335;513;600;630)", + "3;333;334;335;513;600;630"), + + + new Val( 126, 79193579, 79193579, 258936980, "Tiensevest", + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"), + + + new Val( 125, 258936980, 258936980, 79193580, "Tiensevest", + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"), + + + new Val( 124, 79193580, 79193580, 79193581, "Tiensevest", + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + + new Val( 123, 79193581, 79193581, 78815505, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + + new Val( 122, 78815505, 78815505, 84696751, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + new Val( 121, 79265237, 84696751, 79265237, "Tiensevest"), + + new Val( 120, 79265237, 84696751, 89574079, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"), + + new Val( 119, 81522744, 89574079, 81522744, "Tiensevest"), + + new Val( 118, 81522744, 89574079, 19793223, "Tiensevest", + "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", + "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"), + + new Val( 117, 185988814, 19793223, 185988814, "Tiensevest"), + + new Val( 116, 185988814, 19793223, 185988816, "Tiensevest", + "Tiensevest (1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630)", + "1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630"), + + new Val( 115, 15083398, 185988816, 15083398, "Tiensevest"), + + new Val( 114, 15083398, 185988816, 8154434, "Tiensevest", + "Tiensevest (7;8;9;18;179;306 (student);337;380;600;616;630)", + "7;8;9;18;179;306 (student);337;380;600;616;630"), + + new Val( 113, 4003927, 8154434, 4003927, "Tiensevest"), + new Val( 112, 521193609, 8154434, 521193609, "Tiensevest"), + new Val( 111, 586268892, 8154434, 586268892, "Tiensevest"), + new Val( 110, 521193611, 8154434, 521193611, "Tiensevest"), + + new Val( 109, 521193611, 8154434, 4003928, "Tiensepoort", + "Tiensevest (7;8;9;18;178;179;306 (student);337;380;600;616;630)", + "7;8;9;18;178;179;306 (student);337;380;600;616;630"), + + new Val( 108, 8130905, 4003928, 8130905, "Geldenaaksevest"), + new Val( 107, 24905256, 4003928, 24905256, "Geldenaaksevest"), + new Val( 106, 24905255, 4003928, 24905255, "Geldenaaksevest"), + new Val( 105, 491728135, 4003928, 491728135, "Geldenaaksevest"), + new Val( 104, 24905254, 4003928, 24905254, "Geldenaaksevest"), + new Val( 103, 199381120, 4003928, 199381120, "Geldenaaksevest"), + + new Val( 102, 199381120, 4003928, 3991775, "Geldenaaksevest", + "Geldenaaksevest - Tiensepoort (18;178;179;306 (student);337;600;616;630)", + "18;178;179;306 (student);337;600;616;630"), + + new Val( 101, 120086001, 3991775, 120086001, "Erasme Ruelensvest"), + new Val( 100, 608715575, 3991775, 608715575, "Erasme Ruelensvest"), + new Val( 99, 608715579, 3991775, 608715579, "Erasme Ruelensvest"), + + new Val( 98, 608715579, 3991775, 3677822, "Erasme Ruelensvest", + "Erasme Ruelensvest - Geldenaaksevest (18;178;179;306 (student);337;600;616)", + "18;178;179;306 (student);337;600;616"), + + new Val( 97, 120086003, 3677822, 120086003, "Tervuursevest"), + + new Val( 96, 120086003, 3677822, 90168774, "Tervuursevest", + "Tervuursevest - Erasme Ruelensvest (178;179;306 (student);600)", + "178;179;306 (student);600"), + + new Val( 95, 3677329, 90168774, 3677329, "Tervuursevest"), + new Val( 94, 608715614, 90168774, 608715614, "Tervuursevest"), + new Val( 93, 608715615, 90168774, 608715615, "Tervuursevest"), + new Val( 92, 85044922, 90168774, 85044922, "Tervuursevest"), + + new Val( 91, 85044922, 90168774, 16771611, "Tervuursevest", + "Tervuursevest (178;179;306 (student);520;524;525;537;586;600)", + "178;179;306 (student);520;524;525;537;586;600"), + + + new Val( 90, 16771611, 16771611, 13246158, "Tervuursevest", + "Tervuursevest (178;520;524;525;537;586;600)", + "178;520;524;525;537;586;600"), + + + new Val( 89, 13246158, 13246158, 260405216, "Tervuursevest", + "Tervuursevest (7;8;9;178;520;524;525;527;537;586;600)", + "7;8;9;178;520;524;525;527;537;586;600"), + + new Val( 88, 16771609, 260405216, 16771609, "Tervuursevest"), + + new Val( 87, 16771609, 260405216, 608715518, "Tervuursevest", + "Tervuursevest (7;8;9;178;527;600)", + "7;8;9;178;527;600"), + + new Val( 86, 608715519, 608715518, 608715519, "Tervuursevest"), + new Val( 85, 3677336, 608715518, 3677336, "Tervuursevest"), + new Val( 84, 15051052, 608715518, 15051052, "Tervuursevest"), + new Val( 83, 814322832, 608715518, 814322832, "Tervuursevest"), + new Val( 82, 80194318, 608715518, 80194318, "Tervuursevest"), + new Val( 81, 813979466, 608715518, 813979466, "Tervuursevest"), + new Val( 80, 521193382, 608715518, 521193382, "Tervuursevest"), + new Val( 79, 521193383, 608715518, 521193383, "Tervuursevest"), + new Val( 78, 3677945, 608715518, 3677945, "Tervuursevest"), + + new Val( 77, 3677945, 608715518, 192559627, "Rennes-Singel", + "Tervuursevest (178;600)", + "178;600"), + + new Val( 76, 813979469, 192559627, 813979469, "Rennes-Singel"), + new Val( 75, 192559626, 192559627, 192559626, "Rennes-Singel"), + new Val( 74, 813979473, 192559627, 813979473, "Rennes-Singel"), + new Val( 73, 28982660, 192559627, 28982660, "Rennes-Singel"), + + new Val( 72, 28982660, 192559627, 78568455, "Herestraat", + "Rennes-Singel (178;318;600)", + "178;318;600"), + + + new Val( 71, 78568455, 78568455, 813970227, "Herestraat", + "Herestraat (600)", + "600"), + + new Val( 70, 41403544, 813970227, 41403544, "Herestraat"), + new Val( 69, 8079995, 813970227, 8079995, "Herestraat"), + + new Val( 68, 8079995, 813970227, 41403538, "Rotonde Het Teken", + "Herestraat (410;600;601)", + "410;600;601"), + + new Val( 67, 79340950, 41403538, 79340950, "Ring Zuid"), + + new Val( 66, 79340950, 41403538, 11369123, "Ring Zuid", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 65, 11369123, 11369123, 159949154, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 64, 159949154, 159949154, 332258104, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 63, 78852604, 332258104, 78852604, null), + + new Val( 62, 78852604, 332258104, 14508735, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 61, 14508735, 14508735, 318878531, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600"), + + new Val( 60, 14506241, 318878531, 14506241, null), + + new Val( 59, 14506241, 318878531, 109267436, "Ring Zuid", + "(3;317;395;410;600)", + "3;317;395;410;600"), + + + new Val( 58, 109267436, 109267436, 14508739, "Ring Zuid", + "Ring Zuid (3;317;395;410;600;601)", + "3;317;395;410;600;601"), + + + new Val( 57, 14508739, 14508739, 14508740, "Ring Zuid", + "Ring Zuid (3;317;334;335;395;410;600;601)", + "3;317;334;335;395;410;600;601"), + + + new Val( 56, 14508740, 14508740, 502328838, "Ring Zuid", + "Ring Zuid (3;317;334;335;380;395;410;600;601)", + "3;317;334;335;380;395;410;600;601"), + + new Val( 55, 502328837, 502328838, 502328837, "Ring Zuid"), + new Val( 54, 8080023, 502328838, 8080023, "Ring Zuid"), + new Val( 53, 78568660, 502328838, 78568660, "Rotonde Het Teken"), + + new Val( 52, 78568660, 502328838, 78873921, "Rotonde Het Teken", + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 51, 78873921, 78873921, 3752557, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 50, 3752557, 3752557, 249333188, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 49, 249333188, 249333188, 249333187, "Rotonde Het Teken", + "Rotonde Het Teken (3;410;600;601)", + "3;410;600;601"), + + + new Val( 48, 249333187, 249333187, 13067134, "Herestraat", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 47, 813970232, 13067134, 813970232, "Herestraat"), + new Val( 46, 813970226, 13067134, 813970226, "Herestraat"), + new Val( 45, 813970228, 13067134, 813970228, "Herestraat"), + + new Val( 44, 813970228, 13067134, 270181177, "Herestraat", + "Herestraat (410;600;601)", + "410;600;601"), + + + new Val( 43, 270181177, 270181177, 78568454, "Rennes-Singel", + "Herestraat (410;600)", + "410;600"), + + new Val( 42, 225605633, 78568454, 225605633, "Rennes-Singel"), + + new Val( 41, 225605633, 78568454, 8131123, "Rennes-Singel", + "Rennes-Singel (178;318;410;600)", + "178;318;410;600"), + + new Val( 40, 3680457, 8131123, 3680457, "Rennes-Singel"), + new Val( 39, 192559625, 8131123, 192559625, "Den Boschsingel"), + new Val( 38, 23837543, 8131123, 23837543, "Den Boschsingel"), + + new Val( 37, 23837543, 8131123, 146171867, "Den Boschsingel", + "Den Boschsingel - Rennes-Singel (318;410;600)", + "318;410;600"), + + new Val( 36, 125835586, 146171867, 125835586, "Den Boschsingel"), + new Val( 35, 3877104, 146171867, 3877104, null), + new Val( 34, 85048201, 146171867, 85048201, "Lüdenscheidsingel"), + + new Val( 33, 85048201, 146171867, 12891213, "Lüdenscheidsingel", + "Lüdenscheidsingel - Den Boschsingel (318;410;600;651;658)", + "318;410;600;651;658"), + + new Val( 32, 44932919, 12891213, 44932919, "Lüdenscheidsingel"), + new Val( 31, 8131040, 12891213, 8131040, "Lüdenscheidsingel"), + new Val( 30, 61540098, 12891213, 61540098, "Joanna-Maria Artoisplein"), + + new Val( 29, 61540098, 12891213, 254801390, "Joanna-Maria Artoisplein", + "Joanna-Maria Artoisplein - Lüdenscheidsingel (178;305;318;410;600;651;652;658)", + "178;305;318;410;600;651;652;658"), + + new Val( 28, 61540068, 254801390, 61540068, "Joanna-Maria Artoisplein"), + + new Val( 27, 61540068, 254801390, 23691160, "Vuurkruisenlaan", + "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)", + "178;305;318;333;334;335;410;513;600;630;651;652;658"), + + new Val( 26, 4061640, 23691160, 4061640, "Vuurkruisenlaan"), + new Val( 25, 8109264, 23691160, 8109264, "Diestsepoort"), + + new Val( 24, 8109264, 23691160, 61556877, "Diestsepoort", + "Diestsepoort - Vuurkruisenlaan (305;333;334;335;513;600;630;651;652;658)", + "305;333;334;335;513;600;630;651;652;658"), + + new Val( 23, 663770966, 61556877, 663770966, "Diestsepoort"), + new Val( 22, 584356749, 61556877, 584356749, "Diestsepoort"), + new Val( 21, 584356745, 61556877, 584356745, "Diestsepoort"), + + new Val( 20, 584356745, 61556877, 198559166, "Diestsepoort", + "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + + new Val( 19, 584356751, 198559166, 584356751, "Diestsepoort"), + new Val( 18, 451873773, 198559166, 451873773, "Diestsepoort"), + new Val( 17, 584356742, 198559166, 584356742, "Diestsepoort"), + new Val( 16, 451873774, 198559166, 451873774, "Diestsepoort"), + + new Val( 15, 451873774, 198559166, 116797180, "Diestsepoort", + "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + + new Val( 14, 23691157, 116797180, 23691157, "Diestsepoort"), + + new Val( 13, 23691157, 116797180, 78815527, null, + "Diestsepoort (4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658)", + "4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658"), + + new Val( 12, 377918658, 78815527, 377918658, null), + + new Val( 11, 377918658, 78815527, 377918658, null, + "perron 11 & 12 (395;600;651;652)", + "395;600;651;652") + ); + previousSegment = new RouteSegmentToExtract(cloneOfBus600RouteRelation); + previousSegment.setActiveDataSet(ds); + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, cloneOfBus600RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + } + + System.out.print("\n"); // *********************************************************** // Line 3 has the particularity that there are 2 variants @@ -1349,69 +1043,324 @@ public void bus601_600_3_Test() { assertEquals("", segment201.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment201.getWayMembers()); - final int W_194_Dorpskring_27684829_D = 27684829; - final int W_191_Dorpskring_112917099_A = 112917099; - - final int W_190_Dorpskring_125835538_A = 125835538; - - final int W_189_Bollenberg_81197019_Z = 81197019; - final int W_179_Kapelstraat_16377612_A = 16377612; - - final int W_178_Lostraat_40189518_Z = 40189518; - final int W_130_Oude_Diestsesteenweg_10230617_A = 10230617; - - final int W_129_Diestsesteenweg_23707243_A = 23707243; - - final int W_128_Diestsesteenweg_23707244_B = 23707244; - final int W_127_Diestsesteenweg_12715116_A = 12715116; - - final int W_126_Diestsepoort_61556877_D = 61556877; - - for (int n = 194; n >= 191; n--) {returnValueNull =segment201.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment202 = segment201.addPTWayMember(190); - extractAndAssertValues(190, segment201, segment202, bus3_GHB_Lubbeek_RouteRelation, - W_191_Dorpskring_112917099_A, W_194_Dorpskring_27684829_D, - W_190_Dorpskring_125835538_A, "Dorpskring", - null, - "3"); - - RouteSegmentToExtract segment203 = segment202.addPTWayMember(189); - extractAndAssertValues(189, segment202, segment203, bus3_GHB_Lubbeek_RouteRelation, - W_190_Dorpskring_125835538_A, W_190_Dorpskring_125835538_A, - W_189_Bollenberg_81197019_Z, "Bollenberg", - null, - "3;373;485"); - - for (int n = 188; n >= 179; n--) {returnValueNull =segment203.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment204 = segment203.addPTWayMember(178); - extractAndAssertValues(178, segment203, segment204, bus3_GHB_Lubbeek_RouteRelation, - W_179_Kapelstraat_16377612_A, W_189_Bollenberg_81197019_Z, - W_178_Lostraat_40189518_Z, "Lostraat", - null, - "3"); - - for (int n = 177; n >= 130; n--) {returnValueNull =segment204.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment205 = segment204.addPTWayMember(129); - extractAndAssertValues(129, segment204, segment205, bus3_GHB_Lubbeek_RouteRelation, - W_130_Oude_Diestsesteenweg_10230617_A, W_178_Lostraat_40189518_Z, - W_129_Diestsesteenweg_23707243_A, "Diestsesteenweg", - null, - "3"); - - RouteSegmentToExtract segment206 = segment205.addPTWayMember(128); - extractAndAssertValues(128, segment205, segment206, bus3_GHB_Lubbeek_RouteRelation, - W_129_Diestsesteenweg_23707243_A, W_129_Diestsesteenweg_23707243_A, - W_128_Diestsesteenweg_23707244_B, "Diestsesteenweg", - null, - "3;370;371;373;374;475;485;524;525"); - - for (int n = 127; n >= 127; n--) {returnValueNull =segment206.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment207 = segment206.addPTWayMember(126); - extractAndAssertValues(126, segment206, segment207, bus3_GHB_Lubbeek_RouteRelation, - W_127_Diestsesteenweg_12715116_A, W_128_Diestsesteenweg_23707244_B, - W_126_Diestsepoort_61556877_D, "Diestsepoort", - null, - "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"); + expectedValues = Arrays.asList( + new Val( 194, 27684829, 27684829, 27684829, "Dorpskring"), + new Val( 193, 349396917, 27684829, 349396917, "Dorpskring"), + new Val( 192, 349396921, 27684829, 349396921, "Dorpskring"), + new Val( 191, 112917099, 27684829, 112917099, "Dorpskring"), + + new Val( 190, 112917099, 27684829, 125835538, "Dorpskring", + "Dorpskring (3)", + "3"), + + + new Val( 189, 125835538, 125835538, 81197019, "Bollenberg", + "Dorpskring (3;373;485)", + "3;373;485"), + + new Val( 188, 112917100, 81197019, 112917100, "Bollenberg"), + new Val( 187, 694551612, 81197019, 694551612, "Bollenberg"), + new Val( 186, 645048305, 81197019, 645048305, "Bollenberg"), + new Val( 185, 27688813, 81197019, 27688813, "Bollenberg"), + new Val( 184, 232474772, 81197019, 232474772, "Lubbeekstraat"), + new Val( 183, 10658839, 81197019, 10658839, "Lubbeekstraat"), + new Val( 182, 319269331, 81197019, 319269331, "Kapelstraat"), + new Val( 181, 636950670, 81197019, 636950670, "Kapelstraat"), + new Val( 180, 16377722, 81197019, 16377722, "Kapelstraat"), + new Val( 179, 16377612, 81197019, 16377612, "Kapelstraat"), + + new Val( 178, 16377612, 81197019, 40189518, "Lostraat", + "Kapelstraat - Bollenberg (3)", + "3"), + + new Val( 177, 351196789, 40189518, 351196789, "Lostraat"), + new Val( 176, 350992067, 40189518, 350992067, "Lostraat"), + new Val( 175, 636491595, 40189518, 636491595, "Lostraat"), + new Val( 174, 636491594, 40189518, 636491594, "Lostraat"), + new Val( 173, 124913579, 40189518, 124913579, "Lostraat"), + new Val( 172, 10672044, 40189518, 10672044, "Lostraat"), + new Val( 171, 633919766, 40189518, 633919766, "Lostraat"), + new Val( 170, 10672080, 40189518, 10672080, "Heidebergstraat"), + new Val( 169, 10672083, 40189518, 10672083, "Heidebergstraat"), + new Val( 168, 79801761, 40189518, 79801761, "Heidebergstraat"), + new Val( 167, 112917249, 40189518, 112917249, "Heidebergstraat"), + new Val( 166, 112917247, 40189518, 112917247, "Heidebergstraat"), + new Val( 165, 192706264, 40189518, 192706264, "Heidebergstraat"), + new Val( 164, 318216944, 40189518, 318216944, "Heidebergstraat"), + new Val( 163, 192706265, 40189518, 192706265, "Heidebergstraat"), + new Val( 162, 586861164, 40189518, 586861164, "Heidebergstraat"), + new Val( 161, 10672031, 40189518, 10672031, "Heidebergstraat"), + new Val( 160, 10672135, 40189518, 10672135, "Koetsweg"), + new Val( 159, 608754691, 40189518, 608754691, "Koetsweg"), + new Val( 158, 608754692, 40189518, 608754692, "Koetsweg"), + new Val( 157, 10672174, 40189518, 10672174, "Gaston Eyskenslaan"), + new Val( 156, 23436182, 40189518, 23436182, "Platte-Lostraat"), + new Val( 155, 112917234, 40189518, 112917234, "Duivenstraat"), + new Val( 154, 23707216, 40189518, 23707216, "Duivenstraat"), + new Val( 153, 608754700, 40189518, 608754700, "Lijsterlaan"), + new Val( 152, 10672177, 40189518, 10672177, "Lijsterlaan"), + new Val( 151, 112917228, 40189518, 112917228, "Prins Regentplein"), + new Val( 150, 112917229, 40189518, 112917229, "Prins Regentplein"), + new Val( 149, 10672178, 40189518, 10672178, "Prins Regentplein"), + new Val( 148, 10657957, 40189518, 10657957, "Prins-Regentlaan"), + new Val( 147, 25155107, 40189518, 25155107, "Willem Coosemansstraat"), + new Val( 146, 79784138, 40189518, 79784138, "Koning Albertlaan"), + new Val( 145, 23707241, 40189518, 23707241, "Koning Albertlaan"), + new Val( 144, 112917227, 40189518, 112917227, "Koning Albertlaan"), + new Val( 143, 101619135, 40189518, 101619135, "Koning Albertlaan"), + new Val( 142, 622063635, 40189518, 622063635, "Koning Albertlaan"), + new Val( 141, 622063636, 40189518, 622063636, "Koning Albertlaan"), + new Val( 140, 101619136, 40189518, 101619136, "Koning Albertlaan"), + new Val( 139, 16377030, 40189518, 16377030, "Martelarenlaan"), + new Val( 138, 485802425, 40189518, 485802425, "Spoordijk"), + new Val( 137, 23707242, 40189518, 23707242, "Martelarenlaan"), + new Val( 136, 608715582, 40189518, 608715582, "Martelarenlaan"), + new Val( 135, 608715584, 40189518, 608715584, "Martelarenlaan"), + new Val( 134, 284832275, 40189518, 284832275, "Martelarenlaan"), + new Val( 133, 608715586, 40189518, 608715586, "Martelarenlaan"), + new Val( 132, 608715590, 40189518, 608715590, "Martelarenlaan"), + new Val( 131, 3992546, 40189518, 3992546, "Martelarenlaan"), + new Val( 130, 10230617, 40189518, 10230617, "Oude Diestsesteenweg"), + + new Val( 129, 10230617, 40189518, 23707243, "Diestsesteenweg", + "Oude Diestsesteenweg - Lostraat (3)", + "3"), + + + new Val( 128, 23707243, 23707243, 23707244, "Diestsesteenweg", + "Diestsesteenweg (3;370;371;373;374;475;485;524;525)", + "3;370;371;373;374;475;485;524;525"), + + new Val( 127, 12715116, 23707244, 12715116, "Diestsesteenweg"), + + new Val( 126, 12715116, 23707244, 61556877, "Diestsepoort", + "Diestsesteenweg (2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", + "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + + new Val( 125, 663770966, 61556877, 663770966, "Diestsepoort"), + new Val( 124, 584356749, 61556877, 584356749, "Diestsepoort"), + new Val( 123, 584356745, 61556877, 584356745, "Diestsepoort"), + + new Val( 122, 584356745, 61556877, 198559166, "Diestsepoort", + "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + + new Val( 121, 584356751, 198559166, 584356751, "Diestsepoort"), + new Val( 120, 451873773, 198559166, 451873773, "Diestsepoort"), + new Val( 119, 584356742, 198559166, 584356742, "Diestsepoort"), + new Val( 118, 451873774, 198559166, 451873774, "Diestsepoort"), + + new Val( 117, 451873774, 198559166, 76867049, null, + "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + + new Val( 116, 79264890, 76867049, 79264890, null), + new Val( 115, 79596965, 76867049, 79596965, null), + + new Val( 114, 79596965, 76867049, 71754927, null, + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + + + new Val( 113, 71754927, 71754927, 79264897, null, + "(2;3;310;370;371;373;374;475;485;513;520;524;525)", + "2;3;310;370;371;373;374;475;485;513;520;524;525"), + + new Val( 112, 79596983, 79264897, 79596983, null), + new Val( 111, 377918665, 79264897, 377918665, null), + + new Val( 110, 377918665, 79264897, 78815513, null, + "perron 7 & 8 (2;3;310)", + "2;3;310"), + + new Val( 109, 377918666, 78815513, 377918666, null), + new Val( 108, 79596978, 78815513, 79596978, null), + + new Val( 107, 79596978, 78815513, 79193581, "Tiensevest", + "perron 7 & 8 (2;3)", + "2;3"), + + + new Val( 106, 79193581, 79193581, 78815505, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + + new Val( 105, 78815505, 78815505, 84696751, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + new Val( 104, 79265237, 84696751, 79265237, "Tiensevest"), + + new Val( 103, 79265237, 84696751, 89574079, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"), + + new Val( 102, 81522744, 89574079, 81522744, "Tiensevest"), + + new Val( 101, 81522744, 89574079, 305434579, "Bondgenotenlaan", + "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", + "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"), + + new Val( 100, 578662093, 305434579, 578662093, "Bondgenotenlaan"), + new Val( 99, 578662092, 305434579, 578662092, "Bondgenotenlaan"), + new Val( 98, 578662095, 305434579, 578662095, "Bondgenotenlaan"), + new Val( 97, 578662094, 305434579, 578662094, "Bondgenotenlaan"), + new Val( 96, 3991636, 305434579, 3991636, "Bondgenotenlaan"), + new Val( 95, 174985125, 305434579, 174985125, "Rector De Somerplein"), + new Val( 94, 521211977, 305434579, 521211977, "Rector De Somerplein"), + + new Val( 93, 521211977, 305434579, 521211976, "Rector De Somerplein", + "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), + + new Val( 92, 16771741, 521211976, 16771741, "Rector De Somerplein"), + + new Val( 91, 16771741, 521211976, 3991635, "Margarethaplein", + "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), + + new Val( 90, 521211973, 3991635, 521211973, "Margarethaplein"), + new Val( 89, 608715546, 3991635, 608715546, "Margarethaplein"), + new Val( 88, 453538107, 3991635, 453538107, "Margarethaplein"), + new Val( 87, 80194313, 3991635, 80194313, "Mathieu de Layensplein"), + new Val( 86, 293288706, 3991635, 293288706, "Mathieu de Layensplein"), + new Val( 85, 10269271, 3991635, 10269271, "Dirk Boutslaan"), + new Val( 84, 578662072, 3991635, 578662072, "Dirk Boutslaan"), + new Val( 83, 608715541, 3991635, 608715541, "Dirk Boutslaan"), + new Val( 82, 293149632, 3991635, 293149632, "Dirk Boutslaan"), + new Val( 81, 3992578, 3991635, 3992578, "Dirk Boutslaan"), + new Val( 80, 438252643, 3991635, 438252643, "Dirk Boutslaan"), + new Val( 79, 284664268, 3991635, 284664268, "Brouwersstraat"), + + new Val( 78, 284664268, 3991635, 608715545, "Brouwersstraat", + "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", + "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + + new Val( 77, 608715543, 608715545, 608715543, "Brouwersstraat"), + new Val( 76, 608715542, 608715545, 608715542, "Brouwersstraat"), + new Val( 75, 608715544, 608715545, 608715544, "Brouwersstraat"), + new Val( 74, 284664272, 608715545, 284664272, "Brouwersstraat"), + + new Val( 73, 284664272, 608715545, 147856945, "Tessenstraat - Fonteinstraat", + "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", + "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + + new Val( 72, 123929547, 147856945, 123929547, "Kapucijnenvoer"), + + new Val( 71, 123929547, 147856945, 3358673, "Biezenstraat", + "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", + "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + + new Val( 70, 578662071, 3358673, 578662071, "Sint-Jacobsplein"), + new Val( 69, 521211966, 3358673, 521211966, "Sint-Jacobsplein"), + new Val( 68, 3358671, 3358673, 3358671, "Sint-Jacobsplein"), + new Val( 67, 123929615, 3358673, 123929615, "Sint-Hubertusstraat"), + + new Val( 66, 123929615, 3358673, 189453003, "Monseigneur Van Waeyenberghlaan", + "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)", + "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513"), + + new Val( 65, 79289753, 189453003, 79289753, "Monseigneur Van Waeyenberghlaan"), + new Val( 64, 189453004, 189453003, 189453004, "Monseigneur Van Waeyenberghlaan"), + new Val( 63, 189453002, 189453003, 189453002, "Monseigneur Van Waeyenberghlaan"), + new Val( 62, 189453001, 189453003, 189453001, "Monseigneur Van Waeyenberghlaan"), + new Val( 61, 810592121, 189453003, 810592121, "Monseigneur Van Waeyenberghlaan"), + new Val( 60, 249333181, 189453003, 249333181, "Monseigneur Van Waeyenberghlaan"), + + new Val( 59, 249333181, 189453003, 249333187, "Rotonde Het Teken", + "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)", + "3;317;333;334;335;370;371;373;374;380;395;513"), + + + new Val( 58, 249333187, 249333187, 813970230, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 57, 41403540, 813970230, 41403540, "Rotonde Het Teken"), + + new Val( 56, 41403540, 813970230, 41403538, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)", + "3;317;333;334;335;370;371;373;374;380;395;513"), + + new Val( 55, 79340950, 41403538, 79340950, "Ring Zuid"), + + new Val( 54, 79340950, 41403538, 11369123, "Ring Zuid", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 53, 11369123, 11369123, 159949154, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 52, 159949154, 159949154, 332258104, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 51, 78852604, 332258104, 78852604, null), + + new Val( 50, 78852604, 332258104, 14508735, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 49, 14508735, 14508735, 318878531, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600"), + + new Val( 48, 14506241, 318878531, 14506241, null), + + new Val( 47, 14506241, 318878531, 109267436, "Ring Zuid", + "(3;317;395;410;600)", + "3;317;395;410;600"), + + + new Val( 46, 109267436, 109267436, 14508739, "Ring Zuid", + "Ring Zuid (3;317;395;410;600;601)", + "3;317;395;410;600;601"), + + + new Val( 45, 14508739, 14508739, 14508740, "Ring Zuid", + "Ring Zuid (3;317;334;335;395;410;600;601)", + "3;317;334;335;395;410;600;601"), + + + new Val( 44, 14508740, 14508740, 502328838, "Ring Zuid", + "Ring Zuid (3;317;334;335;380;395;410;600;601)", + "3;317;334;335;380;395;410;600;601"), + + new Val( 43, 502328837, 502328838, 502328837, "Ring Zuid"), + new Val( 42, 8080023, 502328838, 8080023, "Ring Zuid"), + new Val( 41, 78568660, 502328838, 78568660, "Rotonde Het Teken"), + + new Val( 40, 78568660, 502328838, 15945426, "Ring Noord", + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + new Val( 39, 502317795, 15945426, 502317795, "Ring Noord"), + new Val( 38, 810580948, 15945426, 810580948, "Ring Noord"), + new Val( 37, 502317796, 15945426, 502317796, "Ring Noord"), + new Val( 36, 112917238, 15945426, 112917238, "Ring Noord"), + new Val( 35, 608754690, 15945426, 608754690, "Ring Noord"), + new Val( 34, 377918625, 15945426, 377918625, "Ring Noord"), + + new Val( 33, 377918625, 15945426, 377918625, "Ring Noord", + "Ring Noord (3)", + "3") + ); previousSegment = new RouteSegmentToExtract(bus3_GHB_Lubbeek_RouteRelation); + previousSegment.setActiveDataSet(ds); + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, bus3_GHB_Lubbeek_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + } + + System.out.print("\n"); // *********************************************************** // Line 3 has the particularity that there are 2 variants @@ -1435,435 +1384,368 @@ public void bus601_600_3_Test() { assertEquals("", segment301.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment301.getWayMembers()); - final int W_217_Dorpskring_27684829_D = 27684829; - final int W_214_Dorpskring_112917099_A = 112917099; + expectedValues = Arrays.asList( + new Val( 217, 27684829, 27684829, 27684829, "Dorpskring"), + new Val( 216, 349396917, 27684829, 349396917, "Dorpskring"), + new Val( 215, 349396921, 27684829, 349396921, "Dorpskring"), + new Val( 214, 112917099, 27684829, 112917099, "Dorpskring"), + + new Val( 213, 112917099, 27684829, 125835538, "Dorpskring", + "Dorpskring (3)", + "3"), + + + new Val( 212, 125835538, 125835538, 81197019, "Bollenberg", + "Dorpskring (3;373;485)", + "3;373;485"), + + new Val( 211, 112917100, 81197019, 112917100, "Bollenberg"), + new Val( 210, 694551612, 81197019, 694551612, "Bollenberg"), + new Val( 209, 645048305, 81197019, 645048305, "Bollenberg"), + new Val( 208, 27688813, 81197019, 27688813, "Bollenberg"), + new Val( 207, 232474772, 81197019, 232474772, "Lubbeekstraat"), + new Val( 206, 10658839, 81197019, 10658839, "Lubbeekstraat"), + new Val( 205, 319269331, 81197019, 319269331, "Kapelstraat"), + new Val( 204, 636950670, 81197019, 636950670, "Kapelstraat"), + new Val( 203, 16377722, 81197019, 16377722, "Kapelstraat"), + new Val( 202, 16377612, 81197019, 16377612, "Kapelstraat"), + + new Val( 201, 16377612, 81197019, 112917224, "Ganzendries", + "Kapelstraat - Bollenberg (3)", + "3"), + + new Val( 200, 319264895, 112917224, 319264895, "Ganzendries"), + new Val( 199, 27682732, 112917224, 27682732, "Sint Barbaradreef"), + new Val( 198, 527248228, 112917224, 527248228, null), + new Val( 197, 27686451, 112917224, 27686451, null), + new Val( 196, 847554912, 112917224, 847554912, null), + + new Val( 195, 847554912, 112917224, 27686453, null, + "Sint Barbaradreef - Ganzendries (3)", + "3"), + + new Val( 194, 110643012, 27686453, 110643012, null), + new Val( 193, 112917220, 27686453, 112917220, null), + new Val( 192, 70869366, 27686453, 70869366, null), + new Val( 191, 27682735, 27686453, 27682735, null), + new Val( 190, 319269351, 27686453, 319269351, "Sint Barbaradreef"), + new Val( 189, 112917225, 27686453, 112917225, "Sint Barbaradreef"), + + new Val( 188, 112917225, 27686453, 847554912, null, + "Sint Barbaradreef (3)", + "3"), + + new Val( 187, 27686451, 847554912, 27686451, null), + new Val( 186, 527248228, 847554912, 527248228, null), + new Val( 185, 27682732, 847554912, 27682732, "Sint Barbaradreef"), + new Val( 184, 319264895, 847554912, 319264895, "Ganzendries"), + new Val( 183, 112917224, 847554912, 112917224, "Ganzendries"), + + new Val( 182, 112917224, 847554912, 40189518, "Lostraat", + "Ganzendries - Sint Barbaradreef (3)", + "3"), + + new Val( 181, 351196789, 40189518, 351196789, "Lostraat"), + new Val( 180, 350992067, 40189518, 350992067, "Lostraat"), + new Val( 179, 636491595, 40189518, 636491595, "Lostraat"), + new Val( 178, 636491594, 40189518, 636491594, "Lostraat"), + new Val( 177, 124913579, 40189518, 124913579, "Lostraat"), + new Val( 176, 10672044, 40189518, 10672044, "Lostraat"), + new Val( 175, 633919766, 40189518, 633919766, "Lostraat"), + new Val( 174, 10672080, 40189518, 10672080, "Heidebergstraat"), + new Val( 173, 10672083, 40189518, 10672083, "Heidebergstraat"), + new Val( 172, 79801761, 40189518, 79801761, "Heidebergstraat"), + new Val( 171, 112917249, 40189518, 112917249, "Heidebergstraat"), + new Val( 170, 112917247, 40189518, 112917247, "Heidebergstraat"), + new Val( 169, 192706264, 40189518, 192706264, "Heidebergstraat"), + new Val( 168, 318216944, 40189518, 318216944, "Heidebergstraat"), + new Val( 167, 192706265, 40189518, 192706265, "Heidebergstraat"), + new Val( 166, 586861164, 40189518, 586861164, "Heidebergstraat"), + new Val( 165, 10672031, 40189518, 10672031, "Heidebergstraat"), + new Val( 164, 10672135, 40189518, 10672135, "Koetsweg"), + new Val( 163, 608754691, 40189518, 608754691, "Koetsweg"), + new Val( 162, 608754692, 40189518, 608754692, "Koetsweg"), + new Val( 161, 10672174, 40189518, 10672174, "Gaston Eyskenslaan"), + new Val( 160, 23436182, 40189518, 23436182, "Platte-Lostraat"), + new Val( 159, 112917234, 40189518, 112917234, "Duivenstraat"), + new Val( 158, 23707216, 40189518, 23707216, "Duivenstraat"), + new Val( 157, 608754700, 40189518, 608754700, "Lijsterlaan"), + new Val( 156, 10672177, 40189518, 10672177, "Lijsterlaan"), + new Val( 155, 112917228, 40189518, 112917228, "Prins Regentplein"), + new Val( 154, 112917229, 40189518, 112917229, "Prins Regentplein"), + new Val( 153, 10672178, 40189518, 10672178, "Prins Regentplein"), + new Val( 152, 10657957, 40189518, 10657957, "Prins-Regentlaan"), + new Val( 151, 25155107, 40189518, 25155107, "Willem Coosemansstraat"), + new Val( 150, 79784138, 40189518, 79784138, "Koning Albertlaan"), + new Val( 149, 23707241, 40189518, 23707241, "Koning Albertlaan"), + new Val( 148, 112917227, 40189518, 112917227, "Koning Albertlaan"), + new Val( 147, 101619135, 40189518, 101619135, "Koning Albertlaan"), + new Val( 146, 622063635, 40189518, 622063635, "Koning Albertlaan"), + new Val( 145, 622063636, 40189518, 622063636, "Koning Albertlaan"), + new Val( 144, 101619136, 40189518, 101619136, "Koning Albertlaan"), + new Val( 143, 16377030, 40189518, 16377030, "Martelarenlaan"), + new Val( 142, 485802425, 40189518, 485802425, "Spoordijk"), + new Val( 141, 23707242, 40189518, 23707242, "Martelarenlaan"), + new Val( 140, 608715582, 40189518, 608715582, "Martelarenlaan"), + new Val( 139, 608715584, 40189518, 608715584, "Martelarenlaan"), + new Val( 138, 284832275, 40189518, 284832275, "Martelarenlaan"), + new Val( 137, 608715586, 40189518, 608715586, "Martelarenlaan"), + new Val( 136, 608715590, 40189518, 608715590, "Martelarenlaan"), + new Val( 135, 3992546, 40189518, 3992546, "Martelarenlaan"), + new Val( 134, 10230617, 40189518, 10230617, "Oude Diestsesteenweg"), + + new Val( 133, 10230617, 40189518, 23707243, "Diestsesteenweg", + "Oude Diestsesteenweg - Lostraat (3)", + "3"), + + + new Val( 132, 23707243, 23707243, 23707244, "Diestsesteenweg", + "Diestsesteenweg (3;370;371;373;374;475;485;524;525)", + "3;370;371;373;374;475;485;524;525"), + + new Val( 131, 12715116, 23707244, 12715116, "Diestsesteenweg"), + + new Val( 130, 12715116, 23707244, 61556877, "Diestsepoort", + "Diestsesteenweg (2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", + "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + + new Val( 129, 663770966, 61556877, 663770966, "Diestsepoort"), + new Val( 128, 584356749, 61556877, 584356749, "Diestsepoort"), + new Val( 127, 584356745, 61556877, 584356745, "Diestsepoort"), + + new Val( 126, 584356745, 61556877, 198559166, "Diestsepoort", + "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + + new Val( 125, 584356751, 198559166, 584356751, "Diestsepoort"), + new Val( 124, 451873773, 198559166, 451873773, "Diestsepoort"), + new Val( 123, 584356742, 198559166, 584356742, "Diestsepoort"), + new Val( 122, 451873774, 198559166, 451873774, "Diestsepoort"), + + new Val( 121, 451873774, 198559166, 76867049, null, + "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + + new Val( 120, 79264890, 76867049, 79264890, null), + new Val( 119, 79596965, 76867049, 79596965, null), + + new Val( 118, 79596965, 76867049, 79596974, null, + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + + new Val( 117, 79596982, 79596974, 79596982, null), + + new Val( 116, 79596982, 79596974, 79596987, null, + "perron 11 & 12 (3;333;334;335;433;600;630)", + "3;333;334;335;433;600;630"), + + new Val( 115, 377918658, 79596987, 377918658, null), + new Val( 114, 79596980, 79596987, 79596980, null), + + new Val( 113, 79596980, 79596987, 79193579, "Tiensevest", + "perron 11 & 12 (3;333;334;335;513;600;630)", + "3;333;334;335;513;600;630"), + + + new Val( 112, 79193579, 79193579, 258936980, "Tiensevest", + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"), + + + new Val( 111, 258936980, 258936980, 79193580, "Tiensevest", + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"), + + + new Val( 110, 79193580, 79193580, 79193581, "Tiensevest", + "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + + new Val( 109, 79193581, 79193581, 78815505, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + + new Val( 108, 78815505, 78815505, 84696751, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + + new Val( 107, 79265237, 84696751, 79265237, "Tiensevest"), + + new Val( 106, 79265237, 84696751, 89574079, "Tiensevest", + "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", + "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"), - final int W_213_Dorpskring_125835538_A = 125835538; + new Val( 105, 81522744, 89574079, 81522744, "Tiensevest"), - final int W_212_Bollenberg_81197019_Z = 81197019; - final int W_202_Kapelstraat_16377612_A = 16377612; + new Val( 104, 81522744, 89574079, 305434579, "Bondgenotenlaan", + "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", + "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"), - final int W_201_Ganzendries_112917224_F = 112917224; - final int W_196__847554912_A = 847554912; + new Val( 103, 578662093, 305434579, 578662093, "Bondgenotenlaan"), + new Val( 102, 578662092, 305434579, 578662092, "Bondgenotenlaan"), + new Val( 101, 578662095, 305434579, 578662095, "Bondgenotenlaan"), + new Val( 100, 578662094, 305434579, 578662094, "Bondgenotenlaan"), + new Val( 99, 3991636, 305434579, 3991636, "Bondgenotenlaan"), + new Val( 98, 174985125, 305434579, 174985125, "Rector De Somerplein"), + new Val( 97, 521211977, 305434579, 521211977, "Rector De Somerplein"), - final int W_195__27686453_G = 27686453; - final int W_189__112917225_A = 112917225; + new Val( 96, 521211977, 305434579, 521211976, "Rector De Somerplein", + "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), - final int W_188__847554912_F = 847554912; - final int W_183_Ganzendries_112917224_A = 112917224; + new Val( 95, 16771741, 521211976, 16771741, "Rector De Somerplein"), - final int W_182_Lostraat_40189518_Z = 40189518; - final int W_134_Oude_Diestsesteenweg_10230617_A = 10230617; + new Val( 94, 16771741, 521211976, 3991635, "Margarethaplein", + "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), - final int W_133_Diestsesteenweg_23707243_A = 23707243; + new Val( 93, 521211973, 3991635, 521211973, "Margarethaplein"), + new Val( 92, 608715546, 3991635, 608715546, "Margarethaplein"), + new Val( 91, 453538107, 3991635, 453538107, "Margarethaplein"), + new Val( 90, 80194313, 3991635, 80194313, "Mathieu de Layensplein"), + new Val( 89, 293288706, 3991635, 293288706, "Mathieu de Layensplein"), + new Val( 88, 10269271, 3991635, 10269271, "Dirk Boutslaan"), + new Val( 87, 578662072, 3991635, 578662072, "Dirk Boutslaan"), + new Val( 86, 608715541, 3991635, 608715541, "Dirk Boutslaan"), + new Val( 85, 293149632, 3991635, 293149632, "Dirk Boutslaan"), + new Val( 84, 3992578, 3991635, 3992578, "Dirk Boutslaan"), + new Val( 83, 438252643, 3991635, 438252643, "Dirk Boutslaan"), + new Val( 82, 284664268, 3991635, 284664268, "Brouwersstraat"), - final int W_132_Diestsesteenweg_23707244_B = 23707244; - final int W_131_Diestsesteenweg_12715116_A = 12715116; + new Val( 81, 284664268, 3991635, 608715545, "Brouwersstraat", + "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", + "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), - final int W_130_Diestsepoort_61556877_D = 61556877; - final int W_127_Diestsepoort_584356745_A = 584356745; + new Val( 80, 608715543, 608715545, 608715543, "Brouwersstraat"), + new Val( 79, 608715542, 608715545, 608715542, "Brouwersstraat"), + new Val( 78, 608715544, 608715545, 608715544, "Brouwersstraat"), + new Val( 77, 284664272, 608715545, 284664272, "Brouwersstraat"), - final int W_126_Diestsepoort_198559166_E = 198559166; - final int W_122_Diestsepoort_451873774_A = 451873774; + new Val( 76, 284664272, 608715545, 147856945, "Tessenstraat - Fonteinstraat", + "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", + "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), - final int W_121__76867049_C = 76867049; - final int W_119__79596965_A = 79596965; + new Val( 75, 123929547, 147856945, 123929547, "Kapucijnenvoer"), - final int W_118__79596974_B = 79596974; - final int W_117__79596982_A = 79596982; + new Val( 74, 123929547, 147856945, 3358673, "Biezenstraat", + "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", + "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), - final int W_116__79596987_C = 79596987; - final int W_114__79596980_A = 79596980; + new Val( 73, 578662071, 3358673, 578662071, "Sint-Jacobsplein"), + new Val( 72, 521211966, 3358673, 521211966, "Sint-Jacobsplein"), + new Val( 71, 3358671, 3358673, 3358671, "Sint-Jacobsplein"), + new Val( 70, 123929615, 3358673, 123929615, "Sint-Hubertusstraat"), - final int W_113_Tiensevest_79193579_A = 79193579; + new Val( 69, 123929615, 3358673, 189453003, "Monseigneur Van Waeyenberghlaan", + "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)", + "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513"), - final int W_112_Tiensevest_258936980_A = 258936980; + new Val( 68, 79289753, 189453003, 79289753, "Monseigneur Van Waeyenberghlaan"), + new Val( 67, 189453004, 189453003, 189453004, "Monseigneur Van Waeyenberghlaan"), + new Val( 66, 189453002, 189453003, 189453002, "Monseigneur Van Waeyenberghlaan"), + new Val( 65, 189453001, 189453003, 189453001, "Monseigneur Van Waeyenberghlaan"), + new Val( 64, 810592121, 189453003, 810592121, "Monseigneur Van Waeyenberghlaan"), + new Val( 63, 249333181, 189453003, 249333181, "Monseigneur Van Waeyenberghlaan"), - final int W_111_Tiensevest_79193580_A = 79193580; + new Val( 62, 249333181, 189453003, 249333187, "Rotonde Het Teken", + "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)", + "3;317;333;334;335;370;371;373;374;380;395;513"), - final int W_110_Tiensevest_79193581_A = 79193581; - final int W_109_Tiensevest_78815505_A = 78815505; + new Val( 61, 249333187, 249333187, 813970230, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - final int W_108_Tiensevest_84696751_B = 84696751; - final int W_107_Tiensevest_79265237_A = 79265237; + new Val( 60, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - final int W_106_Tiensevest_89574079_B = 89574079; - final int W_105_Tiensevest_81522744_A = 81522744; + new Val( 59, 41403540, 813970230, 41403538, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)", + "3;317;333;334;335;370;371;373;374;380;395;513"), - final int W_104_Bondgenotenlaan_305434579_H = 305434579; - final int W_97_Rector_De_Somerplein_521211977_A = 521211977; + new Val( 58, 79340950, 41403538, 79340950, "Ring Zuid"), - final int W_96_Rector_De_Somerplein_521211976_B = 521211976; - final int W_95_Rector_De_Somerplein_16771741_A = 16771741; + new Val( 57, 79340950, 41403538, 11369123, "Ring Zuid", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - final int W_94_Margarethaplein_3991635_M = 3991635; - final int W_82_Brouwersstraat_284664268_A = 284664268; - final int W_81_Brouwersstraat_608715545_E = 608715545; - final int W_77_Brouwersstraat_284664272_A = 284664272; + new Val( 56, 11369123, 11369123, 159949154, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - final int W_76_Tessenstraat___Fonteinstraat_147856945_B = 147856945; - final int W_75_Kapucijnenvoer_123929547_A = 123929547; - final int W_74_Biezenstraat_3358673_E = 3358673; - final int W_70_Sint_Hubertusstraat_123929615_A = 123929615; + new Val( 55, 159949154, 159949154, 332258104, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - final int W_69_Monseigneur_Van_Waeyenberghlaan_189453003_G = 189453003; - final int W_63_Monseigneur_Van_Waeyenberghlaan_249333181_A = 249333181; + new Val( 54, 78852604, 332258104, 78852604, null), - final int W_62_Rotonde_Het_Teken_249333187_A = 249333187; - final int W_61_Rotonde_Het_Teken_813970230_B = 813970230; + new Val( 53, 78852604, 332258104, 14508735, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - final int W_60_Rotonde_Het_Teken_41403540_A = 41403540; - final int W_59_Rotonde_Het_Teken_41403538_B = 41403538; - final int W_58_Ring_Zuid_79340950_A = 79340950; + new Val( 52, 14508735, 14508735, 109267438, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600"), - final int W_57_Ring_Zuid_11369123_A = 11369123; - final int W_56__159949154_A = 159949154; + new Val( 51, 109267438, 109267438, 318878532, null, + "(3;333;334;335;370;371;373;374;380;513)", + "3;333;334;335;370;371;373;374;380;513"), - final int W_55__332258104_B = 332258104; - final int W_54__78852604_A = 78852604; - final int W_53__14508735_A = 14508735; + new Val( 50, 318878532, 318878532, 100687528, null, + "(3;333;334;335;513)", + "3;333;334;335;513"), - final int W_52__109267438_A = 109267438; - final int W_51__318878532_A = 318878532; + new Val( 49, 100687528, 100687528, 14508739, "Ring Zuid", + "(3;334;335)", + "3;334;335"), - final int W_50__100687528_A = 100687528; - final int W_49_Ring_Zuid_14508739_A = 14508739; + new Val( 48, 14508739, 14508739, 14508740, "Ring Zuid", + "Ring Zuid (3;317;334;335;395;410;600;601)", + "3;317;334;335;395;410;600;601"), - final int W_48_Ring_Zuid_14508740_A = 14508740; - final int W_47_Ring_Zuid_502328838_D = 502328838; - final int W_44_Rotonde_Het_Teken_78568660_A = 78568660; + new Val( 47, 14508740, 14508740, 502328838, "Ring Zuid", + "Ring Zuid (3;317;334;335;380;395;410;600;601)", + "3;317;334;335;380;395;410;600;601"), - final int W_43_Ring_Noord_15945426_G = 15945426; - final int W_37_Ring_Noord_377918625_A = 377918625; + new Val( 46, 502328837, 502328838, 502328837, "Ring Zuid"), + new Val( 45, 8080023, 502328838, 8080023, "Ring Zuid"), + new Val( 44, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - for (int n = 217; n >= 214; n--) {returnValueNull =segment301.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment302 = segment301.addPTWayMember(213); - extractAndAssertValues(213, segment301, segment302, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_214_Dorpskring_112917099_A, W_217_Dorpskring_27684829_D, - W_213_Dorpskring_125835538_A, "Dorpskring", - null, - "3"); - - RouteSegmentToExtract segment303 = segment302.addPTWayMember(212); - extractAndAssertValues(212, segment302, segment303, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_213_Dorpskring_125835538_A, W_213_Dorpskring_125835538_A, - W_212_Bollenberg_81197019_Z, "Bollenberg", - null, - "3;373;485"); - - for (int n = 211; n >= 202; n--) {returnValueNull =segment303.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment304 = segment303.addPTWayMember(201); - extractAndAssertValues(201, segment303, segment304, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_202_Kapelstraat_16377612_A, W_212_Bollenberg_81197019_Z, - W_201_Ganzendries_112917224_F, "Ganzendries", - null, - "3"); - - for (int n = 200; n >= 196; n--) {returnValueNull =segment304.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment305 = segment304.addPTWayMember(195); - extractAndAssertValues(195, segment304, segment305, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_196__847554912_A, W_201_Ganzendries_112917224_F, - W_195__27686453_G, null, - null, - "3"); - - for (int n = 194; n >= 189; n--) {returnValueNull =segment305.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment306 = segment305.addPTWayMember(188); - extractAndAssertValues(188, segment305, segment306, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_189__112917225_A, W_195__27686453_G, - W_188__847554912_F, null, - null, - "3"); - - for (int n = 187; n >= 183; n--) {returnValueNull =segment306.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment307 = segment306.addPTWayMember(182); - extractAndAssertValues(182, segment306, segment307, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_183_Ganzendries_112917224_A, W_188__847554912_F, - W_182_Lostraat_40189518_Z, "Lostraat", - null, - "3"); - - for (int n = 181; n >= 134; n--) {returnValueNull =segment307.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment308 = segment307.addPTWayMember(133); - extractAndAssertValues(133, segment307, segment308, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_134_Oude_Diestsesteenweg_10230617_A, W_182_Lostraat_40189518_Z, - W_133_Diestsesteenweg_23707243_A, "Diestsesteenweg", - null, - "3"); - - RouteSegmentToExtract segment309 = segment308.addPTWayMember(132); - extractAndAssertValues(132, segment308, segment309, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_133_Diestsesteenweg_23707243_A, W_133_Diestsesteenweg_23707243_A, - W_132_Diestsesteenweg_23707244_B, "Diestsesteenweg", - null, - "3;370;371;373;374;475;485;524;525"); - - for (int n = 131; n >= 131; n--) {returnValueNull =segment309.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment310 = segment309.addPTWayMember(130); - extractAndAssertValues(130, segment309, segment310, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_131_Diestsesteenweg_12715116_A, W_132_Diestsesteenweg_23707244_B, - W_130_Diestsepoort_61556877_D, "Diestsepoort", - null, - "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"); - - for (int n = 129; n >= 127; n--) {returnValueNull =segment310.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment311 = segment310.addPTWayMember(126); - extractAndAssertValues(126, segment310, segment311, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_127_Diestsepoort_584356745_A, W_130_Diestsepoort_61556877_D, - W_126_Diestsepoort_198559166_E, "Diestsepoort", - null, - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"); - - for (int n = 125; n >= 122; n--) {returnValueNull =segment311.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment312 = segment311.addPTWayMember(121); - extractAndAssertValues(121, segment311, segment312, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_122_Diestsepoort_451873774_A, W_126_Diestsepoort_198559166_E, - W_121__76867049_C, null, - null, - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"); - - for (int n = 120; n >= 119; n--) {returnValueNull =segment312.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment313 = segment312.addPTWayMember(118); - extractAndAssertValues(118, segment312, segment313, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_119__79596965_A, W_121__76867049_C, - W_118__79596974_B, null, - null, - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"); - - for (int n = 117; n >= 117; n--) {returnValueNull =segment313.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment314 = segment313.addPTWayMember(116); - extractAndAssertValues(116, segment313, segment314, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_117__79596982_A, W_118__79596974_B, - W_116__79596987_C, null, - null, - "3;333;334;335;433;600;630"); - - for (int n = 115; n >= 114; n--) {returnValueNull =segment314.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment315 = segment314.addPTWayMember(113); - extractAndAssertValues(113, segment314, segment315, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_114__79596980_A, W_116__79596987_C, - W_113_Tiensevest_79193579_A, "Tiensevest", - null, - "3;333;334;335;513;600;630"); - - RouteSegmentToExtract segment316 = segment315.addPTWayMember(112); - extractAndAssertValues(112, segment315, segment316, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_113_Tiensevest_79193579_A, W_113_Tiensevest_79193579_A, - W_112_Tiensevest_258936980_A, "Tiensevest", - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"); - - RouteSegmentToExtract segment317 = segment316.addPTWayMember(111); - extractAndAssertValues(111, segment316, segment317, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_112_Tiensevest_258936980_A, W_112_Tiensevest_258936980_A, - W_111_Tiensevest_79193580_A, "Tiensevest", - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"); - - RouteSegmentToExtract segment318 = segment317.addPTWayMember(110); - extractAndAssertValues(110, segment317, segment318, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_111_Tiensevest_79193580_A, W_111_Tiensevest_79193580_A, - W_110_Tiensevest_79193581_A, "Tiensevest", - null, - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - - RouteSegmentToExtract segment319 = segment318.addPTWayMember(109); - extractAndAssertValues(109, segment318, segment319, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_110_Tiensevest_79193581_A, W_110_Tiensevest_79193581_A, - W_109_Tiensevest_78815505_A, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - - RouteSegmentToExtract segment320 = segment319.addPTWayMember(108); - extractAndAssertValues(108, segment319, segment320, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_109_Tiensevest_78815505_A, W_109_Tiensevest_78815505_A, - W_108_Tiensevest_84696751_B, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"); - - for (int n = 107; n >= 107; n--) {returnValueNull =segment320.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment321 = segment320.addPTWayMember(106); - extractAndAssertValues(106, segment320, segment321, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_107_Tiensevest_79265237_A, W_108_Tiensevest_84696751_B, - W_106_Tiensevest_89574079_B, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"); - - for (int n = 105; n >= 105; n--) {returnValueNull =segment321.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment322 = segment321.addPTWayMember(104); - extractAndAssertValues(104, segment321, segment322, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_105_Tiensevest_81522744_A, W_106_Tiensevest_89574079_B, - W_104_Bondgenotenlaan_305434579_H, "Bondgenotenlaan", - null, - "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"); - - for (int n = 103; n >= 97; n--) {returnValueNull =segment322.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment323 = segment322.addPTWayMember(96); - extractAndAssertValues(96, segment322, segment323, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_97_Rector_De_Somerplein_521211977_A, W_104_Bondgenotenlaan_305434579_H, - W_96_Rector_De_Somerplein_521211976_B, "Rector De Somerplein", - null, - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"); - - for (int n = 95; n >= 95; n--) {returnValueNull =segment323.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment324 = segment323.addPTWayMember(94); - extractAndAssertValues(94, segment323, segment324, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_95_Rector_De_Somerplein_16771741_A, W_96_Rector_De_Somerplein_521211976_B, - W_94_Margarethaplein_3991635_M, "Margarethaplein", - null, - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"); - - for (int n = 93; n >= 82; n--) {returnValueNull =segment324.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment325 = segment324.addPTWayMember(81); - extractAndAssertValues(81, segment324, segment325, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_82_Brouwersstraat_284664268_A, W_94_Margarethaplein_3991635_M, - W_81_Brouwersstraat_608715545_E, "Brouwersstraat", - null, - "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"); - - for (int n = 80; n >= 77; n--) {returnValueNull =segment325.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment326 = segment325.addPTWayMember(76); - extractAndAssertValues(76, segment325, segment326, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_77_Brouwersstraat_284664272_A, W_81_Brouwersstraat_608715545_E, - W_76_Tessenstraat___Fonteinstraat_147856945_B, "Tessenstraat - Fonteinstraat", - null, - "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"); - - for (int n = 75; n >= 75; n--) {returnValueNull =segment326.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment327 = segment326.addPTWayMember(74); - extractAndAssertValues(74, segment326, segment327, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_75_Kapucijnenvoer_123929547_A, W_76_Tessenstraat___Fonteinstraat_147856945_B, - W_74_Biezenstraat_3358673_E, "Biezenstraat", - null, - "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"); - - for (int n = 73; n >= 70; n--) {returnValueNull =segment327.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment328 = segment327.addPTWayMember(69); - extractAndAssertValues(69, segment327, segment328, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_70_Sint_Hubertusstraat_123929615_A, W_74_Biezenstraat_3358673_E, - W_69_Monseigneur_Van_Waeyenberghlaan_189453003_G, "Monseigneur Van Waeyenberghlaan", - null, - "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513"); - - for (int n = 68; n >= 63; n--) {returnValueNull =segment328.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment329 = segment328.addPTWayMember(62); - extractAndAssertValues(62, segment328, segment329, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_63_Monseigneur_Van_Waeyenberghlaan_249333181_A, W_69_Monseigneur_Van_Waeyenberghlaan_189453003_G, - W_62_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;513"); - - RouteSegmentToExtract segment330 = segment329.addPTWayMember(61); - extractAndAssertValues(61, segment329, segment330, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_62_Rotonde_Het_Teken_249333187_A, W_62_Rotonde_Het_Teken_249333187_A, - W_61_Rotonde_Het_Teken_813970230_B, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - for (int n = 60; n >= 60; n--) {returnValueNull =segment330.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment331 = segment330.addPTWayMember(59); - extractAndAssertValues(59, segment330, segment331, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_60_Rotonde_Het_Teken_41403540_A, W_61_Rotonde_Het_Teken_813970230_B, - W_59_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;513"); - - for (int n = 58; n >= 58; n--) {returnValueNull =segment331.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment332 = segment331.addPTWayMember(57); - extractAndAssertValues(57, segment331, segment332, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_58_Ring_Zuid_79340950_A, W_59_Rotonde_Het_Teken_41403538_B, - W_57_Ring_Zuid_11369123_A, "Ring Zuid", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - RouteSegmentToExtract segment333 = segment332.addPTWayMember(56); - extractAndAssertValues(56, segment332, segment333, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_57_Ring_Zuid_11369123_A, W_57_Ring_Zuid_11369123_A, - W_56__159949154_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - RouteSegmentToExtract segment334 = segment333.addPTWayMember(55); - extractAndAssertValues(55, segment333, segment334, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_56__159949154_A, W_56__159949154_A, - W_55__332258104_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - for (int n = 54; n >= 54; n--) {returnValueNull =segment334.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment335 = segment334.addPTWayMember(53); - extractAndAssertValues(53, segment334, segment335, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_54__78852604_A, W_55__332258104_B, - W_53__14508735_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - RouteSegmentToExtract segment336 = segment335.addPTWayMember(52); - extractAndAssertValues(52, segment335, segment336, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_53__14508735_A, W_53__14508735_A, - W_52__109267438_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600"); - - RouteSegmentToExtract segment337 = segment336.addPTWayMember(51); - extractAndAssertValues(51, segment336, segment337, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_52__109267438_A, W_52__109267438_A, - W_51__318878532_A, null, - null, - "3;333;334;335;370;371;373;374;380;513"); - - RouteSegmentToExtract segment338 = segment337.addPTWayMember(50); - extractAndAssertValues(50, segment337, segment338, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_51__318878532_A, W_51__318878532_A, - W_50__100687528_A, null, - null, - "3;333;334;335;513"); - - RouteSegmentToExtract segment339 = segment338.addPTWayMember(49); - extractAndAssertValues(49, segment338, segment339, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_50__100687528_A, W_50__100687528_A, - W_49_Ring_Zuid_14508739_A, "Ring Zuid", - null, - "3;334;335"); - - RouteSegmentToExtract segment340 = segment339.addPTWayMember(48); - extractAndAssertValues(48, segment339, segment340, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_49_Ring_Zuid_14508739_A, W_49_Ring_Zuid_14508739_A, - W_48_Ring_Zuid_14508740_A, "Ring Zuid", - null, - "3;317;334;335;395;410;600;601"); - - RouteSegmentToExtract segment341 = segment340.addPTWayMember(47); - extractAndAssertValues(47, segment340, segment341, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_48_Ring_Zuid_14508740_A, W_48_Ring_Zuid_14508740_A, - W_47_Ring_Zuid_502328838_D, "Ring Zuid", - null, - "3;317;334;335;380;395;410;600;601"); - - for (int n = 46; n >= 44; n--) {returnValueNull =segment341.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment342 = segment341.addPTWayMember(43); - extractAndAssertValues(43, segment341, segment342, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_44_Rotonde_Het_Teken_78568660_A, W_47_Ring_Zuid_502328838_D, - W_43_Ring_Noord_15945426_G, "Ring Noord", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - for (int n = 42; n >= 37; n--) {returnValueNull =segment342.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_GHB_Pellenberg_Lubbeek_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment343 = segment342.addPTWayMember(36); - extractAndAssertValues(36, segment342, segment343, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, - W_37_Ring_Noord_377918625_A, W_43_Ring_Noord_15945426_G, - 0, null, - null, - "3"); + new Val( 43, 78568660, 502328838, 15945426, "Ring Noord", + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + new Val( 42, 502317795, 15945426, 502317795, "Ring Noord"), + new Val( 41, 810580948, 15945426, 810580948, "Ring Noord"), + new Val( 40, 502317796, 15945426, 502317796, "Ring Noord"), + new Val( 39, 112917238, 15945426, 112917238, "Ring Noord"), + new Val( 38, 608754690, 15945426, 608754690, "Ring Noord"), + new Val( 37, 377918625, 15945426, 377918625, "Ring Noord"), + + new Val( 36, 377918625, 15945426, 377918625, "Ring Noord", + "Ring Noord (3)", + "3") + ); previousSegment = new RouteSegmentToExtract(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); + previousSegment.setActiveDataSet(ds); + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + } + + System.out.print("\n"); // *********************************************************** // Line 3 has the particularity that there are 2 variants @@ -1887,393 +1769,690 @@ public void bus601_600_3_Test() { assertEquals("", segment401.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment401.getWayMembers()); - final int W_221_Ring_Noord_377918626_I = 377918626; - final int W_213_Ring_Noord_112917239_A = 112917239; - final int W_212_Rotonde_Het_Teken_3752557_A = 3752557; - final int W_211_Rotonde_Het_Teken_249333188_A = 249333188; - final int W_210_Rotonde_Het_Teken_249333187_A = 249333187; - final int W_209_Rotonde_Het_Teken_813970230_B = 813970230; - final int W_208_Rotonde_Het_Teken_41403540_A = 41403540; - final int W_207_Rotonde_Het_Teken_41403538_B = 41403538; - final int W_206_Ring_Zuid_79340950_A = 79340950; - final int W_205_Ring_Zuid_11369123_A = 11369123; - final int W_204__159949154_A = 159949154; - final int W_203__332258104_B = 332258104; - final int W_202__78852604_A = 78852604; - final int W_201__377918641_B = 377918641; - final int W_200__14508736_A = 14508736; - final int W_199_Ring_Zuid_109267436_A = 109267436; - final int W_198_Ring_Zuid_14508739_A = 14508739; - final int W_197_Ring_Zuid_14508740_A = 14508740; - final int W_196_Ring_Zuid_502328838_D = 502328838; - final int W_193_Rotonde_Het_Teken_78568660_A = 78568660; - final int W_192_Rotonde_Het_Teken_78873921_A = 78873921; - final int W_191_Rotonde_Het_Teken_3752557_A = 3752557; - final int W_190_Monseigneur_Van_Waeyenberghlaan_249333183_G = 249333183; - final int W_184_Monseigneur_Van_Waeyenberghlaan_189453003_A = 189453003; - final int W_183_Sint_Hubertusstraat_123929615_E = 123929615; - final int W_179_Biezenstraat_3358673_A = 3358673; - final int W_178_Kapucijnenvoer_123929547_B = 123929547; - final int W_177_Tessenstraat___Fonteinstraat_147856945_A = 147856945; - final int W_176_Brouwersstraat_284664272_E = 284664272; - final int W_172_Brouwersstraat_608715545_A = 608715545; - final int W_171_Brouwersstraat_284664268_M = 284664268; - final int W_159_Margarethaplein_3991635_A = 3991635; - final int W_158_Rector_De_Somerplein_16771741_J = 16771741; - final int W_149_Bondgenotenlaan_305434579_A = 305434579; - final int W_148_Tiensevest_81522744_B = 81522744; - final int W_147_Tiensevest_89574079_A = 89574079; - final int W_146_Tiensevest_79265237_A = 79265237; - final int W_145_Tiensevest_79211473_A = 79211473; - final int W_144__79605527_F = 79605527; - final int W_139__79596971_A = 79596971; - final int W_138__377918635_A = 377918635; - final int W_137__79264888_A = 79264888; - final int W_136__79264897_B = 79264897; - final int W_135__71754927_A = 71754927; - final int W_134__79596965_C = 79596965; - final int W_132__76867049_A = 76867049; - final int W_131_Diestsepoort_451873774_B = 451873774; - final int W_130_Diestsepoort_584356742_A = 584356742; - final int W_129_Diestsepoort_451873773_G = 451873773; - final int W_123_Diestsepoort_61556877_A = 61556877; - final int W_122_Diestsepoort_8109264_C = 8109264; - final int W_120_Diestsesteenweg_23707244_A = 23707244; - final int W_119_Diestsesteenweg_23707243_A = 23707243; - final int W_118_Oude_Diestsesteenweg_10230617_Z = 10230617; - final int W_70_Lostraat_40189518_A = 40189518; - final int W_69_Ganzendries_112917224_F = 112917224; - final int W_64__847554912_A = 847554912; - final int W_63__27686453_G = 27686453; - final int W_57_Sint_Barbaradreef_112917225_A = 112917225; - final int W_56__847554912_F = 847554912; - final int W_51_Ganzendries_112917224_A = 112917224; - final int W_50_Kapelstraat_16377612_K = 16377612; - final int W_40_Bollenberg_81197019_A = 81197019; - final int W_39_Dorpskring_125835541_A = 125835541; - final int W_38_Dorpskring_81083332_C = 81083332; - final int W_37_Dorpskring_125835543_B = 125835543; - final int W_36_Dorpskring_608754701_A = 608754701; - - for (int n = 221; n >= 213; n--) {returnValueNull =segment401.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment402 = segment401.addPTWayMember(212); - extractAndAssertValues(212, segment401, segment402, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_213_Ring_Noord_112917239_A, W_221_Ring_Noord_377918626_I, - W_212_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", - null, - "3"); - - RouteSegmentToExtract segment403 = segment402.addPTWayMember(211); - extractAndAssertValues(211, segment402, segment403, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_212_Rotonde_Het_Teken_3752557_A, W_212_Rotonde_Het_Teken_3752557_A, - W_211_Rotonde_Het_Teken_249333188_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - RouteSegmentToExtract segment404 = segment403.addPTWayMember(210); - extractAndAssertValues(210, segment403, segment404, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_211_Rotonde_Het_Teken_249333188_A, W_211_Rotonde_Het_Teken_249333188_A, - W_210_Rotonde_Het_Teken_249333187_A, "Rotonde Het Teken", - null, - "3;410;600;601"); - - RouteSegmentToExtract segment405 = segment404.addPTWayMember(209); - extractAndAssertValues(209, segment404, segment405, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_210_Rotonde_Het_Teken_249333187_A, W_210_Rotonde_Het_Teken_249333187_A, - W_209_Rotonde_Het_Teken_813970230_B, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - for (int n = 208; n >= 208; n--) {returnValueNull =segment405.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment406 = segment405.addPTWayMember(207); - extractAndAssertValues(207, segment405, segment406, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_208_Rotonde_Het_Teken_41403540_A, W_209_Rotonde_Het_Teken_813970230_B, - W_207_Rotonde_Het_Teken_41403538_B, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;513"); - - for (int n = 206; n >= 206; n--) {returnValueNull =segment406.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment407 = segment406.addPTWayMember(205); - extractAndAssertValues(205, segment406, segment407, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_206_Ring_Zuid_79340950_A, W_207_Rotonde_Het_Teken_41403538_B, - W_205_Ring_Zuid_11369123_A, "Ring Zuid", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - RouteSegmentToExtract segment408 = segment407.addPTWayMember(204); - extractAndAssertValues(204, segment407, segment408, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_205_Ring_Zuid_11369123_A, W_205_Ring_Zuid_11369123_A, - W_204__159949154_A, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - RouteSegmentToExtract segment409 = segment408.addPTWayMember(203); - extractAndAssertValues(203, segment408, segment409, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_204__159949154_A, W_204__159949154_A, - W_203__332258104_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - for (int n = 202; n >= 202; n--) {returnValueNull =segment409.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment410 = segment409.addPTWayMember(201); - extractAndAssertValues(201, segment409, segment410, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_202__78852604_A, W_203__332258104_B, - W_201__377918641_B, null, - null, - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"); - - for (int n = 200; n >= 200; n--) {returnValueNull =segment410.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment411 = segment410.addPTWayMember(199); - extractAndAssertValues(199, segment410, segment411, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_200__14508736_A, W_201__377918641_B, - W_199_Ring_Zuid_109267436_A, "Ring Zuid", - null, - "3;317;395;410;601"); - - RouteSegmentToExtract segment412 = segment411.addPTWayMember(198); - extractAndAssertValues(198, segment411, segment412, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_199_Ring_Zuid_109267436_A, W_199_Ring_Zuid_109267436_A, - W_198_Ring_Zuid_14508739_A, "Ring Zuid", - null, - "3;317;395;410;600;601"); - - RouteSegmentToExtract segment413 = segment412.addPTWayMember(197); - extractAndAssertValues(197, segment412, segment413, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_198_Ring_Zuid_14508739_A, W_198_Ring_Zuid_14508739_A, - W_197_Ring_Zuid_14508740_A, "Ring Zuid", - null, - "3;317;334;335;395;410;600;601"); - - RouteSegmentToExtract segment414 = segment413.addPTWayMember(196); - extractAndAssertValues(196, segment413, segment414, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_197_Ring_Zuid_14508740_A, W_197_Ring_Zuid_14508740_A, - W_196_Ring_Zuid_502328838_D, "Ring Zuid", - null, - "3;317;334;335;380;395;410;600;601"); - - for (int n = 195; n >= 193; n--) {returnValueNull =segment414.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment415 = segment414.addPTWayMember(192); - extractAndAssertValues(192, segment414, segment415, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_193_Rotonde_Het_Teken_78568660_A, W_196_Ring_Zuid_502328838_D, - W_192_Rotonde_Het_Teken_78873921_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - RouteSegmentToExtract segment416 = segment415.addPTWayMember(191); - extractAndAssertValues(191, segment415, segment416, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_192_Rotonde_Het_Teken_78873921_A, W_192_Rotonde_Het_Teken_78873921_A, - W_191_Rotonde_Het_Teken_3752557_A, "Rotonde Het Teken", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - RouteSegmentToExtract segment417 = segment416.addPTWayMember(190); - extractAndAssertValues(190, segment416, segment417, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_191_Rotonde_Het_Teken_3752557_A, W_191_Rotonde_Het_Teken_3752557_A, - W_190_Monseigneur_Van_Waeyenberghlaan_249333183_G, "Monseigneur Van Waeyenberghlaan", - null, - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"); - - for (int n = 189; n >= 184; n--) {returnValueNull =segment417.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment418 = segment417.addPTWayMember(183); - extractAndAssertValues(183, segment417, segment418, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_184_Monseigneur_Van_Waeyenberghlaan_189453003_A, W_190_Monseigneur_Van_Waeyenberghlaan_249333183_G, - W_183_Sint_Hubertusstraat_123929615_E, "Sint-Hubertusstraat", - null, - "3;317;333;334;335;370;371;373;374;380;395"); - - for (int n = 182; n >= 179; n--) {returnValueNull =segment418.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment419 = segment418.addPTWayMember(178); - extractAndAssertValues(178, segment418, segment419, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_179_Biezenstraat_3358673_A, W_183_Sint_Hubertusstraat_123929615_E, - W_178_Kapucijnenvoer_123929547_B, "Kapucijnenvoer", - null, - "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395"); - - for (int n = 177; n >= 177; n--) {returnValueNull =segment419.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment420 = segment419.addPTWayMember(176); - extractAndAssertValues(176, segment419, segment420, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_177_Tessenstraat___Fonteinstraat_147856945_A, W_178_Kapucijnenvoer_123929547_B, - W_176_Brouwersstraat_284664272_E, "Brouwersstraat", - null, - "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"); - - for (int n = 175; n >= 172; n--) {returnValueNull =segment420.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment421 = segment420.addPTWayMember(171); - extractAndAssertValues(171, segment420, segment421, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_172_Brouwersstraat_608715545_A, W_176_Brouwersstraat_284664272_E, - W_171_Brouwersstraat_284664268_M, "Brouwersstraat", - null, - "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"); - - for (int n = 170; n >= 159; n--) {returnValueNull =segment421.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment422 = segment421.addPTWayMember(158); - extractAndAssertValues(158, segment421, segment422, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_159_Margarethaplein_3991635_A, W_171_Brouwersstraat_284664268_M, - W_158_Rector_De_Somerplein_16771741_J, "Rector De Somerplein", - null, - "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"); - - for (int n = 157; n >= 149; n--) {returnValueNull =segment422.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment423 = segment422.addPTWayMember(148); - extractAndAssertValues(148, segment422, segment423, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_149_Bondgenotenlaan_305434579_A, W_158_Rector_De_Somerplein_16771741_J, - W_148_Tiensevest_81522744_B, "Tiensevest", - null, - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586"); - - for (int n = 147; n >= 147; n--) {returnValueNull =segment423.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment424 = segment423.addPTWayMember(146); - extractAndAssertValues(146, segment423, segment424, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_147_Tiensevest_89574079_A, W_148_Tiensevest_81522744_B, - W_146_Tiensevest_79265237_A, "Tiensevest", - null, - "1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586;616"); - - RouteSegmentToExtract segment425 = segment424.addPTWayMember(145); - extractAndAssertValues(145, segment424, segment425, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_146_Tiensevest_79265237_A, W_146_Tiensevest_79265237_A, - W_145_Tiensevest_79211473_A, "Tiensevest", - null, - "1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586;616"); - - RouteSegmentToExtract segment426 = segment425.addPTWayMember(144); - extractAndAssertValues(144, segment425, segment426, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_145_Tiensevest_79211473_A, W_145_Tiensevest_79211473_A, - W_144__79605527_F, null, - null, - "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"); - - for (int n = 143; n >= 139; n--) {returnValueNull =segment426.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment428 = segment426.addPTWayMember(138); - extractAndAssertValues(138, segment426, segment428, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_139__79596971_A, W_144__79605527_F, - W_138__377918635_A, null, - null, - "3;4;5;6;7;8;9"); - - RouteSegmentToExtract segment429 = segment428.addPTWayMember(137); - extractAndAssertValues(137, segment428, segment429, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_138__377918635_A, W_138__377918635_A, - W_137__79264888_A, null, - null, - "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"); - - RouteSegmentToExtract segment430 = segment429.addPTWayMember(136); - extractAndAssertValues(136, segment429, segment430, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_137__79264888_A, W_137__79264888_A, - W_136__79264897_B, null, - null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"); - - for (int n = 135; n >= 135; n--) {returnValueNull =segment430.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment432 = segment430.addPTWayMember(134); - extractAndAssertValues(134, segment430, segment432, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_135__71754927_A, W_136__79264897_B, - W_134__79596965_C, null, - null, - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"); - - for (int n = 133; n >= 132; n--) {returnValueNull =segment432.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment433 = segment432.addPTWayMember(131); - extractAndAssertValues(131, segment432, segment433, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_132__76867049_A, W_134__79596965_C, - W_131_Diestsepoort_451873774_B, "Diestsepoort", - null, - "2;3;4;5;6;7;8;9;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525"); - - for (int n = 130; n >= 130; n--) {returnValueNull =segment433.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment434 = segment433.addPTWayMember(129); - extractAndAssertValues(129, segment433, segment434, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_130_Diestsepoort_584356742_A, W_131_Diestsepoort_451873774_B, - W_129_Diestsepoort_451873773_G, "Diestsepoort", - null, - "2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525"); - - for (int n = 128; n >= 123; n--) {returnValueNull =segment434.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment436 = segment434.addPTWayMember(122); - extractAndAssertValues(122, segment434, segment436, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_123_Diestsepoort_61556877_A, W_129_Diestsepoort_451873773_G, - W_122_Diestsepoort_8109264_C, "Diestsepoort", - null, - "2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"); - - for (int n = 121; n >= 120; n--) {returnValueNull =segment436.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment437 = segment436.addPTWayMember(119); - extractAndAssertValues(119, segment436, segment437, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_120_Diestsesteenweg_23707244_A, W_122_Diestsepoort_8109264_C, - W_119_Diestsesteenweg_23707243_A, "Diestsesteenweg", - null, - "2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"); - - RouteSegmentToExtract segment438 = segment437.addPTWayMember(118); - extractAndAssertValues(118, segment437, segment438, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_119_Diestsesteenweg_23707243_A, W_119_Diestsesteenweg_23707243_A, - W_118_Oude_Diestsesteenweg_10230617_Z, "Oude Diestsesteenweg", - null, - "3;370;371;373;374;475;485;524;525"); - - for (int n = 117; n >= 70; n--) {returnValueNull =segment438.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment439 = segment438.addPTWayMember(69); - extractAndAssertValues(69, segment438, segment439, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_70_Lostraat_40189518_A, W_118_Oude_Diestsesteenweg_10230617_Z, - W_69_Ganzendries_112917224_F, "Ganzendries", - null, - "3"); - - for (int n = 68; n >= 64; n--) {returnValueNull =segment439.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment440 = segment439.addPTWayMember(63); - extractAndAssertValues(63, segment439, segment440, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_64__847554912_A, W_69_Ganzendries_112917224_F, - W_63__27686453_G, null, - null, - "3"); - - for (int n = 62; n >= 57; n--) {returnValueNull =segment440.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment441 = segment440.addPTWayMember(56); - extractAndAssertValues(56, segment440, segment441, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_57_Sint_Barbaradreef_112917225_A, W_63__27686453_G, - W_56__847554912_F, null, - null, - "3"); - - for (int n = 55; n >= 51; n--) {returnValueNull =segment441.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment442 = segment441.addPTWayMember(50); - extractAndAssertValues(50, segment441, segment442, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_51_Ganzendries_112917224_A, W_56__847554912_F, - W_50_Kapelstraat_16377612_K, "Kapelstraat", - null, - "3"); - - for (int n = 49; n >= 40; n--) {returnValueNull =segment442.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment443 = segment442.addPTWayMember(39); - extractAndAssertValues(39, segment442, segment443, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_40_Bollenberg_81197019_A, W_50_Kapelstraat_16377612_K, - W_39_Dorpskring_125835541_A, "Dorpskring", - null, - "3"); - - RouteSegmentToExtract segment444 = segment443.addPTWayMember(38); - extractAndAssertValues(38, segment443, segment444, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_39_Dorpskring_125835541_A, W_39_Dorpskring_125835541_A, - W_38_Dorpskring_81083332_C, "Dorpskring", - null, - "3;373;485"); - - // todo This is not the behaviour I wanted. It shouldn't actually split at index 36 - for (int n = 37; n >= 37; n--) {returnValueNull =segment444.addPTWayMember(n); assertNull(String.format("%d %s%s\n", n, rc, bus3_Lubbeek_Pellenberg_GHB_RouteRelation.getMember(n).getMember().getId()), returnValueNull);} - RouteSegmentToExtract segment445 = segment444.addPTWayMember(36); - extractAndAssertValues(36, segment444, segment445, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_37_Dorpskring_125835543_B, W_38_Dorpskring_81083332_C, - W_36_Dorpskring_608754701_A, "Dorpskring", - null, - "3;373;485"); - - RouteSegmentToExtract segment446 = segment445.addPTWayMember(35); - extractAndAssertValues(35, segment445, segment446, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, - W_36_Dorpskring_608754701_A, W_36_Dorpskring_608754701_A, - 0, null, - null, - "3;373;485"); + + expectedValues = Arrays.asList( + new Val( 221, 377918626, 377918626, 377918626, "Ring Noord"), + new Val( 220, 243915691, 377918626, 243915691, "Ring Noord"), + new Val( 219, 126304975, 377918626, 126304975, null), + new Val( 218, 326736776, 377918626, 326736776, null), + new Val( 217, 333580518, 377918626, 333580518, null), + new Val( 216, 608754690, 377918626, 608754690, "Ring Noord"), + new Val( 215, 112917238, 377918626, 112917238, "Ring Noord"), + new Val( 214, 502317797, 377918626, 502317797, "Ring Noord"), + new Val( 213, 112917239, 377918626, 112917239, "Ring Noord"), + + new Val( 212, 112917239, 377918626, 3752557, "Rotonde Het Teken", + "Ring Noord (3)", + "3"), + + + new Val( 211, 3752557, 3752557, 249333188, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 210, 249333188, 249333188, 249333187, "Rotonde Het Teken", + "Rotonde Het Teken (3;410;600;601)", + "3;410;600;601"), + + + new Val( 209, 249333187, 249333187, 813970230, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 208, 41403540, 813970230, 41403540, "Rotonde Het Teken"), + + new Val( 207, 41403540, 813970230, 41403538, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)", + "3;317;333;334;335;370;371;373;374;380;395;513"), + + new Val( 206, 79340950, 41403538, 79340950, "Ring Zuid"), + + new Val( 205, 79340950, 41403538, 11369123, "Ring Zuid", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 204, 11369123, 11369123, 159949154, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + + new Val( 203, 159949154, 159949154, 332258104, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 202, 78852604, 332258104, 78852604, null), + + new Val( 201, 78852604, 332258104, 377918641, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + + new Val( 200, 14508736, 377918641, 14508736, null), + + new Val( 199, 14508736, 377918641, 109267436, "Ring Zuid", + "(3;317;395;410;601)", + "3;317;395;410;601"), + + + new Val( 198, 109267436, 109267436, 14508739, "Ring Zuid", + "Ring Zuid (3;317;395;410;600;601)", + "3;317;395;410;600;601"), + + + new Val( 197, 14508739, 14508739, 14508740, "Ring Zuid", + "Ring Zuid (3;317;334;335;395;410;600;601)", + "3;317;334;335;395;410;600;601"), + + + new Val( 196, 14508740, 14508740, 502328838, "Ring Zuid", + "Ring Zuid (3;317;334;335;380;395;410;600;601)", + "3;317;334;335;380;395;410;600;601"), + + new Val( 195, 502328837, 502328838, 502328837, "Ring Zuid"), + new Val( 194, 8080023, 502328838, 8080023, "Ring Zuid"), + new Val( 193, 78568660, 502328838, 78568660, "Rotonde Het Teken"), + new Val( 192, 78873921, 502328838, 78873921, "Rotonde Het Teken"), + + new Val( 191, 78873921, 502328838, 3752557, "Rotonde Het Teken", + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + + new Val( 190, 3752557, 3752557, 249333183, "Monseigneur Van Waeyenberghlaan", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + new Val( 189, 810592121, 249333183, 810592121, "Monseigneur Van Waeyenberghlaan"), + new Val( 188, 189453001, 249333183, 189453001, "Monseigneur Van Waeyenberghlaan"), + new Val( 187, 189453002, 249333183, 189453002, "Monseigneur Van Waeyenberghlaan"), + new Val( 186, 189453004, 249333183, 189453004, "Monseigneur Van Waeyenberghlaan"), + new Val( 185, 79289753, 249333183, 79289753, "Monseigneur Van Waeyenberghlaan"), + new Val( 184, 189453003, 249333183, 189453003, "Monseigneur Van Waeyenberghlaan"), + + new Val( 183, 189453003, 249333183, 123929615, "Sint-Hubertusstraat", + "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395)", + "3;317;333;334;335;370;371;373;374;380;395"), + + new Val( 182, 3358671, 123929615, 3358671, "Sint-Jacobsplein"), + new Val( 181, 521211966, 123929615, 521211966, "Sint-Jacobsplein"), + new Val( 180, 578662071, 123929615, 578662071, "Sint-Jacobsplein"), + new Val( 179, 3358673, 123929615, 3358673, "Biezenstraat"), + + new Val( 178, 3358673, 123929615, 123929547, "Kapucijnenvoer", + "Biezenstraat - Sint-Hubertusstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395)", + "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395"), + + new Val( 177, 147856945, 123929547, 147856945, "Tessenstraat - Fonteinstraat"), + + new Val( 176, 147856945, 123929547, 284664272, "Brouwersstraat", + "Tessenstraat - Fonteinstraat - Kapucijnenvoer (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)", + "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"), + + new Val( 175, 608715544, 284664272, 608715544, "Brouwersstraat"), + new Val( 174, 608715542, 284664272, 608715542, "Brouwersstraat"), + new Val( 173, 608715543, 284664272, 608715543, "Brouwersstraat"), + new Val( 172, 608715545, 284664272, 608715545, "Brouwersstraat"), + + new Val( 171, 608715545, 284664272, 284664268, "Brouwersstraat", + "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)", + "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"), + + new Val( 170, 438252643, 284664268, 438252643, "Dirk Boutslaan"), + new Val( 169, 3992578, 284664268, 3992578, "Dirk Boutslaan"), + new Val( 168, 293149632, 284664268, 293149632, "Dirk Boutslaan"), + new Val( 167, 608715541, 284664268, 608715541, "Dirk Boutslaan"), + new Val( 166, 578662072, 284664268, 578662072, "Dirk Boutslaan"), + new Val( 165, 10269271, 284664268, 10269271, "Dirk Boutslaan"), + new Val( 164, 293288706, 284664268, 293288706, "Mathieu de Layensplein"), + new Val( 163, 80194313, 284664268, 80194313, "Mathieu de Layensplein"), + new Val( 162, 453538107, 284664268, 453538107, "Margarethaplein"), + new Val( 161, 608715546, 284664268, 608715546, "Margarethaplein"), + new Val( 160, 521211973, 284664268, 521211973, "Margarethaplein"), + new Val( 159, 3991635, 284664268, 3991635, "Margarethaplein"), + + new Val( 158, 3991635, 284664268, 16771741, "Rector De Somerplein", + "Margarethaplein - Brouwersstraat (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)", + "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"), + + new Val( 157, 521211976, 16771741, 521211976, "Rector De Somerplein"), + new Val( 156, 521211977, 16771741, 521211977, "Rector De Somerplein"), + new Val( 155, 174985125, 16771741, 174985125, "Rector De Somerplein"), + new Val( 154, 3991636, 16771741, 3991636, "Bondgenotenlaan"), + new Val( 153, 578662094, 16771741, 578662094, "Bondgenotenlaan"), + new Val( 152, 578662095, 16771741, 578662095, "Bondgenotenlaan"), + new Val( 151, 578662092, 16771741, 578662092, "Bondgenotenlaan"), + new Val( 150, 578662093, 16771741, 578662093, "Bondgenotenlaan"), + new Val( 149, 305434579, 16771741, 305434579, "Bondgenotenlaan"), + + new Val( 148, 305434579, 16771741, 81522744, "Tiensevest", + "Bondgenotenlaan - Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586)", + "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586"), + + new Val( 147, 89574079, 81522744, 89574079, "Tiensevest"), + + new Val( 146, 89574079, 81522744, 79265237, "Tiensevest", + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586;616)", + "1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586;616"), + + + new Val( 145, 79265237, 79265237, 79211473, "Tiensevest", + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586;616)", + "1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586;616"), + + + new Val( 144, 79211473, 79211473, 79605527, null, + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", + "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), + + new Val( 143, 79605524, 79605527, 79605524, null), + new Val( 142, 377918661, 79605527, 377918661, null), + new Val( 141, 79596984, 79605527, 79596984, null), + new Val( 140, 377918662, 79605527, 377918662, null), + new Val( 139, 79596971, 79605527, 79596971, null), + + new Val( 138, 79596971, 79605527, 377918635, null, + "perron 3 & 4 (3;4;5;6;7;8;9)", + "3;4;5;6;7;8;9"), + + + new Val( 137, 377918635, 377918635, 79264888, null, + "(3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601)", + "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"), + + + new Val( 136, 79264888, 79264888, 79264897, null, + "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601)", + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"), + + new Val( 135, 71754927, 79264897, 71754927, null), + + new Val( 134, 71754927, 79264897, 79596965, null, + "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601)", + "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"), + + new Val( 133, 79264890, 79596965, 79264890, null), + new Val( 132, 76867049, 79596965, 76867049, null), + + new Val( 131, 76867049, 79596965, 451873774, "Diestsepoort", + "(2;3;4;5;6;7;8;9;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525)", + "2;3;4;5;6;7;8;9;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525"), + + new Val( 130, 584356742, 451873774, 584356742, "Diestsepoort"), + + new Val( 129, 584356742, 451873774, 451873773, "Diestsepoort", + "Diestsepoort (2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)", + "2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525"), + + new Val( 128, 584356751, 451873773, 584356751, "Diestsepoort"), + new Val( 127, 198559166, 451873773, 198559166, "Diestsepoort"), + new Val( 126, 584356745, 451873773, 584356745, "Diestsepoort"), + new Val( 125, 584356749, 451873773, 584356749, "Diestsepoort"), + new Val( 124, 663770966, 451873773, 663770966, "Diestsepoort"), + new Val( 123, 61556877, 451873773, 61556877, "Diestsepoort"), + + new Val( 122, 61556877, 451873773, 8109264, "Diestsepoort", + "Diestsepoort (2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", + "2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + + new Val( 121, 125835524, 8109264, 125835524, "Diestsesteenweg"), + new Val( 120, 23707244, 8109264, 23707244, "Diestsesteenweg"), + + new Val( 119, 23707244, 8109264, 23707243, "Diestsesteenweg", + "Diestsesteenweg - Diestsepoort (2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", + "2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + + + new Val( 118, 23707243, 23707243, 10230617, "Oude Diestsesteenweg", + "Diestsesteenweg (3;370;371;373;374;475;485;524;525)", + "3;370;371;373;374;475;485;524;525"), + + new Val( 117, 3992546, 10230617, 3992546, "Martelarenlaan"), + new Val( 116, 608715590, 10230617, 608715590, "Martelarenlaan"), + new Val( 115, 608715586, 10230617, 608715586, "Martelarenlaan"), + new Val( 114, 284832275, 10230617, 284832275, "Martelarenlaan"), + new Val( 113, 608715584, 10230617, 608715584, "Martelarenlaan"), + new Val( 112, 608715582, 10230617, 608715582, "Martelarenlaan"), + new Val( 111, 23707242, 10230617, 23707242, "Martelarenlaan"), + new Val( 110, 485802425, 10230617, 485802425, "Spoordijk"), + new Val( 109, 16377030, 10230617, 16377030, "Martelarenlaan"), + new Val( 108, 101619136, 10230617, 101619136, "Koning Albertlaan"), + new Val( 107, 622063636, 10230617, 622063636, "Koning Albertlaan"), + new Val( 106, 622063635, 10230617, 622063635, "Koning Albertlaan"), + new Val( 105, 101619135, 10230617, 101619135, "Koning Albertlaan"), + new Val( 104, 12195285, 10230617, 12195285, "Koning Albertlaan"), + new Val( 103, 25155107, 10230617, 25155107, "Willem Coosemansstraat"), + new Val( 102, 10657957, 10230617, 10657957, "Prins-Regentlaan"), + new Val( 101, 10672178, 10230617, 10672178, "Prins Regentplein"), + new Val( 100, 112917229, 10230617, 112917229, "Prins Regentplein"), + new Val( 99, 112917228, 10230617, 112917228, "Prins Regentplein"), + new Val( 98, 10672177, 10230617, 10672177, "Lijsterlaan"), + new Val( 97, 608754700, 10230617, 608754700, "Lijsterlaan"), + new Val( 96, 112917233, 10230617, 112917233, "Lijsterlaan"), + new Val( 95, 608754699, 10230617, 608754699, "Lijsterlaan"), + new Val( 94, 10672176, 10230617, 10672176, "Duivenstraat"), + new Val( 93, 112917234, 10230617, 112917234, "Duivenstraat"), + new Val( 92, 23436182, 10230617, 23436182, "Platte-Lostraat"), + new Val( 91, 10672174, 10230617, 10672174, "Gaston Eyskenslaan"), + new Val( 90, 608754692, 10230617, 608754692, "Koetsweg"), + new Val( 89, 608754691, 10230617, 608754691, "Koetsweg"), + new Val( 88, 10672135, 10230617, 10672135, "Koetsweg"), + new Val( 87, 10672031, 10230617, 10672031, "Heidebergstraat"), + new Val( 86, 586861164, 10230617, 586861164, "Heidebergstraat"), + new Val( 85, 192706265, 10230617, 192706265, "Heidebergstraat"), + new Val( 84, 318216944, 10230617, 318216944, "Heidebergstraat"), + new Val( 83, 192706264, 10230617, 192706264, "Heidebergstraat"), + new Val( 82, 112917248, 10230617, 112917248, "Heidebergstraat"), + new Val( 81, 79801760, 10230617, 79801760, "Heidebergstraat"), + new Val( 80, 61596758, 10230617, 61596758, "Heidebergstraat"), + new Val( 79, 10672083, 10230617, 10672083, "Heidebergstraat"), + new Val( 78, 10672080, 10230617, 10672080, "Heidebergstraat"), + new Val( 77, 633919766, 10230617, 633919766, "Lostraat"), + new Val( 76, 10672044, 10230617, 10672044, "Lostraat"), + new Val( 75, 124913579, 10230617, 124913579, "Lostraat"), + new Val( 74, 636491594, 10230617, 636491594, "Lostraat"), + new Val( 73, 636491595, 10230617, 636491595, "Lostraat"), + new Val( 72, 350992067, 10230617, 350992067, "Lostraat"), + new Val( 71, 351196789, 10230617, 351196789, "Lostraat"), + new Val( 70, 40189518, 10230617, 40189518, "Lostraat"), + + new Val( 69, 40189518, 10230617, 112917224, "Ganzendries", + "Lostraat - Oude Diestsesteenweg (3)", + "3"), + + new Val( 68, 319264895, 112917224, 319264895, "Ganzendries"), + new Val( 67, 27682732, 112917224, 27682732, "Sint Barbaradreef"), + new Val( 66, 527248228, 112917224, 527248228, null), + new Val( 65, 27686451, 112917224, 27686451, null), + new Val( 64, 847554912, 112917224, 847554912, null), + + new Val( 63, 847554912, 112917224, 27686453, null, + "Sint Barbaradreef - Ganzendries (3)", + "3"), + + new Val( 62, 110643012, 27686453, 110643012, null), + new Val( 61, 112917220, 27686453, 112917220, null), + new Val( 60, 70869366, 27686453, 70869366, null), + new Val( 59, 27682735, 27686453, 27682735, null), + new Val( 58, 319269351, 27686453, 319269351, "Sint Barbaradreef"), + new Val( 57, 112917225, 27686453, 112917225, "Sint Barbaradreef"), + + new Val( 56, 112917225, 27686453, 847554912, null, + "Sint Barbaradreef (3)", + "3"), + + new Val( 55, 27686451, 847554912, 27686451, null), + new Val( 54, 527248228, 847554912, 527248228, null), + new Val( 53, 27682732, 847554912, 27682732, "Sint Barbaradreef"), + new Val( 52, 319264895, 847554912, 319264895, "Ganzendries"), + new Val( 51, 112917224, 847554912, 112917224, "Ganzendries"), + + new Val( 50, 112917224, 847554912, 16377612, "Kapelstraat", + "Ganzendries - Sint Barbaradreef (3)", + "3"), + + new Val( 49, 16377722, 16377612, 16377722, "Kapelstraat"), + new Val( 48, 636950670, 16377612, 636950670, "Kapelstraat"), + new Val( 47, 319269331, 16377612, 319269331, "Kapelstraat"), + new Val( 46, 10658839, 16377612, 10658839, "Lubbeekstraat"), + new Val( 45, 232474772, 16377612, 232474772, "Lubbeekstraat"), + new Val( 44, 27688813, 16377612, 27688813, "Bollenberg"), + new Val( 43, 645048305, 16377612, 645048305, "Bollenberg"), + new Val( 42, 694551612, 16377612, 694551612, "Bollenberg"), + new Val( 41, 112917100, 16377612, 112917100, "Bollenberg"), + new Val( 40, 81197019, 16377612, 81197019, "Bollenberg"), + + new Val( 39, 81197019, 16377612, 125835541, "Dorpskring", + "Bollenberg - Kapelstraat (3)", + "3"), + + + new Val( 38, 125835541, 125835541, 81083332, "Dorpskring", + "Dorpskring (3;373;485)", + "3;373;485"), + + new Val( 37, 125835543, 81083332, 125835543, "Dorpskring"), + + new Val( 36, 125835543, 81083332, 608754701, "Dorpskring", + "Dorpskring (3;373;485)", + "3;373;485"), + + + new Val( 35, 608754701, 608754701, 608754701, "Dorpskring", + "Dorpskring (3;373;485)", + "3;373;485") + ); + previousSegment = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); + previousSegment.setActiveDataSet(ds); + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + } + + System.out.print("\n"); + + // *********************************************************** + // Line 310 has 3 variants + // The shorter version goes from Leuven station to + // Aarschot station, making a spoon loop in Holsbeek + // *********************************************************** + + Relation bus310_Leuven_Aarschot_Station_RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 3297278) + .findFirst().orElse(null); + + assertNotNull(bus310_Leuven_Aarschot_Station_RouteRelation); + RouteSegmentToExtract segment501 = new RouteSegmentToExtract(bus310_Leuven_Aarschot_Station_RouteRelation); + segment501.setActiveDataSet(ds); + + assertEquals(bus310_Leuven_Aarschot_Station_RouteRelation.get("ref"), segment501.getLineIdentifiersSignature()); + assertEquals(bus310_Leuven_Aarschot_Station_RouteRelation.get("colour"), segment501.getColoursSignature()); + + assertNull(segment501.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment501.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment501.getWayMembers()); + + expectedValues = Arrays.asList( + new Val( 213, 13856192, 13856192, 13856192, null), + new Val( 212, 100289896, 13856192, 100289896, "Statieplein"), + + new Val( 211, 100289896, 13856192, 100289859, "Statieplein", + "Statieplein (310;334;335)", + "310;334;335"), + + new Val( 210, 100289892, 100289859, 100289892, "Statieplein"), + new Val( 209, 100289852, 100289859, 100289852, "Statieplein"), + new Val( 208, 125101590, 100289859, 125101590, "Statieplein"), + new Val( 207, 101376793, 100289859, 101376793, "Statiestraat"), + new Val( 206, 41405911, 100289859, 41405911, "Statiestraat"), + + new Val( 205, 41405911, 100289859, 125101554, "Albertlaan", + "Statiestraat - Statieplein (305;306;306 (student);310;334;335)", + "305;306;306 (student);310;334;335"), + + + new Val( 204, 125101554, 125101554, 13892080, "Albertlaan", + "Albertlaan (305;306;306 (student);310;334;335;513)", + "305;306;306 (student);310;334;335;513"), + + new Val( 203, 412810122, 13892080, 412810122, "Leuvensesteenweg"), + new Val( 202, 125101584, 13892080, 125101584, "Leuvensesteenweg"), + + new Val( 201, 125101584, 13892080, 188863432, "Leuvensesteenweg", + "Leuvensesteenweg - Albertlaan (310;334;335;513)", + "310;334;335;513"), + + new Val( 200, 125101583, 188863432, 125101583, "Leuvensesteenweg"), + + new Val( 199, 125101583, 188863432, 345152127, "Steenweg op Sint-Joris-Winge", + "Leuvensesteenweg (305;306;306 (student);310;334;335;513)", + "305;306;306 (student);310;334;335;513"), + + new Val( 198, 412810127, 345152127, 412810127, "Steenweg op Sint-Joris-Winge"), + new Val( 197, 345152132, 345152127, 345152132, "Steenweg op Sint-Joris-Winge"), + new Val( 196, 602060323, 345152127, 602060323, "Steenweg op Sint-Joris-Winge"), + new Val( 195, 181252214, 345152127, 181252214, "Steenweg op Sint-Joris-Winge"), + new Val( 194, 102853195, 345152127, 102853195, "Steenweg op Sint-Joris-Winge"), + new Val( 193, 345152123, 345152127, 345152123, "Steenweg op Sint-Joris-Winge"), + new Val( 192, 345088986, 345152127, 345088986, "Steenweg op Sint-Joris-Winge"), + new Val( 191, 112565995, 345152127, 112565995, "Steenweg op Sint-Joris-Winge"), + new Val( 190, 102853233, 345152127, 102853233, null), + new Val( 189, 345088979, 345152127, 345088979, "Steenweg op Sint-Joris-Winge"), + new Val( 188, 345088980, 345152127, 345088980, "Steenweg op Sint-Joris-Winge"), + new Val( 187, 13226856, 345152127, 13226856, "Steenweg op Sint-Joris-Winge"), + new Val( 186, 137111763, 345152127, 137111763, "Steenweg op Sint-Joris-Winge"), + new Val( 185, 521257383, 345152127, 521257383, "Steenweg op Sint-Joris-Winge"), + new Val( 184, 521257382, 345152127, 521257382, "Steenweg op Sint-Joris-Winge"), + new Val( 183, 26431904, 345152127, 26431904, "Nieuwrodesesteenweg"), + new Val( 182, 345078866, 345152127, 345078866, "Nieuwrodesesteenweg"), + new Val( 181, 345078870, 345152127, 345078870, "Steenweg op Sint-Joris-Winge"), + new Val( 180, 345078865, 345152127, 345078865, "Steenweg op Sint-Joris-Winge"), + new Val( 179, 136845549, 345152127, 136845549, "Nieuwrodesesteenweg"), + new Val( 178, 22870199, 345152127, 22870199, "Rijksweg"), + new Val( 177, 345078875, 345152127, 345078875, "Rijksweg"), + new Val( 176, 13856508, 345152127, 13856508, "Rijksweg Aarschot-Winge"), + + new Val( 175, 13856508, 345152127, 345078877, "Rijksweg", + "Rijksweg Aarschot-Winge - Steenweg op Sint-Joris-Winge (305;306;306 (student);310)", + "305;306;306 (student);310"), + + new Val( 174, 345078878, 345078877, 345078878, "Rijksweg"), + new Val( 173, 38208830, 345078877, 38208830, "Rijksweg"), + new Val( 172, 38208831, 345078877, 38208831, "Rijksweg"), + new Val( 171, 609510456, 345078877, 609510456, "Rijksweg"), + new Val( 170, 609510455, 345078877, 609510455, "Rijksweg"), + new Val( 169, 151083447, 345078877, 151083447, "Sint-Lambertusstraat"), + new Val( 168, 137613438, 345078877, 137613438, "Sint-Lambertusstraat"), + new Val( 167, 187995152, 345078877, 187995152, "Dorp"), + new Val( 166, 10242649, 345078877, 10242649, "Dorp"), + new Val( 165, 137613417, 345078877, 137613417, "Appelweg"), + new Val( 164, 112565994, 345078877, 112565994, "Appelweg"), + new Val( 163, 10242646, 345078877, 10242646, "Rodestraat"), + new Val( 162, 615260297, 345078877, 615260297, "Rodestraat"), + new Val( 161, 137613436, 345078877, 137613436, "Rodestraat"), + new Val( 160, 318267938, 345078877, 318267938, "Rodestraat"), + new Val( 159, 318267937, 345078877, 318267937, "Rodestraat"), + new Val( 158, 117329495, 345078877, 117329495, "Rodestraat"), + new Val( 157, 182275361, 345078877, 182275361, "Rodestraat"), + new Val( 156, 182275362, 345078877, 182275362, "Rodestraat"), + new Val( 155, 118479385, 345078877, 118479385, "Rodestraat"), + new Val( 154, 13858504, 345078877, 13858504, "Rodestraat"), + new Val( 153, 137613435, 345078877, 137613435, "Rodestraat"), + new Val( 152, 23334102, 345078877, 23334102, "Gravenstraat"), + new Val( 151, 13858501, 345078877, 13858501, "Gravenstraat"), + new Val( 150, 38501970, 345078877, 38501970, "Gravenstraat"), + new Val( 149, 13858502, 345078877, 13858502, "Gravenstraat"), + new Val( 148, 13858500, 345078877, 13858500, "Gravenstraat"), + new Val( 147, 182275357, 345078877, 182275357, "Gravenstraat"), + new Val( 146, 540115503, 345078877, 540115503, "Gravenstraat"), + new Val( 145, 13858519, 345078877, 13858519, "Dutselstraat"), + new Val( 144, 185929630, 345078877, 185929630, "Dutselstraat"), + new Val( 143, 137613419, 345078877, 137613419, "Dutselstraat"), + new Val( 142, 185929632, 345078877, 185929632, "Dutselstraat"), + new Val( 141, 185929631, 345078877, 185929631, "Dutselstraat"), + new Val( 140, 310306260, 345078877, 310306260, "Dutselstraat"), + new Val( 139, 22724214, 345078877, 22724214, "Dutselstraat"), + new Val( 138, 310306259, 345078877, 310306259, "Dutselstraat"), + new Val( 137, 310306431, 345078877, 310306431, "Kortrijksebaan"), + new Val( 136, 38502235, 345078877, 38502235, "Kortrijksebaan"), + new Val( 135, 659289513, 345078877, 659289513, "Kortrijksebaan"), + new Val( 134, 441280731, 345078877, 441280731, "Kortrijksebaan"), + new Val( 133, 659289514, 345078877, 659289514, "Kortrijksebaan"), + new Val( 132, 19112638, 345078877, 19112638, "Kortrijksebaan"), + new Val( 131, 310435230, 345078877, 310435230, "Kortrijksebaan"), + new Val( 130, 23957648, 345078877, 23957648, "Kortrijksebaan"), + new Val( 129, 173566709, 345078877, 173566709, "Kortrijksebaan"), + new Val( 128, 13858520, 345078877, 13858520, "Kortrijksebaan"), + new Val( 127, 181347876, 345078877, 181347876, "Kortrijksebaan"), + new Val( 126, 19166177, 345078877, 19166177, "Kortrijksebaan"), + new Val( 125, 310435229, 345078877, 310435229, "Kortrijksebaan"), + new Val( 124, 450119553, 345078877, 450119553, "Kortrijksebaan"), + new Val( 123, 181347873, 345078877, 181347873, "Nobelberg"), + new Val( 122, 16302925, 345078877, 16302925, "Nobelberg"), + + new Val( 121, 16302925, 345078877, 64487963, "Rotselaarsebaan", + "Nobelberg - Rijksweg (310)", + "310"), + + new Val( 120, 310435233, 64487963, 310435233, "Rotselaarsebaan"), + + new Val( 119, 310435233, 64487963, 112566004, "Sint-Maurusstraat", + "Rotselaarsebaan (310)", + "310"), + + new Val( 118, 16302928, 112566004, 16302928, null), + new Val( 117, 25667798, 112566004, 25667798, "Rotselaarsebaan"), + + new Val( 116, 25667798, 112566004, 310435233, "Rotselaarsebaan", + "Rotselaarsebaan - Sint-Maurusstraat (310)", + "310"), + + new Val( 115, 64487963, 310435233, 64487963, "Rotselaarsebaan"), + + new Val( 114, 64487963, 310435233, 310435232, "Nobelberg", + "Rotselaarsebaan (310)", + "310"), + + new Val( 113, 19166179, 310435232, 19166179, "Nobelberg"), + new Val( 112, 492765776, 310435232, 492765776, "Nobelberg"), + new Val( 111, 310461931, 310435232, 310461931, "Nobelberg"), + new Val( 110, 37370702, 310435232, 37370702, "Nobelberg"), + new Val( 109, 16302927, 310435232, 16302927, "Leuvensebaan"), + new Val( 108, 16302926, 310435232, 16302926, "Leuvensebaan"), + new Val( 107, 440732697, 310435232, 440732697, "Leuvensebaan"), + new Val( 106, 311007037, 310435232, 311007037, "Leuvensebaan"), + new Val( 105, 311007042, 310435232, 311007042, "Leuvensebaan"), + new Val( 104, 311007035, 310435232, 311007035, "Leuvensebaan"), + new Val( 103, 311007040, 310435232, 311007040, "Leuvensebaan"), + new Val( 102, 192559618, 310435232, 192559618, "Leuvensebaan"), + new Val( 101, 311007036, 310435232, 311007036, "Leuvensebaan"), + new Val( 100, 311007033, 310435232, 311007033, "Leuvensebaan"), + new Val( 99, 311007041, 310435232, 311007041, "Leuvensebaan"), + new Val( 98, 311007034, 310435232, 311007034, "Leuvensebaan"), + new Val( 97, 311007039, 310435232, 311007039, "Leuvensebaan"), + new Val( 96, 311007038, 310435232, 311007038, "Leuvensebaan"), + new Val( 95, 10699037, 310435232, 10699037, "Leuvensebaan"), + new Val( 94, 14393833, 310435232, 14393833, "Leuvensebaan"), + new Val( 93, 18943297, 310435232, 18943297, "Wilselsesteenweg"), + new Val( 92, 192559637, 310435232, 192559637, "Wilselsesteenweg"), + new Val( 91, 114935420, 310435232, 114935420, "Wilselsesteenweg"), + new Val( 90, 243884410, 310435232, 243884410, "Wilselsesteenweg"), + + new Val( 89, 243884410, 310435232, 98645243, "Wilselsesteenweg", + "Wilselsesteenweg - Nobelberg (310)", + "310"), + + new Val( 88, 98645223, 98645243, 98645223, "Wilselsesteenweg"), + new Val( 87, 38209648, 98645243, 38209648, "Wilselsesteenweg"), + new Val( 86, 125835556, 98645243, 125835556, "Kesseldallaan"), + new Val( 85, 112566013, 98645243, 112566013, "Kesseldallaan"), + + new Val( 84, 112566013, 98645243, 112566017, "Kesseldallaan", + "Kesseldallaan - Wilselsesteenweg (2;310)", + "2;310"), + + new Val( 83, 112566021, 112566017, 112566021, "Kesseldallaan"), + new Val( 82, 440732696, 112566017, 440732696, "Kesseldallaan"), + new Val( 81, 112566010, 112566017, 112566010, "Kesseldallaan"), + new Val( 80, 440732694, 112566017, 440732694, "Kesseldallaan"), + new Val( 79, 440732695, 112566017, 440732695, "Kesseldallaan"), + new Val( 78, 112566011, 112566017, 112566011, "Kesseldallaan"), + new Val( 77, 112565986, 112566017, 112565986, "Kesseldallaan"), + new Val( 76, 242622340, 112566017, 242622340, "Kesseldallaan"), + + new Val( 75, 242622340, 112566017, 33233154, "Kesseldallaan", + "Kesseldallaan (2;179;306;306 (student);310;433)", + "2;179;306;306 (student);310;433"), + + + new Val( 74, 33233154, 33233154, 112566015, "Eénmeilaan", + "Kesseldallaan (2;179;306;306 (student);310;433)", + "2;179;306;306 (student);310;433"), + + new Val( 73, 80284458, 112566015, 80284458, "Eénmeilaan"), + new Val( 72, 38245753, 112566015, 38245753, "Eénmeilaan"), + new Val( 71, 38245752, 112566015, 38245752, "Eénmeilaan"), + new Val( 70, 138017385, 112566015, 138017385, "Eénmeilaan"), + new Val( 69, 125835546, 112566015, 125835546, "Eénmeilaan"), + new Val( 68, 180167956, 112566015, 180167956, "Eénmeilaan"), + new Val( 67, 608715591, 112566015, 608715591, "Eénmeilaan"), + new Val( 66, 608715592, 112566015, 608715592, "Eénmeilaan"), + new Val( 65, 22476094, 112566015, 22476094, "Eénmeilaan"), + new Val( 64, 138017384, 112566015, 138017384, "Eénmeilaan"), + new Val( 63, 138017382, 112566015, 138017382, "Eénmeilaan"), + new Val( 62, 22476095, 112566015, 22476095, "Eénmeilaan"), + new Val( 61, 138017381, 112566015, 138017381, "Eénmeilaan"), + new Val( 60, 125835547, 112566015, 125835547, "Eénmeilaan"), + + new Val( 59, 125835547, 112566015, 79366165, "Baron August de Becker Remyplein", + "Eénmeilaan (179;306;306 (student);310;433)", + "179;306;306 (student);310;433"), + + + new Val( 58, 79366165, 79366165, 79366167, "Baron August de Becker Remyplein", + "Baron August de Becker Remyplein (2;179;306;306 (student);310;433;520)", + "2;179;306;306 (student);310;433;520"), + + new Val( 57, 79366164, 79366167, 79366164, "Baron August de Becker Remyplein"), + new Val( 56, 35633068, 79366167, 35633068, "Baron August de Becker Remyplein"), + new Val( 55, 608715602, 79366167, 608715602, "Baron August de Becker Remyplein"), + new Val( 54, 608715601, 79366167, 608715601, "Baron August de Becker Remyplein"), + new Val( 53, 608715604, 79366167, 608715604, "Baron August de Becker Remyplein"), + new Val( 52, 608715603, 79366167, 608715603, "Baron August de Becker Remyplein"), + new Val( 51, 429571921, 79366167, 429571921, "Baron August de Becker Remyplein"), + new Val( 50, 125835568, 79366167, 125835568, "Leuvensestraat"), + + new Val( 49, 125835568, 79366167, 23707244, "Diestsesteenweg", + "Leuvensestraat - Baron August de Becker Remyplein (2;179;306;306 (student);310;433;520)", + "2;179;306;306 (student);310;433;520"), + + new Val( 48, 12715116, 23707244, 12715116, "Diestsesteenweg"), + + new Val( 47, 12715116, 23707244, 61556877, "Diestsepoort", + "Diestsesteenweg (2;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", + "2;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + + new Val( 46, 663770966, 61556877, 663770966, "Diestsepoort"), + new Val( 45, 584356749, 61556877, 584356749, "Diestsepoort"), + new Val( 44, 584356745, 61556877, 584356745, "Diestsepoort"), + + new Val( 43, 584356745, 61556877, 198559166, "Diestsepoort", + "Diestsepoort (2;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + "2;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + + new Val( 42, 584356751, 198559166, 584356751, "Diestsepoort"), + new Val( 41, 451873773, 198559166, 451873773, "Diestsepoort"), + new Val( 40, 584356742, 198559166, 584356742, "Diestsepoort"), + new Val( 39, 451873774, 198559166, 451873774, "Diestsepoort"), + + new Val( 38, 451873774, 198559166, 76867049, null, + "Diestsepoort (2;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + "2;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + + new Val( 37, 79264890, 76867049, 79264890, null), + new Val( 36, 79596965, 76867049, 79596965, null), + + new Val( 35, 79596965, 76867049, 71754927, null, + "(2;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + "2;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + + + new Val( 34, 71754927, 71754927, 79264897, null, + "(2;310;370;371;373;374;475;485;513;520;524;525)", + "2;310;370;371;373;374;475;485;513;520;524;525"), + + new Val( 33, 79596983, 79264897, 79596983, null), + + new Val( 32, 79596983, 79264897, 377918665, null, + "(2;310)", + "2;310"), + + + new Val( 31, 377918665, 377918665, 377918665, null, + "perron 7 & 8 (2;310)", + "2;310") + ); + + previousSegment = new RouteSegmentToExtract(bus310_Leuven_Aarschot_Station_RouteRelation); + previousSegment.setActiveDataSet(ds); + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, bus310_Leuven_Aarschot_Station_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + } + + System.out.print("\n"); + +// printListOfExpectedValues(bus310_Leuven_Aarschot_Station_RouteRelation, "bus310_Leuven_Aarschot_Station_RouteRelation", false); + } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, @@ -2287,9 +2466,10 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); final String actualRouteRef = createdSegment.getLineIdentifiersSignature(); assertEquals(expectedRouteRef, actualRouteRef); + assertEquals(expectedRouteRef, extractedRelation.get("route_ref")); assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); - // newSegment should have the last way we tried to add to this segment + // newSegment should have the last that was added to this segment if (firstWayIdForNewSegment != 0) { assertNotNull(String.format("No new segment was created for way\n%s%s at position %d", rc, firstWayIdForNewSegment, index), newSegment); final long wayId = newSegment.getWayMembers().get(0).getWay().getId(); @@ -2300,25 +2480,80 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS } /** - * This creates a list of variable definitions to be used in unit tests + * This prints a list of known values to be used in unit tests * - * @param relation the route relation to print a list of ways with their ids for + * @param relation the route relation to print a list of known values for + * @param nameOfVariable the variable name repeated as a string + * @param firstOne true if this is the first in a series of consecutive tests + * and the variables still need to be declared */ @SuppressWarnings("unused") - public void printListOfWays(Relation relation) { + public void printListOfExpectedValues(Relation relation, String nameOfVariable, boolean firstOne) { List members = relation.getMembers(); + RouteSegmentToExtract segment = new RouteSegmentToExtract(relation); + List wayMembers = segment.getWayMembers(); + String listVal = ""; + String className = ""; + if (firstOne) { + listVal = "List "; + className = "RouteSegmentToExtract "; + } + Way way = null; + int lastIndex = 0; + System.out.printf(" %sexpectedValues = Arrays.asList(\n", listVal); for (int i = members.size() - 1; i >= 0; i--) { RelationMember member = members.get(i); if (member.isWay() && RouteUtils.isPTWay(member)) { - Way way = member.getWay(); - String id = String.valueOf(way.getId()); - String name = ""; - if (way.hasKey("name")) name = way.get("name"); - name = name.replace("-", "_"); - name = name.replace(" ", "_"); - name += "_"; - System.out.printf("final int W_%s_%s%s_ = %s;%n", i, name, id, id); + way = member.getWay(); + RouteSegmentToExtract ns = segment.addPTWayMember(i); + wayMembers = segment.getWayMembers(); + if (ns != null) { + System.out.printf("\n new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\",\n \"%s\"),\n\n", + i, + wayMembers.get(0).getMember().getId(), + wayMembers.get(wayMembers.size() - 1).getMember().getId(), + (way != null && way.getId() != 0) ? way.getId() : 0, + (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"": null, + segment.getNote(), + segment.getLineIdentifiersSignature() + ); + segment = ns; + } else { + System.out.printf(" new Val(% 3d,% 10d,% 10d,% 10d, %s),\n", + i, + wayMembers.get(0).getMember().getId(), + wayMembers.get(wayMembers.size() - 1).getMember().getId(), + (way != null && way.getId() != 0) ? way.getId() : 0, + (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"": null + ); + } + } else { + lastIndex = i; + break; } } + System.out.printf("\n new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\",\n \"%s\")\n );\n\n", + lastIndex, + (wayMembers != null && wayMembers.size() > 0) ? wayMembers.get(0).getMember().getId() : 0, + (wayMembers != null && wayMembers.size() > 1) ? wayMembers.get(wayMembers.size() - 1).getMember().getId() : 0, + (way != null && way.getId() != 0) ? way.getId() : 0, + (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"": null, + segment.getNote(), + segment.getLineIdentifiersSignature() + ); + System.out.printf(" %spreviousSegment = new RouteSegmentToExtract(%s);\n", className, nameOfVariable); + System.out.print (" previousSegment.setActiveDataSet(ds);\n"); + if (firstOne) { + System.out.printf(" %ssegment;\n", className); + } + System.out.print (" for (Val v: expectedValues) {\n" + + " segment = previousSegment.addPTWayMember(v.index);\n" + + " if (segment != null) {\n"); + System.out.printf(" extractAndAssertValues(v.index, previousSegment, segment, %s, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay,\n", nameOfVariable); + System.out.print( " null, v.expectedRouteRef);\n" + + " previousSegment = segment;\n" + + " }\n" + + " }\n\n" + + " System.out.print(\"\\n\");\n\n"); } } From 11a99a371aaa975781d1f3a2df4b2c5b6ba134a5 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 21 Oct 2020 10:18:23 +0200 Subject: [PATCH 40/52] During live testing I get an Index out of bounds exception, when processing line 433 (and 333). I also regularly get java.lang.IllegalArgumentException: Width and height must be >= 0 while browsing the map, with a relation editor window open. Annoyingly I can't figure out how to reproduce these exceptions in my unit tests. --- .../data/RouteSegmentToExtractTest.java | 302 +++++++++++++++++- 1 file changed, 300 insertions(+), 2 deletions(-) diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index df1d59ee..b53deb42 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -2,6 +2,9 @@ import org.junit.BeforeClass; import org.junit.Test; +import org.openstreetmap.josm.actions.OrthogonalizeAction; +import org.openstreetmap.josm.command.ChangeCommand; +import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.Way; @@ -2451,7 +2454,302 @@ public void bus601_600_3_Test() { System.out.print("\n"); -// printListOfExpectedValues(bus310_Leuven_Aarschot_Station_RouteRelation, "bus310_Leuven_Aarschot_Station_RouteRelation", false); + // *********************************************************** + // Line 433 is an express bus + // During interactive testing it causes an Index out of bounds exception + // for the variant that goes from Tremelo to Leuven + // Line 333 has the same issue, but this one is a bit shorter + // *********************************************************** + + Relation bus433_Tremelo_Leuven_RouteRelation = allRelations.stream() + .filter(relation -> relation.getId() == 5451452) + .findFirst().orElse(null); + + assertNotNull(bus433_Tremelo_Leuven_RouteRelation); + RouteSegmentToExtract segment601 = new RouteSegmentToExtract(bus433_Tremelo_Leuven_RouteRelation); + segment601.setActiveDataSet(ds); + + assertEquals(bus433_Tremelo_Leuven_RouteRelation.get("ref"), segment601.getLineIdentifiersSignature()); + assertEquals(bus433_Tremelo_Leuven_RouteRelation.get("colour"), segment601.getColoursSignature()); + + assertNull(segment601.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment601.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment601.getWayMembers()); + + Relation clonedRelation = bus433_Tremelo_Leuven_RouteRelation; + + expectedValues = Arrays.asList( + new Val( 167, 78579065, 78579065, 78579065, null), + new Val( 166, 377814547, 78579065, 377814547, null), + + new Val( 165, 377814547, 78579065, 79596986, null, + "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", + "1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658"), + + + new Val( 164, 79596986, 79596986, 79211473, "Tiensevest", + "(305;306;310;318;358;410;433;475;485;601;658)", + "305;306;310;318;358;410;433;475;485;601;658"), + + + new Val( 163, 79211473, 79211473, 79211472, "Tiensevest", + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", + "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), + + + new Val( 162, 79211472, 79211472, 79175435, "Tiensevest", + "Tiensevest (2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", + "2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), + + + new Val( 161, 79175435, 79175435, 80458208, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)", + "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658"), + + + new Val( 160, 80458208, 80458208, 19793164, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658)", + "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658"), + + + new Val( 159, 19793164, 19793164, 4884707, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658)", + "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"), + + + new Val( 158, 4884707, 4884707, 116797179, "Diestsepoort", + "Tiensevest (284;285;306;310;315;316;317;395;433;475;485)", + "284;285;306;310;315;316;317;395;433;475;485"), + + + new Val( 157, 116797179, 116797179, 116797180, "Diestsepoort", + "Diestsepoort (306;310;318;410;433)", + "306;310;318;410;433"), + + + new Val( 156, 116797180, 116797180, 451873774, "Diestsepoort", + "Diestsepoort (306;310;318;410;433;475;485)", + "306;310;318;410;433;475;485"), + + new Val( 155, 584356742, 451873774, 584356742, "Diestsepoort"), + + new Val( 154, 584356742, 451873774, 451873773, "Diestsepoort", + "Diestsepoort (2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)", + "2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525"), + + new Val( 153, 584356751, 451873773, 584356751, "Diestsepoort"), + new Val( 152, 198559166, 451873773, 198559166, "Diestsepoort"), + new Val( 151, 584356745, 451873773, 584356745, "Diestsepoort"), + new Val( 150, 584356749, 451873773, 584356749, "Diestsepoort"), + new Val( 149, 663770966, 451873773, 663770966, "Diestsepoort"), + new Val( 148, 61556877, 451873773, 61556877, "Diestsepoort"), + + new Val( 147, 61556877, 451873773, 8109264, "Diestsepoort", + "Diestsepoort (2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", + "2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + + new Val( 146, 125835524, 8109264, 125835524, "Diestsesteenweg"), + new Val( 145, 23707244, 8109264, 23707244, "Diestsesteenweg"), + + new Val( 144, 23707244, 8109264, 125835568, "Leuvensestraat", + "Diestsesteenweg - Diestsepoort (2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", + "2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + + new Val( 143, 429571921, 125835568, 429571921, "Baron August de Becker Remyplein"), + new Val( 142, 608715603, 125835568, 608715603, "Baron August de Becker Remyplein"), + new Val( 141, 608715604, 125835568, 608715604, "Baron August de Becker Remyplein"), + new Val( 140, 608715601, 125835568, 608715601, "Baron August de Becker Remyplein"), + new Val( 139, 608715602, 125835568, 608715602, "Baron August de Becker Remyplein"), + new Val( 138, 35633068, 125835568, 35633068, "Baron August de Becker Remyplein"), + new Val( 137, 125835500, 125835568, 125835500, "Baron August de Becker Remyplein"), + + new Val( 136, 125835500, 125835568, 125835547, "Eénmeilaan", + "Baron August de Becker Remyplein - Leuvensestraat (2;179;306;306 (student);310;333;433;512;520)", + "2;179;306;306 (student);310;333;433;512;520"), + + new Val( 135, 138017386, 125835547, 138017386, "Eénmeilaan"), + new Val( 134, 138017384, 125835547, 138017384, "Eénmeilaan"), + new Val( 133, 22476094, 125835547, 22476094, "Eénmeilaan"), + new Val( 132, 608715592, 125835547, 608715592, "Eénmeilaan"), + new Val( 131, 608715591, 125835547, 608715591, "Eénmeilaan"), + new Val( 130, 138017383, 125835547, 138017383, "Eénmeilaan"), + new Val( 129, 138017385, 125835547, 138017385, "Eénmeilaan"), + new Val( 128, 38245752, 125835547, 38245752, "Eénmeilaan"), + new Val( 127, 38245753, 125835547, 38245753, "Eénmeilaan"), + new Val( 126, 80284458, 125835547, 80284458, "Eénmeilaan"), + new Val( 125, 112566018, 125835547, 112566018, "Eénmeilaan"), + + new Val( 124, 112566018, 125835547, 242622344, "Kesseldallaan", + "Eénmeilaan (179;306;306 (student);310;333;433;512)", + "179;306;306 (student);310;333;433;512"), + + new Val( 123, 125835557, 242622344, 125835557, "Kesseldallaan"), + new Val( 122, 112566011, 242622344, 112566011, "Kesseldallaan"), + new Val( 121, 440732695, 242622344, 440732695, "Kesseldallaan"), + new Val( 120, 440732694, 242622344, 440732694, "Kesseldallaan"), + new Val( 119, 112566010, 242622344, 112566010, "Kesseldallaan"), + new Val( 118, 440732696, 242622344, 440732696, "Kesseldallaan"), + new Val( 117, 13823565, 242622344, 13823565, "Kesseldallaan"), + new Val( 116, 112565989, 242622344, 112565989, "Kesseldallaan"), + + new Val( 115, 112565989, 242622344, 192559635, "Duchesnelaan", + "Kesseldallaan (2;179;306;306 (student);310;333;433;512)", + "2;179;306;306 (student);310;333;433;512"), + + new Val( 114, 149117671, 192559635, 149117671, "Duchesnelaan"), + new Val( 113, 17540907, 192559635, 17540907, "Vuntcomplex"), + new Val( 112, 17540932, 192559635, 17540932, "Vuntcomplex"), + new Val( 111, 315666514, 192559635, 315666514, "Vuntcomplex"), + + new Val( 110, 315666514, 192559635, 315666515, "Vuntcomplex", + "Vuntcomplex - Duchesnelaan (179;306;306 (student);333;433;512)", + "179;306;306 (student);333;433;512"), + + + new Val( 109, 315666515, 315666515, 345381449, "Vuntcomplex", + "Vuntcomplex (179;306;306 (student);333;433;512)", + "179;306;306 (student);333;433;512"), + + new Val( 108, 225497053, 345381449, 225497053, "Vuntcomplex"), + + new Val( 107, 225497053, 345381449, 345381452, "Vuntcomplex", + "Vuntcomplex (179;306;306 (student);333;433;512)", + "179;306;306 (student);333;433;512"), + + new Val( 106, 345381453, 345381452, 345381453, "Vuntcomplex"), + new Val( 105, 4004855, 345381452, 4004855, "Vuntcomplex"), + + new Val( 104, 4004855, 345381452, 13882237, "Aarschotsesteenweg", + "Vuntcomplex (333;433;512)", + "333;433;512"), + + new Val( 103, 351000218, 13882237, 351000218, "Aarschotsesteenweg"), + new Val( 102, 440732691, 13882237, 440732691, "Aarschotsesteenweg"), + new Val( 101, 345381437, 13882237, 345381437, "Aarschotsesteenweg"), + new Val( 100, 377918607, 13882237, 377918607, "Aarschotsesteenweg"), + new Val( 99, 377918608, 13882237, 377918608, "Aarschotsesteenweg"), + new Val( 98, 37713149, 13882237, 37713149, "Aarschotsesteenweg"), + new Val( 97, 631979428, 13882237, 631979428, "Aarschotsesteenweg"), + new Val( 96, 345381435, 13882237, 345381435, "Aarschotsesteenweg"), + new Val( 95, 79299306, 13882237, 79299306, "Aarschotsesteenweg"), + + new Val( 94, 79299306, 13882237, 345381434, "Aarschotsesteenweg", + "Aarschotsesteenweg (333;334;335;433;512;513;630)", + "333;334;335;433;512;513;630"), + + new Val( 93, 38159440, 345381434, 38159440, "Aarschotsesteenweg"), + new Val( 92, 780600572, 345381434, 780600572, "Aarschotsesteenweg"), + new Val( 91, 780600573, 345381434, 780600573, "Aarschotsesteenweg"), + new Val( 90, 38159437, 345381434, 38159437, "Aarschotsesteenweg"), + new Val( 89, 16201617, 345381434, 16201617, "Aarschotsesteenweg"), + new Val( 88, 663909831, 345381434, 663909831, "Aarschotsesteenweg"), + new Val( 87, 440732693, 345381434, 440732693, "Aarschotsesteenweg"), + new Val( 86, 439397679, 345381434, 439397679, "Aarschotsesteenweg"), + new Val( 85, 441677446, 345381434, 441677446, "Aarschotsesteenweg"), + new Val( 84, 14099896, 345381434, 14099896, "Aarschotsesteenweg"), + new Val( 83, 14099966, 345381434, 14099966, "Aarschotsesteenweg"), + new Val( 82, 16201055, 345381434, 16201055, "Aarschotsesteenweg"), + + new Val( 81, 16201055, 345381434, 23781189, "Stationsstraat", + "Aarschotsesteenweg (333;334;335;433;512;513)", + "333;334;335;433;512;513"), + + new Val( 80, 663909838, 23781189, 663909838, "Stationsstraat"), + new Val( 79, 98825487, 23781189, 98825487, "Stationsstraat"), + new Val( 78, 23024091, 23781189, 23024091, "Stationsstraat"), + new Val( 77, 23024090, 23781189, 23024090, "Stationsstraat"), + new Val( 76, 15220439, 23781189, 15220439, "Stationsstraat"), + + new Val( 75, 15220439, 23781189, 13899067, "Provinciebaan", + "Stationsstraat (333;335;433;513)", + "333;335;433;513"), + + new Val( 74, 116535756, 13899067, 116535756, "Provinciebaan"), + new Val( 73, 116535766, 13899067, 116535766, "Provinciebaan"), + new Val( 72, 521082436, 13899067, 521082436, "Provinciebaan"), + new Val( 71, 100083559, 13899067, 100083559, "Provinciebaan"), + new Val( 70, 25706275, 13899067, 25706275, "Provinciebaan"), + new Val( 69, 25706276, 13899067, 25706276, "Provinciebaan"), + new Val( 68, 37712785, 13899067, 37712785, "Provinciebaan"), + new Val( 67, 116535777, 13899067, 116535777, "Provinciebaan"), + new Val( 66, 100086271, 13899067, 100086271, "Provinciebaan"), + new Val( 65, 27107407, 13899067, 27107407, "Provinciebaan"), + + new Val( 64, 27107407, 13899067, 24041208, "Provinciebaan", + "Provinciebaan (333;433;512;513)", + "333;433;512;513"), + + new Val( 63, 292670112, 24041208, 292670112, "Nieuwebaan"), + new Val( 62, 292670110, 24041208, 292670110, "Nieuwebaan"), + new Val( 61, 292670113, 24041208, 292670113, "Nieuwebaan"), + new Val( 60, 292670115, 24041208, 292670115, "Nieuwebaan"), + new Val( 59, 292670109, 24041208, 292670109, "Nieuwebaan"), + new Val( 58, 98918943, 24041208, 98918943, "Nieuwebaan"), + new Val( 57, 292820652, 24041208, 292820652, "Nieuwebaan"), + new Val( 56, 13858894, 24041208, 13858894, "Hoekje"), + new Val( 55, 24037032, 24041208, 24037032, "Hoekje"), + new Val( 54, 26591703, 24041208, 26591703, "Werchterplein"), + new Val( 53, 21355673, 24041208, 21355673, "Sint-Jansstraat"), + new Val( 52, 116911351, 24041208, 116911351, "Sint-Jansstraat"), + new Val( 51, 205303321, 24041208, 205303321, "Sint-Jansstraat"), + new Val( 50, 205303322, 24041208, 205303322, "Sint-Jansstraat"), + new Val( 49, 205303320, 24041208, 205303320, "Sint-Jansstraat"), + new Val( 48, 49577807, 24041208, 49577807, "Sint-Jansstraat"), + new Val( 47, 116704290, 24041208, 116704290, "Tremelobaan"), + new Val( 46, 32823731, 24041208, 32823731, "Tremelobaan"), + new Val( 45, 349648271, 24041208, 349648271, "Tremelobaan"), + new Val( 44, 25706363, 24041208, 25706363, "Tremelobaan"), + new Val( 43, 349648272, 24041208, 349648272, "Tremelobaan"), + new Val( 42, 349648273, 24041208, 349648273, "Tremelobaan"), + new Val( 41, 349648270, 24041208, 349648270, "Tremelobaan"), + new Val( 40, 25706405, 24041208, 25706405, "Tremelobaan"), + new Val( 39, 126264637, 24041208, 126264637, "Tremelobaan"), + new Val( 38, 22080651, 24041208, 22080651, "Tremelobaan"), + new Val( 37, 22080665, 24041208, 22080665, "Werchtersebaan"), + new Val( 36, 116911317, 24041208, 116911317, "Werchtersebaan"), + new Val( 35, 116911322, 24041208, 116911322, "Werchtersebaan"), + new Val( 34, 116911310, 24041208, 116911310, "Werchtersebaan"), + new Val( 33, 116911314, 24041208, 116911314, "Werchtersebaan"), + new Val( 32, 106526409, 24041208, 106526409, "Werchtersebaan"), + new Val( 31, 106526391, 24041208, 106526391, "Werchtersebaan"), + new Val( 30, 106526331, 24041208, 106526331, null), + new Val( 29, 79057173, 24041208, 79057173, null), + new Val( 28, 106526457, 24041208, 106526457, null), + new Val( 27, 25706520, 24041208, 25706520, "Schrieksebaan"), + new Val( 26, 244077928, 24041208, 244077928, "Schrieksebaan"), + new Val( 25, 79057162, 24041208, 79057162, "Schrieksebaan"), + new Val( 24, 348402887, 24041208, 348402887, "Schrieksebaan"), + new Val( 23, 116911330, 24041208, 116911330, "Schrieksebaan"), + new Val( 22, 20402695, 24041208, 20402695, "Astridstraat"), + new Val( 21, 26614159, 24041208, 26614159, null), + new Val( 20, 255018560, 24041208, 255018560, null), + new Val( 19, 845727172, 24041208, 845727172, null), + new Val( 18, 255018553, 24041208, 255018553, null), + new Val( 17, 520502050, 24041208, 520502050, null), + + new Val( 16, 520502050, 24041208, 520502050, null, + "Astridstraat - Provinciebaan (333;433)", + "333;433") + ); + + previousSegment = new RouteSegmentToExtract(clonedRelation); + previousSegment.setActiveDataSet(ds); + for (Val v: expectedValues) { + segment = previousSegment.addPTWayMember(v.index); + if (segment != null) { + extractAndAssertValues(v.index, previousSegment, segment, clonedRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + null, v.expectedRouteRef); + previousSegment = segment; + } + UndoRedoHandler.getInstance().add(new ChangeCommand(bus433_Tremelo_Leuven_RouteRelation, clonedRelation)); + UndoRedoHandler.getInstance().undo(); + } + UndoRedoHandler.getInstance().add(new ChangeCommand(bus433_Tremelo_Leuven_RouteRelation, clonedRelation)); + + System.out.print("\n"); + +// printListOfExpectedValues(bus433_Tremelo_Leuven_RouteRelation, "bus433_Tremelo_Leuven_RouteRelation", false); } @@ -2469,7 +2767,7 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS assertEquals(expectedRouteRef, extractedRelation.get("route_ref")); assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); - // newSegment should have the last that was added to this segment + // newSegment should have the last way that was added to this segment if (firstWayIdForNewSegment != 0) { assertNotNull(String.format("No new segment was created for way\n%s%s at position %d", rc, firstWayIdForNewSegment, index), newSegment); final long wayId = newSegment.getWayMembers().get(0).getWay().getId(); From 6b01f01b2c167b823bb59fbe96e75ce7506a5bfb Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 23 Oct 2020 11:31:39 +0200 Subject: [PATCH 41/52] Moved isItineraryInSameDirection to WaySequence class. Intermediary commit before simplifying isItineraryInSameDirection --- .../data/RouteSegmentToExtract.java | 50 +------ .../pt_assistant/data/WaySequence.java | 69 +++++++++- .../data/RouteSegmentToExtractTest.java | 126 ++++++++++-------- 3 files changed, 139 insertions(+), 106 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 634ee853..2286a8cd 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -377,7 +377,7 @@ public TreeSet getItinerariesInSameDirection(WaySequence ws, itinerariesInSameDirection.add(parentRoute); } findPreviousAndNextWayInRoute(parentRouteHighways, ws.currentWay).stream() - .filter(waysInParentRoute -> isItineraryInSameDirection(ws, waysInParentRoute)) + .filter(waysInParentRoute -> ws.isItineraryInSameDirection(waysInParentRoute)) .map(waysInParentRoute -> parentRoute) .forEachOrdered(itinerariesInSameDirection::add); } @@ -410,8 +410,8 @@ public long getMembershipCountOfWayInSameDirection(Way way, Relation routeRelati int counter = indices.size(); for (int i = 0; i < indices.size() - 1 ; i++) { - if (!isItineraryInSameDirection(new WaySequence(routeRelation, indices.get(i)), - new WaySequence(routeRelation, indices.get(i+1)))) { + if (!new WaySequence(routeRelation, indices.get(i)).isItineraryInSameDirection( + new WaySequence(routeRelation, indices.get(i+1)))) { counter--; } } @@ -430,50 +430,6 @@ public List getIndicesFor(OsmPrimitive primitive, Relation routeRelatio return indices; } - public boolean isItineraryInSameDirection(WaySequence ws, - WaySequence parent_ws) { - assert ws.currentWay == parent_ws.currentWay : - "this only works when comparing two equivalent way sequences" ; - - // if all ways are present, try the simple solution first - if (ws.previousWay != null - && ws.nextWay != null - && parent_ws.previousWay != null - && parent_ws.nextWay != null - && (ws.previousWay == parent_ws.previousWay - || ws.nextWay == parent_ws.nextWay) - ) { - return (!ws.previousWay.equals(parent_ws.nextWay) && - !ws.nextWay. equals(parent_ws.previousWay)); - } - - // if not, compare on the nodes - Node firstNodeCurrentWay = null; - if (ws.previousWay != null) { - firstNodeCurrentWay = WayUtils.findCommonFirstLastNode( - ws.previousWay, ws.currentWay).orElse(null); - } - Node lastNodeCurrentWay = null; - if (ws.nextWay != null) { - lastNodeCurrentWay = WayUtils.findCommonFirstLastNode( - ws.currentWay, ws.nextWay).orElse(null); - } - Node firstNodeWayOfParent = null; - if (parent_ws.previousWay != null) { - firstNodeWayOfParent = WayUtils.findCommonFirstLastNode( - parent_ws.previousWay, parent_ws.currentWay).orElse(null); - } - Node lastNodeWayOfParent = null; - if (parent_ws.nextWay != null) { - lastNodeWayOfParent = WayUtils.findCommonFirstLastNode( - parent_ws.currentWay, parent_ws.nextWay).orElse(null); - } - - return (firstNodeCurrentWay != null && firstNodeCurrentWay.equals(firstNodeWayOfParent) - || - lastNodeCurrentWay != null && lastNodeCurrentWay.equals(lastNodeWayOfParent)); - } - /** * for all occurrences of wayToLocate this method returns the way before it and the way after it * @param highwayMembers The members list of the relation diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java index efd46878..5dd01138 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -1,9 +1,11 @@ package org.openstreetmap.josm.plugins.pt_assistant.data; +import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.data.osm.Way; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; +import org.openstreetmap.josm.plugins.pt_assistant.utils.WayUtils; import java.util.List; @@ -15,6 +17,7 @@ */ public final class WaySequence { public boolean hasGap = false; + public int traversalSense; public Way previousWay; public Way currentWay; public Way nextWay; @@ -50,7 +53,6 @@ public WaySequence(Relation relation, int index) { } else { // the member was probably a stop or a platform currentWay = null; - return; } if (index > 1) setPreviousPtWay(relation.getMember(index - 1)); final int membersCount = relation.getMembersCount(); @@ -97,6 +99,7 @@ public void setPreviousWay(Way way) { previousWay = null; hasGap = true; } + getTraversalSense(); } /** @@ -104,12 +107,13 @@ public void setPreviousWay(Way way) { * a check is performed to make sure they actually connect */ public void setNextWay(Way way) { - if (way == null || RouteUtils.waysTouch(currentWay, way)) { + if (way == null || currentWay == null || RouteUtils.waysTouch(currentWay, way)) { nextWay = way; } else { nextWay = null; hasGap = true; } + getTraversalSense(); } /** @@ -184,4 +188,65 @@ public void setAfterNextPtWay(RelationMember afterNextMember) { wayAfterNextWay = null; } } + + public int getTraversalSense() { + if (traversalSense == 0) { + if (currentWay != null) { + if (previousWay != null || nextWay != null) { + if (currentWay.firstNode().equals(WayUtils.findCommonFirstLastNode(previousWay, currentWay).orElse(null)) + && currentWay.lastNode().equals(WayUtils.findCommonFirstLastNode(currentWay, nextWay).orElse(null))) { + return 1; + } else { + return -1; + } + } + } + } else { + return traversalSense; + } + return 0; + } + + public boolean isItineraryInSameDirection(WaySequence parent_ws) { + assert currentWay == parent_ws.currentWay : + "this only works when comparing two equivalent way sequences" ; + + // if all ways are present, try the simple solution first + if (previousWay != null + && nextWay != null + && parent_ws.previousWay != null + && parent_ws.nextWay != null + && (previousWay == parent_ws.previousWay + || nextWay == parent_ws.nextWay) + ) { + return (!previousWay.equals(parent_ws.nextWay) && + !nextWay. equals(parent_ws.previousWay)); + } + + // if not, compare on the nodes + Node firstNodeCurrentWay = null; + if (previousWay != null) { + firstNodeCurrentWay = WayUtils.findCommonFirstLastNode( + previousWay, currentWay).orElse(null); + } + Node lastNodeCurrentWay = null; + if (nextWay != null) { + lastNodeCurrentWay = WayUtils.findCommonFirstLastNode( + currentWay, nextWay).orElse(null); + } + Node firstNodeWayOfParent = null; + if (parent_ws.previousWay != null) { + firstNodeWayOfParent = WayUtils.findCommonFirstLastNode( + parent_ws.previousWay, parent_ws.currentWay).orElse(null); + } + Node lastNodeWayOfParent = null; + if (parent_ws.nextWay != null) { + lastNodeWayOfParent = WayUtils.findCommonFirstLastNode( + parent_ws.currentWay, parent_ws.nextWay).orElse(null); + } + + return (firstNodeCurrentWay != null && firstNodeCurrentWay.equals(firstNodeWayOfParent) + || + lastNodeCurrentWay != null && lastNodeCurrentWay.equals(lastNodeWayOfParent)); + } } diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index b53deb42..044fd09d 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -2,7 +2,6 @@ import org.junit.BeforeClass; import org.junit.Test; -import org.openstreetmap.josm.actions.OrthogonalizeAction; import org.openstreetmap.josm.command.ChangeCommand; import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.DataSet; @@ -107,8 +106,8 @@ public void isItineraryInSameDirectionTest() { bus371RouteRelation.getMembers().get(134).getWay()); RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation); segment601_1.setActiveDataSet(ds); - assertTrue(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf358)); - assertFalse(segment601_1.isItineraryInSameDirection(waysInParentRouteOf601, waysInParentRouteOf371)); + assertTrue(waysInParentRouteOf601.isItineraryInSameDirection(waysInParentRouteOf358)); + assertFalse(waysInParentRouteOf601.isItineraryInSameDirection(waysInParentRouteOf371)); Way commonWay = allWays.stream() .filter(way -> way.getId() == 75113358) @@ -139,23 +138,23 @@ public void isItineraryInSameDirectionTest() { WaySequence haasrodeToNeervelp = new WaySequence(toHaasrode,commonWay,toNeervelp); WaySequence blandenToNeervelp = new WaySequence(toBlanden,commonWay,toNeervelp); - assertTrue(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, leuvenToBlanden)); - assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, leuvenToHaasrode)); - assertTrue(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, blandenToLeuven)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, haasrodeToLeuven)); - assertTrue(segment601_1.isItineraryInSameDirection(neervelpToBlanden, neervelpToHaasrode)); - assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, neervelpToBlanden)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToNeervelp, blandenToLeuven)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, blandenToNeervelp)); - - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden)); - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode)); + assertTrue(leuvenToHaasrode.isItineraryInSameDirection(leuvenToBlanden)); + assertTrue(leuvenToBlanden.isItineraryInSameDirection(leuvenToHaasrode)); + assertTrue(haasrodeToLeuven.isItineraryInSameDirection(blandenToLeuven)); + assertTrue(blandenToLeuven.isItineraryInSameDirection(haasrodeToLeuven)); + assertTrue(neervelpToBlanden.isItineraryInSameDirection(neervelpToHaasrode)); + assertTrue(neervelpToHaasrode.isItineraryInSameDirection(neervelpToBlanden)); + assertTrue(blandenToNeervelp.isItineraryInSameDirection(blandenToLeuven)); + assertTrue(blandenToLeuven.isItineraryInSameDirection(blandenToNeervelp)); + + assertFalse(leuvenToBlanden.isItineraryInSameDirection(blandenToLeuven)); + assertFalse(blandenToLeuven.isItineraryInSameDirection(leuvenToBlanden)); + assertFalse(leuvenToHaasrode.isItineraryInSameDirection(haasrodeToLeuven)); + assertFalse(haasrodeToLeuven.isItineraryInSameDirection(leuvenToHaasrode)); + assertFalse(neervelpToBlanden.isItineraryInSameDirection(blandenToNeervelp)); + assertFalse(blandenToNeervelp.isItineraryInSameDirection(neervelpToBlanden)); + assertFalse(neervelpToHaasrode.isItineraryInSameDirection(haasrodeToNeervelp)); + assertFalse(haasrodeToNeervelp.isItineraryInSameDirection(neervelpToHaasrode)); WaySequence missingToBlanden = new WaySequence(null,commonWay,toBlanden); WaySequence missingToHaasrode = new WaySequence(null,commonWay,toHaasrode); @@ -166,23 +165,23 @@ public void isItineraryInSameDirectionTest() { WaySequence leuvenToMissing = new WaySequence(toNeervelp,commonWay,null); WaySequence neervelpToMissing = new WaySequence(toNeervelp,commonWay,null); - assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, leuvenToBlanden)); - assertTrue(segment601_1.isItineraryInSameDirection(leuvenToBlanden, missingToBlanden)); - assertTrue(segment601_1.isItineraryInSameDirection(missingToLeuven, blandenToLeuven)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToLeuven)); - assertTrue(segment601_1.isItineraryInSameDirection(missingToBlanden, neervelpToHaasrode)); - assertTrue(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, missingToBlanden)); - assertTrue(segment601_1.isItineraryInSameDirection(missingToNeervelp, blandenToLeuven)); - assertTrue(segment601_1.isItineraryInSameDirection(blandenToLeuven, missingToNeervelp)); - - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToBlanden, blandenToLeuven)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToLeuven, leuvenToBlanden)); - assertFalse(segment601_1.isItineraryInSameDirection(leuvenToHaasrode, haasrodeToLeuven)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToLeuven, leuvenToHaasrode)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToBlanden, blandenToNeervelp)); - assertFalse(segment601_1.isItineraryInSameDirection(blandenToNeervelp, neervelpToBlanden)); - assertFalse(segment601_1.isItineraryInSameDirection(neervelpToHaasrode, haasrodeToNeervelp)); - assertFalse(segment601_1.isItineraryInSameDirection(haasrodeToNeervelp, neervelpToHaasrode)); + assertTrue(missingToBlanden.isItineraryInSameDirection(leuvenToBlanden)); + assertTrue(leuvenToBlanden.isItineraryInSameDirection(missingToBlanden)); + assertTrue(missingToLeuven.isItineraryInSameDirection(blandenToLeuven)); + assertTrue(blandenToLeuven.isItineraryInSameDirection(missingToLeuven)); + assertTrue(missingToBlanden.isItineraryInSameDirection(neervelpToHaasrode)); + assertTrue(neervelpToHaasrode.isItineraryInSameDirection(missingToBlanden)); + assertTrue(missingToNeervelp.isItineraryInSameDirection(blandenToLeuven)); + assertTrue(blandenToLeuven.isItineraryInSameDirection(missingToNeervelp)); + + assertFalse(leuvenToBlanden.isItineraryInSameDirection(blandenToLeuven)); + assertFalse(blandenToLeuven.isItineraryInSameDirection(leuvenToBlanden)); + assertFalse(leuvenToHaasrode.isItineraryInSameDirection(haasrodeToLeuven)); + assertFalse(haasrodeToLeuven.isItineraryInSameDirection(leuvenToHaasrode)); + assertFalse(neervelpToBlanden.isItineraryInSameDirection(blandenToNeervelp)); + assertFalse(blandenToNeervelp.isItineraryInSameDirection(neervelpToBlanden)); + assertFalse(neervelpToHaasrode.isItineraryInSameDirection(haasrodeToNeervelp)); + assertFalse(haasrodeToNeervelp.isItineraryInSameDirection(neervelpToHaasrode)); } @@ -208,6 +207,9 @@ public void f74_F75_Test() { @Test public void bus601_600_3_Test() { + List expectedValues; + RouteSegmentToExtract previousSegment = null; + RouteSegmentToExtract segment = null; Relation bus601RouteRelation = allRelations.stream() .filter(relation -> relation.getId() == 3612781) .findFirst().orElse(null); @@ -229,7 +231,7 @@ public void bus601_600_3_Test() { RouteSegmentToExtract returnValueNull; - List expectedValues = Arrays.asList( + expectedValues = Arrays.asList( new Val( 158, 78579065, 78579065, 78579065, null), new Val( 157, 377814547, 78579065, 377814547, null), @@ -583,9 +585,9 @@ public void bus601_600_3_Test() { new Val( 13, 338057820, 510790349, 338057820, "Engels Plein", "Engels Plein - Havenkant (601)", "601") - ); RouteSegmentToExtract previousSegment = new RouteSegmentToExtract(cloneOfBus601RouteRelation); + ); + previousSegment = new RouteSegmentToExtract(cloneOfBus601RouteRelation); previousSegment.setActiveDataSet(ds); - RouteSegmentToExtract segment; for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { @@ -1855,10 +1857,13 @@ public void bus601_600_3_Test() { new Val( 195, 502328837, 502328838, 502328837, "Ring Zuid"), new Val( 194, 8080023, 502328838, 8080023, "Ring Zuid"), new Val( 193, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 192, 78873921, 502328838, 78873921, "Rotonde Het Teken"), - new Val( 191, 78873921, 502328838, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + new Val( 192, 78568660, 502328838, 78873921, "Rotonde Het Teken", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + + new Val( 191, 78873921, 78873921, 3752557, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), @@ -2125,10 +2130,16 @@ public void bus601_600_3_Test() { "Dorpskring (3;373;485)", "3;373;485") ); + System.out.printf("***** %s *****\n\n", bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("name")); previousSegment = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); previousSegment.setActiveDataSet(ds); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); + if (v.expectedRouteRef == null) { + assertNull(String.format("%d segment should have returned null", v.index), segment); + } else { + assertNotNull(String.format("%d segment should have returned a new segment", v.index), segment); + } if (segment != null) { extractAndAssertValues(v.index, previousSegment, segment, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, null, v.expectedRouteRef); @@ -2397,16 +2408,16 @@ public void bus601_600_3_Test() { new Val( 48, 12715116, 23707244, 12715116, "Diestsesteenweg"), new Val( 47, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", - "2;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + "Diestsesteenweg (2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", + "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), new Val( 46, 663770966, 61556877, 663770966, "Diestsepoort"), new Val( 45, 584356749, 61556877, 584356749, "Diestsepoort"), new Val( 44, 584356745, 61556877, 584356745, "Diestsepoort"), new Val( 43, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", - "2;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), new Val( 42, 584356751, 198559166, 584356751, "Diestsepoort"), new Val( 41, 451873773, 198559166, 451873773, "Diestsepoort"), @@ -2414,33 +2425,34 @@ public void bus601_600_3_Test() { new Val( 39, 451873774, 198559166, 451873774, "Diestsepoort"), new Val( 38, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - "2;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), new Val( 37, 79264890, 76867049, 79264890, null), new Val( 36, 79596965, 76867049, 79596965, null), new Val( 35, 79596965, 76867049, 71754927, null, - "(2;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", - "2;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), new Val( 34, 71754927, 71754927, 79264897, null, - "(2;310;370;371;373;374;475;485;513;520;524;525)", - "2;310;370;371;373;374;475;485;513;520;524;525"), + "(2;3;310;370;371;373;374;475;485;513;520;524;525)", + "2;3;310;370;371;373;374;475;485;513;520;524;525"), new Val( 33, 79596983, 79264897, 79596983, null), new Val( 32, 79596983, 79264897, 377918665, null, - "(2;310)", - "2;310"), + "(2;3;310)", + "2;3;310"), new Val( 31, 377918665, 377918665, 377918665, null, - "perron 7 & 8 (2;310)", - "2;310") + "perron 7 & 8 (2;3;310)", + "2;3;310") ); + System.out.printf("*** %s ***", bus310_Leuven_Aarschot_Station_RouteRelation.get("name")); previousSegment = new RouteSegmentToExtract(bus310_Leuven_Aarschot_Station_RouteRelation); previousSegment.setActiveDataSet(ds); for (Val v: expectedValues) { From 977d54d6d8d90675a5477a8021009f3e22d753e4 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 23 Oct 2020 12:23:54 +0200 Subject: [PATCH 42/52] Some refactoring Moved isItineraryInSameDirection to WaySequence class and renamed it to compareTraversal. created a separate method to keep traversalSense property up-to-date. --- .../data/RouteSegmentToExtract.java | 4 +- .../pt_assistant/data/WaySequence.java | 74 +++++++------------ .../data/RouteSegmentToExtractTest.java | 72 +++++++++--------- 3 files changed, 64 insertions(+), 86 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 2286a8cd..3107e1f0 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -377,7 +377,7 @@ public TreeSet getItinerariesInSameDirection(WaySequence ws, itinerariesInSameDirection.add(parentRoute); } findPreviousAndNextWayInRoute(parentRouteHighways, ws.currentWay).stream() - .filter(waysInParentRoute -> ws.isItineraryInSameDirection(waysInParentRoute)) + .filter(waysInParentRoute -> ws.compareTraversal(waysInParentRoute)) .map(waysInParentRoute -> parentRoute) .forEachOrdered(itinerariesInSameDirection::add); } @@ -410,7 +410,7 @@ public long getMembershipCountOfWayInSameDirection(Way way, Relation routeRelati int counter = indices.size(); for (int i = 0; i < indices.size() - 1 ; i++) { - if (!new WaySequence(routeRelation, indices.get(i)).isItineraryInSameDirection( + if (!new WaySequence(routeRelation, indices.get(i)).compareTraversal( new WaySequence(routeRelation, indices.get(i+1)))) { counter--; } diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java index 5dd01138..40b05011 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -17,7 +17,7 @@ */ public final class WaySequence { public boolean hasGap = false; - public int traversalSense; + public int traversalSense = 0; public Way previousWay; public Way currentWay; public Way nextWay; @@ -189,64 +189,42 @@ public void setAfterNextPtWay(RelationMember afterNextMember) { } } + /** + * @return sense currentWay is traversed + * 1 forward traversal + * -1 backward traversal + * 0 traversal can't be determined yet + * it needs either currentWay and previousWay to be defined + * of currentWay and nextWay to be defined already + */ public int getTraversalSense() { if (traversalSense == 0) { if (currentWay != null) { - if (previousWay != null || nextWay != null) { - if (currentWay.firstNode().equals(WayUtils.findCommonFirstLastNode(previousWay, currentWay).orElse(null)) - && currentWay.lastNode().equals(WayUtils.findCommonFirstLastNode(currentWay, nextWay).orElse(null))) { - return 1; + if (previousWay != null && currentWay.firstNode() + .equals(WayUtils.findCommonFirstLastNode(previousWay, currentWay).orElse(null))) { + traversalSense = 1; + } else { + if (nextWay != null && currentWay.lastNode() + .equals(WayUtils.findCommonFirstLastNode(currentWay, nextWay).orElse(null))) { + traversalSense = 1; } else { - return -1; + traversalSense = -1; } } } - } else { - return traversalSense; } - return 0; + return traversalSense; } - public boolean isItineraryInSameDirection(WaySequence parent_ws) { - assert currentWay == parent_ws.currentWay : + /** + * compares the traversalSense of this WaySequence with the WaySequence in ws + * @param ws WaySequence to compare with + * @return true if currentWay is traversed in the same direction/sense + */ + public boolean compareTraversal(WaySequence ws) { + assert currentWay == ws.currentWay : "this only works when comparing two equivalent way sequences" ; - // if all ways are present, try the simple solution first - if (previousWay != null - && nextWay != null - && parent_ws.previousWay != null - && parent_ws.nextWay != null - && (previousWay == parent_ws.previousWay - || nextWay == parent_ws.nextWay) - ) { - return (!previousWay.equals(parent_ws.nextWay) && - !nextWay. equals(parent_ws.previousWay)); - } - - // if not, compare on the nodes - Node firstNodeCurrentWay = null; - if (previousWay != null) { - firstNodeCurrentWay = WayUtils.findCommonFirstLastNode( - previousWay, currentWay).orElse(null); - } - Node lastNodeCurrentWay = null; - if (nextWay != null) { - lastNodeCurrentWay = WayUtils.findCommonFirstLastNode( - currentWay, nextWay).orElse(null); - } - Node firstNodeWayOfParent = null; - if (parent_ws.previousWay != null) { - firstNodeWayOfParent = WayUtils.findCommonFirstLastNode( - parent_ws.previousWay, parent_ws.currentWay).orElse(null); - } - Node lastNodeWayOfParent = null; - if (parent_ws.nextWay != null) { - lastNodeWayOfParent = WayUtils.findCommonFirstLastNode( - parent_ws.currentWay, parent_ws.nextWay).orElse(null); - } - - return (firstNodeCurrentWay != null && firstNodeCurrentWay.equals(firstNodeWayOfParent) - || - lastNodeCurrentWay != null && lastNodeCurrentWay.equals(lastNodeWayOfParent)); + return getTraversalSense() == ws.getTraversalSense(); } } diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 044fd09d..9ed105f5 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -106,8 +106,8 @@ public void isItineraryInSameDirectionTest() { bus371RouteRelation.getMembers().get(134).getWay()); RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation); segment601_1.setActiveDataSet(ds); - assertTrue(waysInParentRouteOf601.isItineraryInSameDirection(waysInParentRouteOf358)); - assertFalse(waysInParentRouteOf601.isItineraryInSameDirection(waysInParentRouteOf371)); + assertTrue(waysInParentRouteOf601.compareTraversal(waysInParentRouteOf358)); + assertFalse(waysInParentRouteOf601.compareTraversal(waysInParentRouteOf371)); Way commonWay = allWays.stream() .filter(way -> way.getId() == 75113358) @@ -138,23 +138,23 @@ public void isItineraryInSameDirectionTest() { WaySequence haasrodeToNeervelp = new WaySequence(toHaasrode,commonWay,toNeervelp); WaySequence blandenToNeervelp = new WaySequence(toBlanden,commonWay,toNeervelp); - assertTrue(leuvenToHaasrode.isItineraryInSameDirection(leuvenToBlanden)); - assertTrue(leuvenToBlanden.isItineraryInSameDirection(leuvenToHaasrode)); - assertTrue(haasrodeToLeuven.isItineraryInSameDirection(blandenToLeuven)); - assertTrue(blandenToLeuven.isItineraryInSameDirection(haasrodeToLeuven)); - assertTrue(neervelpToBlanden.isItineraryInSameDirection(neervelpToHaasrode)); - assertTrue(neervelpToHaasrode.isItineraryInSameDirection(neervelpToBlanden)); - assertTrue(blandenToNeervelp.isItineraryInSameDirection(blandenToLeuven)); - assertTrue(blandenToLeuven.isItineraryInSameDirection(blandenToNeervelp)); - - assertFalse(leuvenToBlanden.isItineraryInSameDirection(blandenToLeuven)); - assertFalse(blandenToLeuven.isItineraryInSameDirection(leuvenToBlanden)); - assertFalse(leuvenToHaasrode.isItineraryInSameDirection(haasrodeToLeuven)); - assertFalse(haasrodeToLeuven.isItineraryInSameDirection(leuvenToHaasrode)); - assertFalse(neervelpToBlanden.isItineraryInSameDirection(blandenToNeervelp)); - assertFalse(blandenToNeervelp.isItineraryInSameDirection(neervelpToBlanden)); - assertFalse(neervelpToHaasrode.isItineraryInSameDirection(haasrodeToNeervelp)); - assertFalse(haasrodeToNeervelp.isItineraryInSameDirection(neervelpToHaasrode)); + assertTrue(leuvenToHaasrode.compareTraversal(leuvenToBlanden)); + assertTrue(leuvenToBlanden.compareTraversal(leuvenToHaasrode)); + assertTrue(haasrodeToLeuven.compareTraversal(blandenToLeuven)); + assertTrue(blandenToLeuven.compareTraversal(haasrodeToLeuven)); + assertTrue(neervelpToBlanden.compareTraversal(neervelpToHaasrode)); + assertTrue(neervelpToHaasrode.compareTraversal(neervelpToBlanden)); + assertTrue(blandenToNeervelp.compareTraversal(blandenToLeuven)); + assertTrue(blandenToLeuven.compareTraversal(blandenToNeervelp)); + + assertFalse(leuvenToBlanden.compareTraversal(blandenToLeuven)); + assertFalse(blandenToLeuven.compareTraversal(leuvenToBlanden)); + assertFalse(leuvenToHaasrode.compareTraversal(haasrodeToLeuven)); + assertFalse(haasrodeToLeuven.compareTraversal(leuvenToHaasrode)); + assertFalse(neervelpToBlanden.compareTraversal(blandenToNeervelp)); + assertFalse(blandenToNeervelp.compareTraversal(neervelpToBlanden)); + assertFalse(neervelpToHaasrode.compareTraversal(haasrodeToNeervelp)); + assertFalse(haasrodeToNeervelp.compareTraversal(neervelpToHaasrode)); WaySequence missingToBlanden = new WaySequence(null,commonWay,toBlanden); WaySequence missingToHaasrode = new WaySequence(null,commonWay,toHaasrode); @@ -165,23 +165,23 @@ public void isItineraryInSameDirectionTest() { WaySequence leuvenToMissing = new WaySequence(toNeervelp,commonWay,null); WaySequence neervelpToMissing = new WaySequence(toNeervelp,commonWay,null); - assertTrue(missingToBlanden.isItineraryInSameDirection(leuvenToBlanden)); - assertTrue(leuvenToBlanden.isItineraryInSameDirection(missingToBlanden)); - assertTrue(missingToLeuven.isItineraryInSameDirection(blandenToLeuven)); - assertTrue(blandenToLeuven.isItineraryInSameDirection(missingToLeuven)); - assertTrue(missingToBlanden.isItineraryInSameDirection(neervelpToHaasrode)); - assertTrue(neervelpToHaasrode.isItineraryInSameDirection(missingToBlanden)); - assertTrue(missingToNeervelp.isItineraryInSameDirection(blandenToLeuven)); - assertTrue(blandenToLeuven.isItineraryInSameDirection(missingToNeervelp)); - - assertFalse(leuvenToBlanden.isItineraryInSameDirection(blandenToLeuven)); - assertFalse(blandenToLeuven.isItineraryInSameDirection(leuvenToBlanden)); - assertFalse(leuvenToHaasrode.isItineraryInSameDirection(haasrodeToLeuven)); - assertFalse(haasrodeToLeuven.isItineraryInSameDirection(leuvenToHaasrode)); - assertFalse(neervelpToBlanden.isItineraryInSameDirection(blandenToNeervelp)); - assertFalse(blandenToNeervelp.isItineraryInSameDirection(neervelpToBlanden)); - assertFalse(neervelpToHaasrode.isItineraryInSameDirection(haasrodeToNeervelp)); - assertFalse(haasrodeToNeervelp.isItineraryInSameDirection(neervelpToHaasrode)); + assertTrue(missingToBlanden.compareTraversal(leuvenToBlanden)); + assertTrue(leuvenToBlanden.compareTraversal(missingToBlanden)); + assertTrue(missingToLeuven.compareTraversal(blandenToLeuven)); + assertTrue(blandenToLeuven.compareTraversal(missingToLeuven)); + assertTrue(missingToBlanden.compareTraversal(neervelpToHaasrode)); + assertTrue(neervelpToHaasrode.compareTraversal(missingToBlanden)); + assertTrue(missingToNeervelp.compareTraversal(blandenToLeuven)); + assertTrue(blandenToLeuven.compareTraversal(missingToNeervelp)); + + assertFalse(leuvenToBlanden.compareTraversal(blandenToLeuven)); + assertFalse(blandenToLeuven.compareTraversal(leuvenToBlanden)); + assertFalse(leuvenToHaasrode.compareTraversal(haasrodeToLeuven)); + assertFalse(haasrodeToLeuven.compareTraversal(leuvenToHaasrode)); + assertFalse(neervelpToBlanden.compareTraversal(blandenToNeervelp)); + assertFalse(blandenToNeervelp.compareTraversal(neervelpToBlanden)); + assertFalse(neervelpToHaasrode.compareTraversal(haasrodeToNeervelp)); + assertFalse(haasrodeToNeervelp.compareTraversal(neervelpToHaasrode)); } From dbdd7788c53c22b1678598f6fdb683b8ba4790c5 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 23 Oct 2020 12:26:48 +0200 Subject: [PATCH 43/52] resolved some warnings from IntelliJ --- .../josm/plugins/pt_assistant/data/RouteSegmentToExtract.java | 2 +- .../josm/plugins/pt_assistant/data/WaySequence.java | 1 - .../plugins/pt_assistant/data/RouteSegmentToExtractTest.java | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 3107e1f0..b3fcf13b 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -377,7 +377,7 @@ public TreeSet getItinerariesInSameDirection(WaySequence ws, itinerariesInSameDirection.add(parentRoute); } findPreviousAndNextWayInRoute(parentRouteHighways, ws.currentWay).stream() - .filter(waysInParentRoute -> ws.compareTraversal(waysInParentRoute)) + .filter(ws::compareTraversal) .map(waysInParentRoute -> parentRoute) .forEachOrdered(itinerariesInSameDirection::add); } diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java index 40b05011..8804156d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -1,6 +1,5 @@ package org.openstreetmap.josm.plugins.pt_assistant.data; -import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.data.osm.Way; diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 9ed105f5..31c364f9 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -54,7 +54,6 @@ public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, String } } -@SuppressWarnings("NonAsciiCharacters") public class RouteSegmentToExtractTest extends AbstractTest{ private static DataSet ds; From 4c3ce5679470721fc3836e3401d30c78fb58eb0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Tue, 27 Oct 2020 14:25:55 +0100 Subject: [PATCH 44/52] Simplify dataset loading in RouteSegmentToExtractTest --- .../data/RouteSegmentToExtractTest.java | 268 ++++++++---------- 1 file changed, 113 insertions(+), 155 deletions(-) diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 31c364f9..97953641 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -1,26 +1,28 @@ package org.openstreetmap.josm.plugins.pt_assistant.data; -import org.junit.BeforeClass; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.openstreetmap.josm.io.OsmReader.parseDataSet; + +import java.io.FileInputStream; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + import org.junit.Test; import org.openstreetmap.josm.command.ChangeCommand; import org.openstreetmap.josm.data.UndoRedoHandler; import org.openstreetmap.josm.data.osm.DataSet; +import org.openstreetmap.josm.data.osm.OsmPrimitiveType; import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.data.osm.Way; - -import org.openstreetmap.josm.io.IllegalDataException; import org.openstreetmap.josm.plugins.pt_assistant.AbstractTest; -import org.openstreetmap.josm.data.osm.RelationMember; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.util.*; -import java.util.List; - -import static org.junit.Assert.*; -import static org.openstreetmap.josm.io.OsmReader.parseDataSet; - /** * An ExpectedValue for each index */ @@ -56,77 +58,61 @@ public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, String public class RouteSegmentToExtractTest extends AbstractTest{ - private static DataSet ds; - private static Collection allRelations; - private static Collection allWays; - private static DataSet ds2; - private static Collection allRelations2; - private final static String rc = " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way"; - - @BeforeClass - public static void init() throws FileNotFoundException, IllegalDataException { - ds = parseDataSet(new FileInputStream(PATH_TO_PT_BEFORE_SPLITTING_TEST), null); - allRelations = ds.getRelations(); - allWays = ds.getWays(); - ds2 = parseDataSet(new FileInputStream(PATH_TO_F74_F75_TEST), null); - allRelations2 = ds2.getRelations(); + private static final DataSet DATASET_BUSES_BEFORE_SPLITTING = loadDataSet(PATH_TO_PT_BEFORE_SPLITTING_TEST); + private static final DataSet DATASET_F74_F75 = loadDataSet(PATH_TO_F74_F75_TEST); + + private static DataSet loadDataSet(final String path) { + try (final FileInputStream stream = new FileInputStream(path)) { + return parseDataSet(stream, null); + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException(e); + } } - @Test - public void isItineraryInSameDirectionTest() { - Relation bus601RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 3612781) - .findFirst().orElse(null); + private static final Relation PT_ROUTE_BUS_358 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(6695469, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_371 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(1606056, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_600 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(955908, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_601 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3612781, OsmPrimitiveType.RELATION); + + private static final Relation PT_ROUTE_BUS_3_TO_LUBBEEK_KERK = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3297543, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(2815, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(1583303, OsmPrimitiveType.RELATION); + + private static final Relation PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3297278, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(5451452, OsmPrimitiveType.RELATION); - Relation bus358RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 6695469) - .findFirst().orElse(null); + private static final Relation BICYCLE_ROUTE_F75 = (Relation) DATASET_F74_F75.getPrimitiveById(11021011, OsmPrimitiveType.RELATION); - Relation bus371RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 1606056) - .findFirst().orElse(null); + private static final String rc = " http://127.0.0.1:8111/zoom?left=8&right=8&top=48&bottom=48&select=way"; + + @Test + public void isItineraryInSameDirectionTest() { - assertNotNull(bus601RouteRelation); WaySequence waysInParentRouteOf601 = new WaySequence( - bus601RouteRelation.getMembers().get(156).getWay(), - bus601RouteRelation.getMembers().get(157).getWay(), - bus601RouteRelation.getMembers().get(158).getWay()); + PT_ROUTE_BUS_601.getMembers().get(156).getWay(), + PT_ROUTE_BUS_601.getMembers().get(157).getWay(), + PT_ROUTE_BUS_601.getMembers().get(158).getWay()); - assertNotNull(bus358RouteRelation); WaySequence waysInParentRouteOf358 = new WaySequence( - bus358RouteRelation.getMembers().get(114).getWay(), - bus358RouteRelation.getMembers().get(115).getWay(), - bus358RouteRelation.getMembers().get(116).getWay()); + PT_ROUTE_BUS_358.getMembers().get(114).getWay(), + PT_ROUTE_BUS_358.getMembers().get(115).getWay(), + PT_ROUTE_BUS_358.getMembers().get(116).getWay()); - assertNotNull(bus371RouteRelation); WaySequence waysInParentRouteOf371 = new WaySequence( - bus371RouteRelation.getMembers().get(132).getWay(), - bus371RouteRelation.getMembers().get(133).getWay(), - bus371RouteRelation.getMembers().get(134).getWay()); - RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(bus601RouteRelation); - segment601_1.setActiveDataSet(ds); + PT_ROUTE_BUS_371.getMembers().get(132).getWay(), + PT_ROUTE_BUS_371.getMembers().get(133).getWay(), + PT_ROUTE_BUS_371.getMembers().get(134).getWay()); + RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(PT_ROUTE_BUS_601); + segment601_1.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); assertTrue(waysInParentRouteOf601.compareTraversal(waysInParentRouteOf358)); assertFalse(waysInParentRouteOf601.compareTraversal(waysInParentRouteOf371)); - Way commonWay = allWays.stream() - .filter(way -> way.getId() == 75113358) - .findFirst().orElse(null); - - Way toHaasrode = allWays.stream() - .filter(way -> way.getId() == 4866090) - .findFirst().orElse(null); - - Way toBlanden = allWays.stream() - .filter(way -> way.getId() == 809484771) - .findFirst().orElse(null); - - Way toNeervelp = allWays.stream() - .filter(way -> way.getId() == 243961945) - .findFirst().orElse(null); - - Way toLeuven = allWays.stream() - .filter(way -> way.getId() == 809485597) - .findFirst().orElse(null); + final Way commonWay = (Way) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(75113358, OsmPrimitiveType.WAY); + final Way toHaasrode = (Way) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(4866090, OsmPrimitiveType.WAY); + final Way toBlanden = (Way) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(809484771, OsmPrimitiveType.WAY); + final Way toNeervelp = (Way) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(243961945, OsmPrimitiveType.WAY); + final Way toLeuven = (Way) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(809485597, OsmPrimitiveType.WAY); WaySequence leuvenToHaasrode = new WaySequence(toLeuven,commonWay,toHaasrode); WaySequence leuvenToBlanden = new WaySequence(toLeuven,commonWay,toBlanden); @@ -186,21 +172,18 @@ public void isItineraryInSameDirectionTest() { @Test public void f74_F75_Test() { - Relation f75BicycleRouteRelation = allRelations2.stream() - .filter(relation -> relation.getId() == 11021011) - .findFirst().orElse(null); - assertNotNull(f75BicycleRouteRelation); - assertEquals(30, f75BicycleRouteRelation.getMembersCount()); + assertNotNull(BICYCLE_ROUTE_F75); + assertEquals(30, BICYCLE_ROUTE_F75.getMembersCount()); RouteSegmentToExtract s1 = new RouteSegmentToExtract( - f75BicycleRouteRelation, + BICYCLE_ROUTE_F75, Arrays.asList(23, 24, 25)); - s1.setActiveDataSet(ds2); + s1.setActiveDataSet(DATASET_F74_F75); s1.put("state", "proposed"); assertEquals(3, s1.getWayMembers().size()); Relation rel1 = s1.extractToRelation(Arrays.asList("type", "route"), true); - assertEquals(28, f75BicycleRouteRelation.getMembersCount()); + assertEquals(28, BICYCLE_ROUTE_F75.getMembersCount()); assertEquals("proposed", rel1.get("state")); } @@ -209,15 +192,12 @@ public void bus601_600_3_Test() { List expectedValues; RouteSegmentToExtract previousSegment = null; RouteSegmentToExtract segment = null; - Relation bus601RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 3612781) - .findFirst().orElse(null); - assertNotNull(bus601RouteRelation); - Relation cloneOfBus601RouteRelation = new Relation(bus601RouteRelation); + assertNotNull(PT_ROUTE_BUS_601); + final Relation cloneOfBus601RouteRelation = new Relation(PT_ROUTE_BUS_601); assertNotNull(cloneOfBus601RouteRelation); RouteSegmentToExtract segment1 = new RouteSegmentToExtract(cloneOfBus601RouteRelation); - segment1.setActiveDataSet(ds); + segment1.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); assertEquals(cloneOfBus601RouteRelation.get("ref"), segment1.getLineIdentifiersSignature()); assertEquals(cloneOfBus601RouteRelation.get("colour"), segment1.getColoursSignature()); @@ -586,7 +566,7 @@ public void bus601_600_3_Test() { "601") ); previousSegment = new RouteSegmentToExtract(cloneOfBus601RouteRelation); - previousSegment.setActiveDataSet(ds); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { @@ -602,15 +582,11 @@ public void bus601_600_3_Test() { // *********************************************************** - Relation bus600RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 955908) - .findFirst().orElse(null); - - assertNotNull(bus600RouteRelation); - Relation cloneOfBus600RouteRelation = new Relation(bus600RouteRelation); + assertNotNull(PT_ROUTE_BUS_600); + Relation cloneOfBus600RouteRelation = new Relation(PT_ROUTE_BUS_600); assertNotNull(cloneOfBus600RouteRelation); RouteSegmentToExtract segment101 = new RouteSegmentToExtract(cloneOfBus600RouteRelation); - segment101.setActiveDataSet(ds); + segment101.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); assertEquals(cloneOfBus600RouteRelation.get("ref"), segment101.getLineIdentifiersSignature()); assertEquals(cloneOfBus600RouteRelation.get("colour"), segment101.getColoursSignature()); @@ -1013,7 +989,7 @@ public void bus601_600_3_Test() { "395;600;651;652") ); previousSegment = new RouteSegmentToExtract(cloneOfBus600RouteRelation); - previousSegment.setActiveDataSet(ds); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { @@ -1031,16 +1007,13 @@ public void bus601_600_3_Test() { // The following test block is for the last stretch of the shorter version // *********************************************************** - Relation bus3_GHB_Lubbeek_RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 3297543) - .findFirst().orElse(null); - assertNotNull(bus3_GHB_Lubbeek_RouteRelation); - RouteSegmentToExtract segment201 = new RouteSegmentToExtract(bus3_GHB_Lubbeek_RouteRelation); - segment201.setActiveDataSet(ds); + assertNotNull(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); + RouteSegmentToExtract segment201 = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); + segment201.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - assertEquals(bus3_GHB_Lubbeek_RouteRelation.get("ref"), segment201.getLineIdentifiersSignature()); - assertEquals(bus3_GHB_Lubbeek_RouteRelation.get("colour"), segment201.getColoursSignature()); + assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK.get("ref"), segment201.getLineIdentifiersSignature()); + assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK.get("colour"), segment201.getColoursSignature()); assertNull(segment201.extractToRelation(Collections.emptyList(), false)); @@ -1353,12 +1326,12 @@ public void bus601_600_3_Test() { new Val( 33, 377918625, 15945426, 377918625, "Ring Noord", "Ring Noord (3)", "3") - ); previousSegment = new RouteSegmentToExtract(bus3_GHB_Lubbeek_RouteRelation); - previousSegment.setActiveDataSet(ds); + ); previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, bus3_GHB_Lubbeek_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, null, v.expectedRouteRef); previousSegment = segment; } @@ -1372,16 +1345,12 @@ public void bus601_600_3_Test() { // This is testing the longer version completely // *********************************************************** - Relation bus3_GHB_Pellenberg_Lubbeek_RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 2815) - .findFirst().orElse(null); + assertNotNull(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); + RouteSegmentToExtract segment301 = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); + segment301.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - assertNotNull(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); - RouteSegmentToExtract segment301 = new RouteSegmentToExtract(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); - segment301.setActiveDataSet(ds); - - assertEquals(bus3_GHB_Pellenberg_Lubbeek_RouteRelation.get("ref"), segment301.getLineIdentifiersSignature()); - assertEquals(bus3_GHB_Pellenberg_Lubbeek_RouteRelation.get("colour"), segment301.getColoursSignature()); + assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG.get("ref"), segment301.getLineIdentifiersSignature()); + assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG.get("colour"), segment301.getColoursSignature()); assertNull(segment301.extractToRelation(Collections.emptyList(), false)); @@ -1738,12 +1707,12 @@ public void bus601_600_3_Test() { new Val( 36, 377918625, 15945426, 377918625, "Ring Noord", "Ring Noord (3)", "3") - ); previousSegment = new RouteSegmentToExtract(bus3_GHB_Pellenberg_Lubbeek_RouteRelation); - previousSegment.setActiveDataSet(ds); + ); previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, bus3_GHB_Pellenberg_Lubbeek_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, null, v.expectedRouteRef); previousSegment = segment; } @@ -1758,16 +1727,13 @@ public void bus601_600_3_Test() { // From Lubbeek, over Pellenberg to Leuven Gasthuisberg // *********************************************************** - Relation bus3_Lubbeek_Pellenberg_GHB_RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 1583303) - .findFirst().orElse(null); - assertNotNull(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); - RouteSegmentToExtract segment401 = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); - segment401.setActiveDataSet(ds); + assertNotNull(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); + RouteSegmentToExtract segment401 = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); + segment401.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - assertEquals(bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("ref"), segment401.getLineIdentifiersSignature()); - assertEquals(bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("colour"), segment401.getColoursSignature()); + assertEquals(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG.get("ref"), segment401.getLineIdentifiersSignature()); + assertEquals(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG.get("colour"), segment401.getColoursSignature()); assertNull(segment401.extractToRelation(Collections.emptyList(), false)); @@ -2129,9 +2095,9 @@ public void bus601_600_3_Test() { "Dorpskring (3;373;485)", "3;373;485") ); - System.out.printf("***** %s *****\n\n", bus3_Lubbeek_Pellenberg_GHB_RouteRelation.get("name")); - previousSegment = new RouteSegmentToExtract(bus3_Lubbeek_Pellenberg_GHB_RouteRelation); - previousSegment.setActiveDataSet(ds); + System.out.printf("***** %s *****\n\n", PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG.get("name")); + previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (v.expectedRouteRef == null) { @@ -2140,7 +2106,7 @@ public void bus601_600_3_Test() { assertNotNull(String.format("%d segment should have returned a new segment", v.index), segment); } if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, bus3_Lubbeek_Pellenberg_GHB_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, null, v.expectedRouteRef); previousSegment = segment; } @@ -2154,16 +2120,12 @@ public void bus601_600_3_Test() { // Aarschot station, making a spoon loop in Holsbeek // *********************************************************** - Relation bus310_Leuven_Aarschot_Station_RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 3297278) - .findFirst().orElse(null); - - assertNotNull(bus310_Leuven_Aarschot_Station_RouteRelation); - RouteSegmentToExtract segment501 = new RouteSegmentToExtract(bus310_Leuven_Aarschot_Station_RouteRelation); - segment501.setActiveDataSet(ds); + assertNotNull(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); + RouteSegmentToExtract segment501 = new RouteSegmentToExtract(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); + segment501.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - assertEquals(bus310_Leuven_Aarschot_Station_RouteRelation.get("ref"), segment501.getLineIdentifiersSignature()); - assertEquals(bus310_Leuven_Aarschot_Station_RouteRelation.get("colour"), segment501.getColoursSignature()); + assertEquals(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION.get("ref"), segment501.getLineIdentifiersSignature()); + assertEquals(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION.get("colour"), segment501.getColoursSignature()); assertNull(segment501.extractToRelation(Collections.emptyList(), false)); @@ -2451,13 +2413,13 @@ public void bus601_600_3_Test() { "2;3;310") ); - System.out.printf("*** %s ***", bus310_Leuven_Aarschot_Station_RouteRelation.get("name")); - previousSegment = new RouteSegmentToExtract(bus310_Leuven_Aarschot_Station_RouteRelation); - previousSegment.setActiveDataSet(ds); + System.out.printf("*** %s ***", PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION.get("name")); + previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, bus310_Leuven_Aarschot_Station_RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, + extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, null, v.expectedRouteRef); previousSegment = segment; } @@ -2472,23 +2434,19 @@ public void bus601_600_3_Test() { // Line 333 has the same issue, but this one is a bit shorter // *********************************************************** - Relation bus433_Tremelo_Leuven_RouteRelation = allRelations.stream() - .filter(relation -> relation.getId() == 5451452) - .findFirst().orElse(null); - - assertNotNull(bus433_Tremelo_Leuven_RouteRelation); - RouteSegmentToExtract segment601 = new RouteSegmentToExtract(bus433_Tremelo_Leuven_RouteRelation); - segment601.setActiveDataSet(ds); + assertNotNull(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); + RouteSegmentToExtract segment601 = new RouteSegmentToExtract(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); + segment601.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - assertEquals(bus433_Tremelo_Leuven_RouteRelation.get("ref"), segment601.getLineIdentifiersSignature()); - assertEquals(bus433_Tremelo_Leuven_RouteRelation.get("colour"), segment601.getColoursSignature()); + assertEquals(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN.get("ref"), segment601.getLineIdentifiersSignature()); + assertEquals(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN.get("colour"), segment601.getColoursSignature()); assertNull(segment601.extractToRelation(Collections.emptyList(), false)); assertEquals("", segment601.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment601.getWayMembers()); - Relation clonedRelation = bus433_Tremelo_Leuven_RouteRelation; + Relation clonedRelation = PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN; expectedValues = Arrays.asList( new Val( 167, 78579065, 78579065, 78579065, null), @@ -2745,7 +2703,7 @@ public void bus601_600_3_Test() { ); previousSegment = new RouteSegmentToExtract(clonedRelation); - previousSegment.setActiveDataSet(ds); + previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { @@ -2753,10 +2711,10 @@ public void bus601_600_3_Test() { null, v.expectedRouteRef); previousSegment = segment; } - UndoRedoHandler.getInstance().add(new ChangeCommand(bus433_Tremelo_Leuven_RouteRelation, clonedRelation)); + UndoRedoHandler.getInstance().add(new ChangeCommand(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN, clonedRelation)); UndoRedoHandler.getInstance().undo(); } - UndoRedoHandler.getInstance().add(new ChangeCommand(bus433_Tremelo_Leuven_RouteRelation, clonedRelation)); + UndoRedoHandler.getInstance().add(new ChangeCommand(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN, clonedRelation)); System.out.print("\n"); @@ -2851,7 +2809,7 @@ public void printListOfExpectedValues(Relation relation, String nameOfVariable, segment.getLineIdentifiersSignature() ); System.out.printf(" %spreviousSegment = new RouteSegmentToExtract(%s);\n", className, nameOfVariable); - System.out.print (" previousSegment.setActiveDataSet(ds);\n"); + System.out.print (" previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING);\n"); if (firstOne) { System.out.printf(" %ssegment;\n", className); } From f66483bdf6e84b72ad138819c18a8729ce580185 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 23 Oct 2020 19:25:27 +0200 Subject: [PATCH 45/52] Tried to sanitize the RouteSegmentToExtractTest class. I didn't test creating a new set of knownValues. What is odd, is that now all the tests are passing, whereas before I did this some were not passing. So either it's not testing as exhaustively, or there is an error in the known values. But those I didn't touch. --- .../data/RouteSegmentToExtractTest.java | 249 ++++-------------- 1 file changed, 45 insertions(+), 204 deletions(-) diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 97953641..c586eca5 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -9,6 +9,7 @@ import java.io.FileInputStream; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -88,7 +89,6 @@ private static DataSet loadDataSet(final String path) { @Test public void isItineraryInSameDirectionTest() { - WaySequence waysInParentRouteOf601 = new WaySequence( PT_ROUTE_BUS_601.getMembers().get(156).getWay(), PT_ROUTE_BUS_601.getMembers().get(157).getWay(), @@ -172,7 +172,6 @@ public void isItineraryInSameDirectionTest() { @Test public void f74_F75_Test() { - assertNotNull(BICYCLE_ROUTE_F75); assertEquals(30, BICYCLE_ROUTE_F75.getMembersCount()); RouteSegmentToExtract s1 = new RouteSegmentToExtract( @@ -193,23 +192,6 @@ public void bus601_600_3_Test() { RouteSegmentToExtract previousSegment = null; RouteSegmentToExtract segment = null; - assertNotNull(PT_ROUTE_BUS_601); - final Relation cloneOfBus601RouteRelation = new Relation(PT_ROUTE_BUS_601); - assertNotNull(cloneOfBus601RouteRelation); - RouteSegmentToExtract segment1 = new RouteSegmentToExtract(cloneOfBus601RouteRelation); - segment1.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(cloneOfBus601RouteRelation.get("ref"), segment1.getLineIdentifiersSignature()); - assertEquals(cloneOfBus601RouteRelation.get("colour"), segment1.getColoursSignature()); - - assertNull(segment1.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment1.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment1.getWayMembers()); - - - RouteSegmentToExtract returnValueNull; - expectedValues = Arrays.asList( new Val( 158, 78579065, 78579065, 78579065, null), new Val( 157, 377814547, 78579065, 377814547, null), @@ -565,37 +547,13 @@ public void bus601_600_3_Test() { "Engels Plein - Havenkant (601)", "601") ); - previousSegment = new RouteSegmentToExtract(cloneOfBus601RouteRelation); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - for (Val v: expectedValues) { - segment = previousSegment.addPTWayMember(v.index); - if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, cloneOfBus601RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); - previousSegment = segment; - } - } - System.out.print("\n"); + + testPtLine(expectedValues, PT_ROUTE_BUS_601); // *********************************************************** // *********************************************************** // *********************************************************** - - assertNotNull(PT_ROUTE_BUS_600); - Relation cloneOfBus600RouteRelation = new Relation(PT_ROUTE_BUS_600); - assertNotNull(cloneOfBus600RouteRelation); - RouteSegmentToExtract segment101 = new RouteSegmentToExtract(cloneOfBus600RouteRelation); - segment101.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(cloneOfBus600RouteRelation.get("ref"), segment101.getLineIdentifiersSignature()); - assertEquals(cloneOfBus600RouteRelation.get("colour"), segment101.getColoursSignature()); - - assertNull(segment101.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment101.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment101.getWayMembers()); - expectedValues = Arrays.asList( new Val( 169, 608715622, 608715622, 608715622, "Engels Plein"), new Val( 168, 338057819, 608715622, 338057819, "Engels Plein"), @@ -988,18 +946,8 @@ public void bus601_600_3_Test() { "perron 11 & 12 (395;600;651;652)", "395;600;651;652") ); - previousSegment = new RouteSegmentToExtract(cloneOfBus600RouteRelation); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - for (Val v: expectedValues) { - segment = previousSegment.addPTWayMember(v.index); - if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, cloneOfBus600RouteRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); - previousSegment = segment; - } - } - System.out.print("\n"); + testPtLine(expectedValues, PT_ROUTE_BUS_600); // *********************************************************** // Line 3 has the particularity that there are 2 variants @@ -1007,19 +955,6 @@ public void bus601_600_3_Test() { // The following test block is for the last stretch of the shorter version // *********************************************************** - - assertNotNull(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); - RouteSegmentToExtract segment201 = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); - segment201.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK.get("ref"), segment201.getLineIdentifiersSignature()); - assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK.get("colour"), segment201.getColoursSignature()); - - assertNull(segment201.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment201.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment201.getWayMembers()); - expectedValues = Arrays.asList( new Val( 194, 27684829, 27684829, 27684829, "Dorpskring"), new Val( 193, 349396917, 27684829, 349396917, "Dorpskring"), @@ -1326,18 +1261,9 @@ public void bus601_600_3_Test() { new Val( 33, 377918625, 15945426, 377918625, "Ring Noord", "Ring Noord (3)", "3") - ); previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - for (Val v: expectedValues) { - segment = previousSegment.addPTWayMember(v.index); - if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); - previousSegment = segment; - } - } + ); - System.out.print("\n"); + testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); // *********************************************************** // Line 3 has the particularity that there are 2 variants @@ -1345,18 +1271,6 @@ public void bus601_600_3_Test() { // This is testing the longer version completely // *********************************************************** - assertNotNull(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); - RouteSegmentToExtract segment301 = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); - segment301.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG.get("ref"), segment301.getLineIdentifiersSignature()); - assertEquals(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG.get("colour"), segment301.getColoursSignature()); - - assertNull(segment301.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment301.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment301.getWayMembers()); - expectedValues = Arrays.asList( new Val( 217, 27684829, 27684829, 27684829, "Dorpskring"), new Val( 216, 349396917, 27684829, 349396917, "Dorpskring"), @@ -1707,18 +1621,9 @@ public void bus601_600_3_Test() { new Val( 36, 377918625, 15945426, 377918625, "Ring Noord", "Ring Noord (3)", "3") - ); previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - for (Val v: expectedValues) { - segment = previousSegment.addPTWayMember(v.index); - if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); - previousSegment = segment; - } - } + ); - System.out.print("\n"); + testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); // *********************************************************** // Line 3 has the particularity that there are 2 variants @@ -1727,19 +1632,6 @@ public void bus601_600_3_Test() { // From Lubbeek, over Pellenberg to Leuven Gasthuisberg // *********************************************************** - - assertNotNull(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); - RouteSegmentToExtract segment401 = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); - segment401.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG.get("ref"), segment401.getLineIdentifiersSignature()); - assertEquals(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG.get("colour"), segment401.getColoursSignature()); - - assertNull(segment401.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment401.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment401.getWayMembers()); - expectedValues = Arrays.asList( new Val( 221, 377918626, 377918626, 377918626, "Ring Noord"), new Val( 220, 243915691, 377918626, 243915691, "Ring Noord"), @@ -2095,24 +1987,8 @@ public void bus601_600_3_Test() { "Dorpskring (3;373;485)", "3;373;485") ); - System.out.printf("***** %s *****\n\n", PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG.get("name")); - previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - for (Val v: expectedValues) { - segment = previousSegment.addPTWayMember(v.index); - if (v.expectedRouteRef == null) { - assertNull(String.format("%d segment should have returned null", v.index), segment); - } else { - assertNotNull(String.format("%d segment should have returned a new segment", v.index), segment); - } - if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); - previousSegment = segment; - } - } - System.out.print("\n"); + testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); // *********************************************************** // Line 310 has 3 variants @@ -2120,18 +1996,6 @@ public void bus601_600_3_Test() { // Aarschot station, making a spoon loop in Holsbeek // *********************************************************** - assertNotNull(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); - RouteSegmentToExtract segment501 = new RouteSegmentToExtract(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); - segment501.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION.get("ref"), segment501.getLineIdentifiersSignature()); - assertEquals(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION.get("colour"), segment501.getColoursSignature()); - - assertNull(segment501.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment501.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment501.getWayMembers()); - expectedValues = Arrays.asList( new Val( 213, 13856192, 13856192, 13856192, null), new Val( 212, 100289896, 13856192, 100289896, "Statieplein"), @@ -2413,19 +2277,7 @@ public void bus601_600_3_Test() { "2;3;310") ); - System.out.printf("*** %s ***", PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION.get("name")); - previousSegment = new RouteSegmentToExtract(PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - for (Val v: expectedValues) { - segment = previousSegment.addPTWayMember(v.index); - if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); - previousSegment = segment; - } - } - - System.out.print("\n"); + testPtLine(expectedValues, PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); // *********************************************************** // Line 433 is an express bus @@ -2434,20 +2286,6 @@ public void bus601_600_3_Test() { // Line 333 has the same issue, but this one is a bit shorter // *********************************************************** - assertNotNull(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); - RouteSegmentToExtract segment601 = new RouteSegmentToExtract(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); - segment601.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - - assertEquals(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN.get("ref"), segment601.getLineIdentifiersSignature()); - assertEquals(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN.get("colour"), segment601.getColoursSignature()); - - assertNull(segment601.extractToRelation(Collections.emptyList(), false)); - - assertEquals("", segment601.getWayIdsSignature()); - assertEquals(Collections.emptyList(), segment601.getWayMembers()); - - Relation clonedRelation = PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN; - expectedValues = Arrays.asList( new Val( 167, 78579065, 78579065, 78579065, null), new Val( 166, 377814547, 78579065, 377814547, null), @@ -2702,24 +2540,46 @@ public void bus601_600_3_Test() { "333;433") ); - previousSegment = new RouteSegmentToExtract(clonedRelation); - previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); + testPtLine(expectedValues, PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); + +// printListOfExpectedValues(5451452); + + } + + public void testPtLine(List expectedValues, final Relation busRouteRelation) { + + assertNotNull(busRouteRelation); + RouteSegmentToExtract segment = new RouteSegmentToExtract(busRouteRelation); + segment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); + + assertEquals(busRouteRelation.get("ref"), segment.getLineIdentifiersSignature()); + assertEquals(busRouteRelation.get("colour"), segment.getColoursSignature()); + + assertNull(segment.extractToRelation(Collections.emptyList(), false)); + + assertEquals("", segment.getWayIdsSignature()); + assertEquals(Collections.emptyList(), segment.getWayMembers()); + System.out.printf("***** %s *****\n\n ", busRouteRelation.get("name")); + + RouteSegmentToExtract previousSegment = segment; + + Relation clonedRelation = new Relation(busRouteRelation); + for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { extractAndAssertValues(v.index, previousSegment, segment, clonedRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, null, v.expectedRouteRef); previousSegment = segment; + UndoRedoHandler.getInstance().add(new ChangeCommand(busRouteRelation, clonedRelation)); + System.out.printf("% 3d ", busRouteRelation.getMembersCount()); + UndoRedoHandler.getInstance().undo(); } - UndoRedoHandler.getInstance().add(new ChangeCommand(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN, clonedRelation)); - UndoRedoHandler.getInstance().undo(); } - UndoRedoHandler.getInstance().add(new ChangeCommand(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN, clonedRelation)); + UndoRedoHandler.getInstance().add(new ChangeCommand(busRouteRelation, clonedRelation)); + System.out.printf("%s\n", busRouteRelation.getMembersCount()); System.out.print("\n"); - -// printListOfExpectedValues(bus433_Tremelo_Leuven_RouteRelation, "bus433_Tremelo_Leuven_RouteRelation", false); - } public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, @@ -2735,7 +2595,7 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS assertEquals(expectedRouteRef, actualRouteRef); assertEquals(expectedRouteRef, extractedRelation.get("route_ref")); - assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); +// assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); // newSegment should have the last way that was added to this segment if (firstWayIdForNewSegment != 0) { assertNotNull(String.format("No new segment was created for way\n%s%s at position %d", rc, firstWayIdForNewSegment, index), newSegment); @@ -2749,22 +2609,15 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS /** * This prints a list of known values to be used in unit tests * - * @param relation the route relation to print a list of known values for - * @param nameOfVariable the variable name repeated as a string - * @param firstOne true if this is the first in a series of consecutive tests - * and the variables still need to be declared + * @param relation the route relation */ @SuppressWarnings("unused") - public void printListOfExpectedValues(Relation relation, String nameOfVariable, boolean firstOne) { + public void printListOfExpectedValues(final Relation relation) { List members = relation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(relation); List wayMembers = segment.getWayMembers(); String listVal = ""; String className = ""; - if (firstOne) { - listVal = "List "; - className = "RouteSegmentToExtract "; - } Way way = null; int lastIndex = 0; System.out.printf(" %sexpectedValues = Arrays.asList(\n", listVal); @@ -2808,19 +2661,7 @@ public void printListOfExpectedValues(Relation relation, String nameOfVariable, segment.getNote(), segment.getLineIdentifiersSignature() ); - System.out.printf(" %spreviousSegment = new RouteSegmentToExtract(%s);\n", className, nameOfVariable); - System.out.print (" previousSegment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING);\n"); - if (firstOne) { - System.out.printf(" %ssegment;\n", className); - } - System.out.print (" for (Val v: expectedValues) {\n" + - " segment = previousSegment.addPTWayMember(v.index);\n" + - " if (segment != null) {\n"); - System.out.printf(" extractAndAssertValues(v.index, previousSegment, segment, %s, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay,\n", nameOfVariable); - System.out.print( " null, v.expectedRouteRef);\n" + - " previousSegment = segment;\n" + - " }\n" + - " }\n\n" + - " System.out.print(\"\\n\");\n\n"); + System.out.printf(" testPtLine(expectedValues, %d);\n", relation.getId()); + System.out.print (" System.out.print(\"\\n\");\n\n"); } } From 2b52d4d266603602d5376400a8d3c3c6fce357da Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 23 Oct 2020 19:26:08 +0200 Subject: [PATCH 46/52] Some changes made while doing pair programming with Florian. --- .../pt_assistant/data/RouteSegmentToExtract.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index b3fcf13b..1cea9bbc 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -233,13 +233,13 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } else { this.itinerariesInSameDirection = itinerariesInSameDirection; for (Relation parentRoute : itinerariesInSameDirection) { - final Node commonNode2 = WayUtils.findFirstCommonNode(ws.currentWay, ws.nextWay).orElseGet(null); + final Optional commonNode2 = WayUtils.findFirstCommonNode(ws.currentWay, ws.nextWay); final long membershipCountOfWayInSameDirectionInParentRoute = getMembershipCountOfWayInSameDirection(ws.currentWay, parentRoute); if (ws.currentWay == getLastWay(parentRoute) || membershipCountOfWayInSameDirectionInParentRoute > 1 && !parentRoute.equals(relation) - && (commonNode2.getParentWays().size() > 2) + && (commonNode2.map(it -> it.getParentWays().size() > 2).orElse(false)) ) { startNewSegment = true; if (membershipCountOfWayInSameDirectionInParentRoute > 1) { @@ -254,9 +254,14 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { if (!startNewSegment && !relation.equals(parentRoute) && Objects.equals(relation.get("ref"), parentRoute.get("ref"))) { - if (commonNode2.getParentWays().stream() - .filter(w -> (getItineraryWays(parentRoute).contains(w))) - .count() > 2) { + if (commonNode2 + .map(it -> + it.getParentWays().stream() + .filter(w -> (getItineraryWays(parentRoute).contains(w))) + .count() > 2 + ) + .orElse(false) + ) { startNewSegment = true; break; } From 12158e87e72111718bf63790578d8bfca6192ae2 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 23 Oct 2020 19:34:47 +0200 Subject: [PATCH 47/52] Running the loop down to 0 seems to work better when splitting in segments --- .../actions/ExtractRelationMembersToNewRelationAction.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 642fe7fe..85114d8a 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -161,14 +161,13 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou final List members = clonedRelation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); RouteSegmentToExtract newSegment = null; - for (int i = members.size() - 1; i >= 1; i--) { + for (int i = members.size() - 1; i >= 0; i--) { newSegment = segment.addPTWayMember(i); if (newSegment != null) { segment.extractToRelation(Arrays.asList("type", "route"), true); segment = newSegment; } } - segment.extractToRelation(Arrays.asList("type", "route"), true); if (convertToSuperroute) { clonedRelation.put("type", "superroute"); } From 5e6e72888692075903cf844226c3a2d54390735b Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Sun, 25 Oct 2020 17:19:58 +0100 Subject: [PATCH 48/52] Changed the order of creation of clonedRelation. The way it was, it was not doing/testing anything. --- .../data/RouteSegmentToExtractTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index c586eca5..f6eaef14 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -2549,22 +2549,23 @@ public void bus601_600_3_Test() { public void testPtLine(List expectedValues, final Relation busRouteRelation) { assertNotNull(busRouteRelation); - RouteSegmentToExtract segment = new RouteSegmentToExtract(busRouteRelation); + + Relation clonedRelation = new Relation(busRouteRelation); + + RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); segment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); - assertEquals(busRouteRelation.get("ref"), segment.getLineIdentifiersSignature()); - assertEquals(busRouteRelation.get("colour"), segment.getColoursSignature()); + assertEquals(clonedRelation.get("ref"), segment.getLineIdentifiersSignature()); + assertEquals(clonedRelation.get("colour"), segment.getColoursSignature()); assertNull(segment.extractToRelation(Collections.emptyList(), false)); assertEquals("", segment.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment.getWayMembers()); - System.out.printf("***** %s *****\n\n ", busRouteRelation.get("name")); + System.out.printf("***** %s *****\n\n ", clonedRelation.get("name")); RouteSegmentToExtract previousSegment = segment; - Relation clonedRelation = new Relation(busRouteRelation); - for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { From 4305ff85caa7c7a0433f13a54a0d607444b6d5ae Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Thu, 29 Oct 2020 18:42:52 +0100 Subject: [PATCH 49/52] reduced file size of test file to 5.5 MB by purging ways. The relations need to stay, as they matter for splitting and for determining which lines to mention in the note tag. Fixed a bug in WaySequence The tests were rewritten from scratch. They all pass now, but interactive testing is needed to know whether they test the correct behaviour. Atm they test the curent behaviour of the code, as they were generated using it. --- .../data/RouteSegmentToExtract.java | 31 +- .../pt_assistant/data/WaySequence.java | 1 + test/data/buses_before_splitting.osm | 124061 ++++++++++++--- .../data/RouteSegmentToExtractTest.java | 1740 +- 4 files changed, 104306 insertions(+), 21527 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 53289139..b90dd154 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -184,9 +184,12 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; + if (index < 1) { + return this; // make sure all segments are processed in route relations without stop members + } WaySequence ws = new WaySequence(relation, index); if (ws.currentWay == null && ws.nextWay != null) { - return this; // make sure all segments are processed + return this; // make sure all segments are processed for route relations when stop members are reached } if (ws.currentWay == null || ws.hasGap) { return null; @@ -209,7 +212,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { boolean startNewSegmentInNewSegment = false; List segmentRelations = Utils.filteredCollection(ws.currentWay.getReferrers(), Relation.class).stream() - .filter(r -> "route".equals(r.get("type")) && "bus".equals(r.get("route")) && r.hasKey("route_ref")) + .filter(r -> "route".equals(r.get("type")) && "bus".equals(r.get("route")) && r.hasKey("note")) .collect(Collectors.toList()); List parentRouteRelations = Utils.filteredCollection(ws.currentWay.getReferrers(), Relation.class).stream() @@ -229,7 +232,6 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } } parentRouteRelations.addAll(sr.getReferrers().stream() - .filter(r -> "superroute".equals(r.get("type"))) .map(r -> (Relation) r) .collect(Collectors.toList())); } @@ -316,7 +318,11 @@ public boolean isLastWay(Way way) { * @return the first highway/railway of ptRoute */ public Way getFirstWay(Relation ptRoute) { - return getItineraryWays(ptRoute).get(0); + final ArrayList itineraryWays = getItineraryWays(ptRoute); + if (itineraryWays.size() > 0) { + return itineraryWays.get(0); + } + return null; } /** @@ -324,7 +330,11 @@ public Way getFirstWay(Relation ptRoute) { * @return the second highway/railway of ptRoute */ public Way getSecondWay(Relation ptRoute) { - return getItineraryWays(ptRoute).get(1); + final ArrayList itineraryWays = getItineraryWays(ptRoute); + if (itineraryWays.size() > 1) { + return itineraryWays.get(1); + } + return null; } /** @@ -332,8 +342,11 @@ public Way getSecondWay(Relation ptRoute) { * @return the last highway/railway of ptRoute */ public Way getLastWay(Relation ptRoute) { - final List highways = getItineraryWays(ptRoute); - return highways.get(highways.size() - 1); + final ArrayList itineraryWays = getItineraryWays(ptRoute); + if (itineraryWays.size() > 0) { + return itineraryWays.get(itineraryWays.size() - 1); + } + return null; } /** @@ -451,7 +464,7 @@ public List getIndicesFor(OsmPrimitive primitive, Relation routeRelatio * for all occurrences of wayToLocate this method returns the way before it and the way after it * @param highwayMembers The members list of the relation * @param wayToLocate The way to locate in the list - * @return a list of way triplets + * @return a list of way sequences */ private static List findPreviousAndNextWayInRoute(List highwayMembers, Way wayToLocate) { Way wayAtIndexPosition; @@ -682,7 +695,7 @@ public String getNote() { public void updateTags() { extractedRelation.put("note", getNote()); - extractedRelation.put("route_ref", getLineIdentifiersSignature()); +// extractedRelation.put("route_ref", getLineIdentifiersSignature()); } private void addPtSegment() { diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java index bd32b6fd..e366f72a 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/WaySequence.java @@ -198,6 +198,7 @@ public void setAfterNextPtWay(RelationMember afterNextMember) { */ public int getTraversalSense() { if (traversalSense == 0) { + if (previousWay == null && nextWay == null) return 0; if (currentWay != null) { if (previousWay != null && currentWay.firstNode() .equals(WayUtils.findCommonFirstLastNode(previousWay, currentWay).orElse(null))) { diff --git a/test/data/buses_before_splitting.osm b/test/data/buses_before_splitting.osm index 2d6d59cd..821ba7ac 100644 --- a/test/data/buses_before_splitting.osm +++ b/test/data/buses_before_splitting.osm @@ -1,20367 +1,103696 @@ - - - -The data included in this document is from www.openstreetmap.org. The data is made available under ODbL. - -It was generated using this query on 2020-10-27: -[out:xml]; -( - relation(6695469); - relation(1606056); - relation(955908); - relation(3612781); - relation(3297543); - relation(2815); - relation(1583303); - relation(3297278); - relation(5451452); -); -out meta; ->; -out meta qt; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 4001869f..5367b95f 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -34,17 +34,15 @@ class Val { int iDOfFirstWay; int iDOfLastWay; String note = null; - String expectedRouteRef = null; public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, - String nameOfNextWay, String note, String expectedRouteRef) { + String nameOfNextWay, String note) { this.index = index; this.nameOfNextWay = nameOfNextWay; this.iDOfFirstWay = iDOfFirstWay; this.iDOfLastWay = iDOfLastWay; this.iDOfNextWay = iDOfNextWay; this.note = note; - this.expectedRouteRef = expectedRouteRef; } public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, String nameOfNextWay) { @@ -150,6 +148,7 @@ public void isItineraryInSameDirectionTest() { WaySequence neervelpToMissing = new WaySequence(toNeervelp,commonWay,null); assertTrue(missingToBlanden.compareTraversal(leuvenToBlanden)); + assertTrue(missingToHaasrode.compareTraversal(leuvenToHaasrode)); assertTrue(leuvenToBlanden.compareTraversal(missingToBlanden)); assertTrue(missingToLeuven.compareTraversal(blandenToLeuven)); assertTrue(blandenToLeuven.compareTraversal(missingToLeuven)); @@ -157,6 +156,10 @@ public void isItineraryInSameDirectionTest() { assertTrue(neervelpToHaasrode.compareTraversal(missingToBlanden)); assertTrue(missingToNeervelp.compareTraversal(blandenToLeuven)); assertTrue(blandenToLeuven.compareTraversal(missingToNeervelp)); + assertTrue(blandenToMissing.compareTraversal(blandenToLeuven)); + assertTrue(haasrodeToMissing.compareTraversal(haasrodeToLeuven)); + assertTrue(leuvenToMissing.compareTraversal(leuvenToBlanden)); + assertTrue(neervelpToMissing.compareTraversal(neervelpToHaasrode)); assertFalse(leuvenToBlanden.compareTraversal(blandenToLeuven)); assertFalse(blandenToLeuven.compareTraversal(leuvenToBlanden)); @@ -188,346 +191,247 @@ public void f74_F75_Test() { @Test public void bus601_600_3_Test() { List expectedValues; - RouteSegmentToExtract previousSegment = null; - RouteSegmentToExtract segment = null; expectedValues = Arrays.asList( - new Val( 158, 78579065, 78579065, 78579065, null), - new Val( 157, 377814547, 78579065, 377814547, null), + new Val( 163, 78579065, 78579065, 78579065, null), + new Val( 162, 377814547, 78579065, 377814547, null), + new Val( 161, 377814547, 78579065, 79596986, null, + "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)"), - new Val( 156, 377814547, 78579065, 79596986, null, - "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", - "1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658"), + new Val( 160, 79596986, 79596986, 79211473, "Tiensevest", + "(305;306;310;318;358;410;433;475;485;601;658)"), + new Val( 159, 79211473, 79211473, 79211472, "Tiensevest", + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)"), - new Val( 155, 79596986, 79596986, 79211473, "Tiensevest", - "(305;306;310;318;358;410;433;475;485;601;658)", - "305;306;310;318;358;410;433;475;485;601;658"), - - - new Val( 154, 79211473, 79211473, 79211472, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", - "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), - - - new Val( 153, 79211472, 79211472, 79175435, "Tiensevest", - "Tiensevest (2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", - "2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), - - - new Val( 152, 79175435, 79175435, 80458208, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)", - "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658"), - - - new Val( 151, 80458208, 80458208, 19793164, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658)", - "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658"), - - - new Val( 150, 19793164, 19793164, 6184898, "Diestsevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658)", - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"), - - new Val( 149, 81457878, 6184898, 81457878, "Diestsevest"), - new Val( 148, 4003924, 6184898, 4003924, "Diestsevest"), - new Val( 147, 8133608, 6184898, 8133608, "Diestsevest"), - - new Val( 146, 8133608, 6184898, 254800931, "Joanna-Maria Artoisplein", - "Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", - "305;318;334;335;358;410;513;601;630;651;652;658"), - - - new Val( 145, 254800931, 254800931, 23691158, "Joanna-Maria Artoisplein", - "Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", - "178;305;318;334;335;358;410;513;601;630;651;652;658"), - - new Val( 144, 254800932, 23691158, 254800932, "Lüdenscheidsingel"), - new Val( 143, 44932921, 23691158, 44932921, "Lüdenscheidsingel"), - new Val( 142, 3993388, 23691158, 3993388, "Lüdenscheidsingel"), - new Val( 141, 109267417, 23691158, 109267417, "Lüdenscheidsingel"), - - new Val( 140, 109267417, 23691158, 3993387, "Lüdenscheidsingel", - "Lüdenscheidsingel - Joanna-Maria Artoisplein (178;305;318;358;410;601;651;652;658)", - "178;305;318;358;410;601;651;652;658"), - - new Val( 139, 8131125, 3993387, 8131125, null), - new Val( 138, 3877105, 3993387, 3877105, null), - new Val( 137, 146171871, 3993387, 146171871, "Den Boschsingel"), - new Val( 136, 23837544, 3993387, 23837544, "Den Boschsingel"), - - new Val( 135, 23837544, 3993387, 225605630, "Den Boschsingel", - "Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)", - "318;358;410;601;651;658"), - - new Val( 134, 8131121, 225605630, 8131121, "Den Boschsingel"), - new Val( 133, 3680456, 225605630, 3680456, "Rennes-Singel"), - new Val( 132, 3994257, 225605630, 3994257, "Rennes-Singel"), - new Val( 131, 249333185, 225605630, 249333185, "Rennes-Singel"), - - new Val( 130, 249333185, 225605630, 249333184, "Herestraat", - "Rennes-Singel - Den Boschsingel (318;410;601)", - "318;410;601"), - - new Val( 129, 813970231, 249333184, 813970231, "Herestraat"), - new Val( 128, 681081951, 249333184, 681081951, "Herestraat"), - - new Val( 127, 681081951, 249333184, 813970227, "Herestraat", - "Herestraat (410;601)", - "410;601"), - - new Val( 126, 41403544, 813970227, 41403544, "Herestraat"), - new Val( 125, 8079995, 813970227, 8079995, "Herestraat"), - - new Val( 124, 8079995, 813970227, 41403538, "Rotonde Het Teken", - "Herestraat (410;600;601)", - "410;600;601"), - - new Val( 123, 79340950, 41403538, 79340950, "Ring Zuid"), - - new Val( 122, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - - new Val( 121, 11369123, 11369123, 159949154, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - - new Val( 120, 159949154, 159949154, 332258104, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - new Val( 119, 78852604, 332258104, 78852604, null), - - new Val( 118, 78852604, 332258104, 377918641, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - new Val( 117, 14508736, 377918641, 14508736, null), - - new Val( 116, 14508736, 377918641, 109267436, "Ring Zuid", - "(3;317;395;410;601)", - "3;317;395;410;601"), - - - new Val( 115, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410;600;601)", - "3;317;395;410;600;601"), - - - new Val( 114, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600;601)", - "3;317;334;335;395;410;600;601"), - - - new Val( 113, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600;601)", - "3;317;334;335;380;395;410;600;601"), - - new Val( 112, 502328837, 502328838, 502328837, "Ring Zuid"), - new Val( 111, 8080023, 502328838, 8080023, "Ring Zuid"), - new Val( 110, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - - new Val( 109, 78568660, 502328838, 78873921, "Rotonde Het Teken", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - - - new Val( 108, 78873921, 78873921, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - - - new Val( 107, 3752557, 3752557, 249333188, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - - - new Val( 106, 249333188, 249333188, 249333187, "Rotonde Het Teken", - "Rotonde Het Teken (3;410;600;601)", - "3;410;600;601"), - - - new Val( 105, 249333187, 249333187, 13067134, "Herestraat", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - new Val( 104, 813970232, 13067134, 813970232, "Herestraat"), - new Val( 103, 813970226, 13067134, 813970226, "Herestraat"), - new Val( 102, 813970228, 13067134, 813970228, "Herestraat"), - - new Val( 101, 813970228, 13067134, 813970229, "Herestraat", - "Herestraat (410;600;601)", - "410;600;601"), - - new Val( 100, 813970231, 813970229, 813970231, "Herestraat"), - new Val( 99, 249333184, 813970229, 249333184, "Herestraat"), - - new Val( 98, 249333184, 813970229, 249333186, "Rennes-Singel", - "Herestraat (601)", - "601"), - - new Val( 97, 192559628, 249333186, 192559628, "Rennes-Singel"), - new Val( 96, 161166589, 249333186, 161166589, "Rennes-Singel"), - new Val( 95, 813979470, 249333186, 813979470, "Rennes-Singel"), - new Val( 94, 79289746, 249333186, 79289746, "Rennes-Singel"), - new Val( 93, 813979472, 249333186, 813979472, "Rennes-Singel"), - new Val( 92, 8131120, 249333186, 8131120, "Rennes-Singel"), - new Val( 91, 429706864, 249333186, 429706864, "Rennes-Singel"), - - new Val( 90, 429706864, 249333186, 99583853, "Tervuursevest", - "Rennes-Singel (318;601)", - "318;601"), - - new Val( 89, 521193379, 99583853, 521193379, "Tervuursevest"), - new Val( 88, 521193380, 99583853, 521193380, "Tervuursevest"), - new Val( 87, 813979465, 99583853, 813979465, "Tervuursevest"), - new Val( 86, 174338458, 99583853, 174338458, "Tervuursevest"), - new Val( 85, 608715520, 99583853, 608715520, "Tervuursevest"), - new Val( 84, 608715521, 99583853, 608715521, "Tervuursevest"), - new Val( 83, 3677944, 99583853, 3677944, "Tervuursevest"), - new Val( 82, 174338459, 99583853, 174338459, "Tervuursevest"), - new Val( 81, 429706866, 99583853, 429706866, "Tervuursevest"), - new Val( 80, 88361317, 99583853, 88361317, "Tervuursevest"), - - new Val( 79, 88361317, 99583853, 461159345, "Tervuursevest", - "Tervuursevest (601)", - "601"), - - - new Val( 78, 461159345, 461159345, 461159362, "Tervuursevest", - "Tervuursevest (178;179;306 (student);601)", - "178;179;306 (student);601"), - - new Val( 77, 344507822, 461159362, 344507822, "Tervuursevest"), - new Val( 76, 461159367, 461159362, 461159367, "Tervuursevest"), - new Val( 75, 3677335, 461159362, 3677335, "Tervuursevest"), - new Val( 74, 31474001, 461159362, 31474001, "Tervuursevest"), - new Val( 73, 23237288, 461159362, 23237288, "Tervuursevest"), - new Val( 72, 90168773, 461159362, 90168773, "Tervuursevest"), - new Val( 71, 23237287, 461159362, 23237287, "Tervuursevest"), - new Val( 70, 608715561, 461159362, 608715561, "Tervuursevest"), - new Val( 69, 608715562, 461159362, 608715562, "Tervuursevest"), - new Val( 68, 3677330, 461159362, 3677330, "Tervuursevest"), - - new Val( 67, 3677330, 461159362, 86164005, "Naamsevest", - "Tervuursevest (178;179;306 (student);520;524;525;537;601)", - "178;179;306 (student);520;524;525;537;601"), - - new Val( 66, 655251293, 86164005, 655251293, "Naamsevest"), - new Val( 65, 131571763, 86164005, 131571763, "Naamsevest"), - new Val( 64, 661733369, 86164005, 661733369, "Naamsevest"), - new Val( 63, 655251292, 86164005, 655251292, "Naamsevest"), - new Val( 62, 3677823, 86164005, 3677823, "Naamsevest"), - new Val( 61, 24905257, 86164005, 24905257, "Geldenaaksevest"), - - new Val( 60, 24905257, 86164005, 608715605, "Geldenaaksevest", - "Geldenaaksevest - Naamsevest (18;178;179;306 (student);337;601;616)", - "18;178;179;306 (student);337;601;616"), - - new Val( 59, 608715606, 608715605, 608715606, "Geldenaaksevest"), - new Val( 58, 79299303, 608715605, 79299303, "Geldenaaksevest"), - new Val( 57, 10296368, 608715605, 10296368, "Geldenaaksevest"), - new Val( 56, 521193607, 608715605, 521193607, "Geldenaaksevest"), - new Val( 55, 94585453, 608715605, 94585453, "Geldenaaksevest"), - new Val( 54, 586268893, 608715605, 586268893, "Geldenaaksevest"), - new Val( 53, 8130906, 608715605, 8130906, "Geldenaaksevest"), - - new Val( 52, 8130906, 608715605, 16775171, "Tiensepoort", - "Geldenaaksevest (18;178;179;306 (student);337;601;616;630)", - "18;178;179;306 (student);337;601;616;630"), + new Val( 158, 79211472, 79211472, 79175435, "Tiensevest", + "Tiensevest (1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)"), + new Val( 157, 79175435, 79175435, 80458208, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)"), + + new Val( 156, 80458208, 80458208, 19793164, "Tiensevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;651;652;658)"), + + new Val( 155, 19793164, 19793164, 6184898, "Diestsevest", + "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)"), + + new Val( 154, 81457878, 6184898, 81457878, "Diestsevest"), + new Val( 153, 4003924, 6184898, 4003924, "Diestsevest"), + new Val( 152, 8133608, 6184898, 8133608, "Diestsevest"), + new Val( 151, 254800931, 6184898, 254800931, "Joanna-Maria Artoisplein"), + new Val( 150, 254800931, 6184898, 23691158, "Joanna-Maria Artoisplein", + "Joanna-Maria Artoisplein - Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)"), + + new Val( 149, 23691158, 23691158, 254800932, "Lüdenscheidsingel", + "Joanna-Maria Artoisplein (305;318;358;410;601;651;652;658)"), + + new Val( 148, 44932921, 254800932, 44932921, "Lüdenscheidsingel"), + new Val( 147, 3993388, 254800932, 3993388, "Lüdenscheidsingel"), + new Val( 146, 3993388, 254800932, 109267417, "Lüdenscheidsingel", + "Lüdenscheidsingel (178;305;318;358;410;601;651;652;658)"), + + new Val( 145, 3993387, 109267417, 3993387, "Lüdenscheidsingel"), + new Val( 144, 8131125, 109267417, 8131125, null), + new Val( 143, 3877105, 109267417, 3877105, null), + new Val( 142, 146171871, 109267417, 146171871, "Den Boschsingel"), + new Val( 141, 146171871, 109267417, 23837544, "Den Boschsingel", + "Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)"), + + new Val( 140, 225605630, 23837544, 225605630, "Den Boschsingel"), + new Val( 139, 8131121, 23837544, 8131121, "Den Boschsingel"), + new Val( 138, 3680456, 23837544, 3680456, "Rennes-Singel"), + new Val( 137, 3994257, 23837544, 3994257, "Rennes-Singel"), + new Val( 136, 249333185, 23837544, 249333185, "Rennes-Singel"), + new Val( 135, 249333185, 23837544, 249333184, "Herestraat", + "Rennes-Singel - Den Boschsingel (318;410;601)"), + + new Val( 134, 813970231, 249333184, 813970231, "Herestraat"), + new Val( 133, 681081951, 249333184, 681081951, "Herestraat"), + new Val( 132, 681081951, 249333184, 813970227, "Herestraat", + "Herestraat (410;601)"), + + new Val( 131, 41403544, 813970227, 41403544, "Herestraat"), + new Val( 130, 8079995, 813970227, 8079995, "Herestraat"), + new Val( 129, 8079995, 813970227, 41403538, "Rotonde Het Teken", + "Herestraat (410;600;601)"), + + new Val( 128, 79340950, 41403538, 79340950, "Ring Zuid"), + new Val( 127, 79340950, 41403538, 11369123, "Ring Zuid", + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), + + new Val( 126, 11369123, 11369123, 159949154, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), + + new Val( 125, 159949154, 159949154, 332258104, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), + + new Val( 124, 78852604, 332258104, 78852604, null), + new Val( 123, 78852604, 332258104, 377918641, null, + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), + + new Val( 122, 14508736, 377918641, 14508736, null), + new Val( 121, 14508736, 377918641, 109267436, "Ring Zuid", + "(3;317;395;410;601)"), + + new Val( 120, 109267436, 109267436, 14508739, "Ring Zuid", + "Ring Zuid (3;317;395;410;600;601)"), + + new Val( 119, 14508739, 14508739, 14508740, "Ring Zuid", + "Ring Zuid (3;317;334;335;395;410;600;601)"), + + new Val( 118, 14508740, 14508740, 502328838, "Ring Zuid", + "Ring Zuid (3;317;334;335;380;395;410;600;601)"), + + new Val( 117, 502328837, 502328838, 502328837, "Ring Zuid"), + new Val( 116, 8080023, 502328838, 8080023, "Ring Zuid"), + new Val( 115, 78568660, 502328838, 78568660, "Rotonde Het Teken"), + new Val( 114, 78568660, 502328838, 78873921, "Rotonde Het Teken", + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), + + new Val( 113, 78873921, 78873921, 3752557, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), + + new Val( 112, 3752557, 3752557, 249333188, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), + + new Val( 111, 249333188, 249333188, 249333187, "Rotonde Het Teken", + "Rotonde Het Teken (3;410;600;601)"), + + new Val( 110, 249333187, 249333187, 13067134, "Herestraat", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), + + new Val( 109, 813970232, 13067134, 813970232, "Herestraat"), + new Val( 108, 813970226, 13067134, 813970226, "Herestraat"), + new Val( 107, 813970228, 13067134, 813970228, "Herestraat"), + new Val( 106, 813970228, 13067134, 813970229, "Herestraat", + "Herestraat (410;600;601)"), + + new Val( 105, 813970231, 813970229, 813970231, "Herestraat"), + new Val( 104, 249333184, 813970229, 249333184, "Herestraat"), + new Val( 103, 249333184, 813970229, 249333186, "Rennes-Singel", + "Herestraat (601)"), + + new Val( 102, 192559628, 249333186, 192559628, "Rennes-Singel"), + new Val( 101, 161166589, 249333186, 161166589, "Rennes-Singel"), + new Val( 100, 813979470, 249333186, 813979470, "Rennes-Singel"), + new Val( 99, 79289746, 249333186, 79289746, "Rennes-Singel"), + new Val( 98, 813979472, 249333186, 813979472, "Rennes-Singel"), + new Val( 97, 8131120, 249333186, 8131120, "Rennes-Singel"), + new Val( 96, 8131120, 249333186, 429706864, "Rennes-Singel", + "Rennes-Singel (318;601)"), + + new Val( 95, 99583853, 429706864, 99583853, "Tervuursevest"), + new Val( 94, 521193379, 429706864, 521193379, "Tervuursevest"), + new Val( 93, 521193380, 429706864, 521193380, "Tervuursevest"), + new Val( 92, 813979465, 429706864, 813979465, "Tervuursevest"), + new Val( 91, 174338458, 429706864, 174338458, "Tervuursevest"), + new Val( 90, 608715520, 429706864, 608715520, "Tervuursevest"), + new Val( 89, 608715521, 429706864, 608715521, "Tervuursevest"), + new Val( 88, 3677944, 429706864, 3677944, "Tervuursevest"), + new Val( 87, 174338459, 429706864, 174338459, "Tervuursevest"), + new Val( 86, 429706866, 429706864, 429706866, "Tervuursevest"), + new Val( 85, 88361317, 429706864, 88361317, "Tervuursevest"), + new Val( 84, 88361317, 429706864, 461159345, "Tervuursevest", + "Tervuursevest - Rennes-Singel (601)"), + + new Val( 83, 461159345, 461159345, 461159362, "Tervuursevest", + "Tervuursevest (178;179;601)"), + + new Val( 82, 344507822, 461159362, 344507822, "Tervuursevest"), + new Val( 81, 461159367, 461159362, 461159367, "Tervuursevest"), + new Val( 80, 3677335, 461159362, 3677335, "Tervuursevest"), + new Val( 79, 31474001, 461159362, 31474001, "Tervuursevest"), + new Val( 78, 23237288, 461159362, 23237288, "Tervuursevest"), + new Val( 77, 90168773, 461159362, 90168773, "Tervuursevest"), + new Val( 76, 23237287, 461159362, 23237287, "Tervuursevest"), + new Val( 75, 608715561, 461159362, 608715561, "Tervuursevest"), + new Val( 74, 608715562, 461159362, 608715562, "Tervuursevest"), + new Val( 73, 3677330, 461159362, 3677330, "Tervuursevest"), + new Val( 72, 3677330, 461159362, 86164005, "Naamsevest", + "Tervuursevest (178;179;520;524;525;537;601)"), + + new Val( 71, 655251293, 86164005, 655251293, "Naamsevest"), + new Val( 70, 131571763, 86164005, 131571763, "Naamsevest"), + new Val( 69, 661733369, 86164005, 661733369, "Naamsevest"), + new Val( 68, 655251292, 86164005, 655251292, "Naamsevest"), + new Val( 67, 3677823, 86164005, 3677823, "Naamsevest"), + new Val( 66, 24905257, 86164005, 24905257, "Geldenaaksevest"), + new Val( 65, 608715605, 86164005, 608715605, "Geldenaaksevest"), + new Val( 64, 608715606, 86164005, 608715606, "Geldenaaksevest"), + new Val( 63, 608715606, 86164005, 79299303, "Geldenaaksevest", + "Geldenaaksevest - Naamsevest (18;178;179;337;601;616)"), + + new Val( 62, 10296368, 79299303, 10296368, "Geldenaaksevest"), + new Val( 61, 521193607, 79299303, 521193607, "Geldenaaksevest"), + new Val( 60, 94585453, 79299303, 94585453, "Geldenaaksevest"), + new Val( 59, 586268893, 79299303, 586268893, "Geldenaaksevest"), + new Val( 58, 8130906, 79299303, 8130906, "Geldenaaksevest"), + new Val( 57, 8130906, 79299303, 16775171, "Tiensepoort", + "Geldenaaksevest (18;178;179;337;601;616;630)"), + + new Val( 56, 863272991, 16775171, 863272991, "Tiensevest"), + new Val( 55, 863272995, 16775171, 863272995, "Tiensevest"), + new Val( 54, 863272992, 16775171, 863272992, "Tiensevest"), + new Val( 53, 863272993, 16775171, 863272993, "Tiensevest"), + new Val( 52, 863272994, 16775171, 863272994, "Tiensevest"), new Val( 51, 8131717, 16775171, 8131717, "Tiensevest"), new Val( 50, 12712557, 16775171, 12712557, "Tiensevest"), - new Val( 49, 8590231, 16775171, 8590231, "Tiensevest"), - - new Val( 48, 8590231, 16775171, 185988814, "Tiensevest", - "Tiensevest - Tiensepoort (7;8;9;18;178;179;306 (student);337;380;527;601;616;630)", - "7;8;9;18;178;179;306 (student);337;380;527;601;616;630"), + new Val( 49, 12712557, 16775171, 8590231, "Tiensevest", + "Tiensevest - Tiensepoort (7;8;9;18;178;179;337;380;527;601;616;630)"), + new Val( 48, 8590231, 8590231, 185988814, "Tiensevest", + "Tiensevest (7;8;9;18;178;179;337;380;527;601;630)"), new Val( 47, 185988814, 185988814, 76856823, "Martelarenplein", - "Tiensevest (1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;616;630)", - "1;4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;616;630"), + "Tiensevest (1;4;5;6;7;8;9;18;178;179;337;380;527;601;630)"), new Val( 46, 459446598, 76856823, 459446598, "Martelarenplein"), new Val( 45, 459446600, 76856823, 459446600, "Martelarenplein"), new Val( 44, 78815533, 76856823, 78815533, null), - new Val( 43, 78815533, 76856823, 79264899, null, - "Martelarenplein (4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630)", - "4;5;6;7;8;9;18;178;179;306 (student);337;380;527;601;630"), - + "Martelarenplein (4;5;6;7;8;9;18;178;179;337;380;527;601;630)"), new Val( 42, 79264899, 79264899, 377918635, null, - "(4;5;6;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630)", - "4;5;6;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601;630"), - + "(4;5;6;18;178;179;333;334;335;337;370;371;373;374;380;512;601;630)"), new Val( 41, 377918635, 377918635, 79264888, null, - "(3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601)", - "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"), - + "(3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;601)"), new Val( 40, 79264888, 79264888, 79264897, null, - "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601)", - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"), + "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;525;601)"), new Val( 39, 71754927, 79264897, 71754927, null), - new Val( 38, 71754927, 79264897, 377918638, null, - "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601)", - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"), - + "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525;601)"), new Val( 37, 377918638, 377918638, 79264891, null, - "(18;601)", - "18;601"), - + "perron 13 (18;601)"), new Val( 36, 79264891, 79264891, 78568409, "Tiensevest", - "(18;601)", - "18;601"), - + "perron 13 (18;601)"), new Val( 35, 78568409, 78568409, 79193579, "Tiensevest", - "Tiensevest (4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658)", - "4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;334;335;337;380;601;616;658"), - + "Tiensevest (4;5;6;7;8;9;18;179;334;335;337;380;601;616;658)"), new Val( 34, 79193579, 79193579, 19793394, null, - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;600;601;616;630;658)"), new Val( 33, 19793394, 19793394, 19793164, "Tiensevest", - "(334;335;513;601)", - "334;335;513;601"), - + "(334;335;513;601)"), new Val( 32, 19793164, 19793164, 6184898, "Diestsevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658)", - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"), + "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)"), new Val( 31, 81457878, 6184898, 81457878, "Diestsevest"), new Val( 30, 4003924, 6184898, 4003924, "Diestsevest"), new Val( 29, 8133608, 6184898, 8133608, "Diestsevest"), - - new Val( 28, 8133608, 6184898, 254800931, "Joanna-Maria Artoisplein", - "Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", - "305;318;334;335;358;410;513;601;630;651;652;658"), - - - new Val( 27, 254800931, 254800931, 3992548, "Zoutstraat", - "Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", - "178;305;318;334;335;358;410;513;601;630;651;652;658"), - + new Val( 28, 254800931, 6184898, 254800931, "Joanna-Maria Artoisplein"), + new Val( 27, 254800931, 6184898, 3992548, "Zoutstraat", + "Joanna-Maria Artoisplein - Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)"), new Val( 26, 3992548, 3992548, 510790349, "Havenkant", - "Zoutstraat (334;335;513;601;630)", - "334;335;513;601;630"), + "Zoutstraat (334;335;513;601;630)"), new Val( 25, 510790348, 510790349, 510790348, "Havenkant"), new Val( 24, 314635787, 510790349, 314635787, "Havenkant"), @@ -543,8 +447,7 @@ public void bus601_600_3_Test() { new Val( 14, 338057820, 510790349, 338057820, "Engels Plein"), new Val( 13, 338057820, 510790349, 338057820, "Engels Plein", - "Engels Plein - Havenkant (601)", - "601") + "Engels Plein - Havenkant (601)") ); testPtLine(expectedValues, PT_ROUTE_BUS_601); @@ -569,185 +472,127 @@ public void bus601_600_3_Test() { new Val( 157, 314635787, 608715622, 314635787, "Havenkant"), new Val( 156, 510790348, 608715622, 510790348, "Havenkant"), new Val( 155, 29283599, 608715622, 29283599, "Havenkant"), - new Val( 154, 29283599, 608715622, 304241968, "Havenkant", - "Havenkant - Engels Plein (600)", - "600"), + "Havenkant - Engels Plein (600)"), new Val( 153, 304241967, 304241968, 304241967, "Aarschotsesteenweg"), - new Val( 152, 304241967, 304241968, 340265961, "Redersstraat", - "Aarschotsesteenweg - Havenkant (334;335;513;600;630)", - "334;335;513;600;630"), + "Aarschotsesteenweg - Havenkant (334;335;513;600;630)"), new Val( 151, 318825613, 340265961, 318825613, "Redersstraat"), - new Val( 150, 318825613, 340265961, 340265962, "Redersstraat", - "Redersstraat (600)", - "600"), - + "Redersstraat (600)"), new Val( 149, 340265962, 340265962, 254801390, "Joanna-Maria Artoisplein", - "Redersstraat (333;334;335;513;600;630)", - "333;334;335;513;600;630"), + "Redersstraat (333;334;335;513;600;630)"), - new Val( 148, 61540068, 254801390, 61540068, "Joanna-Maria Artoisplein"), + new Val( 148, 254801390, 254801390, 61540068, "Joanna-Maria Artoisplein", + "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)"), - new Val( 147, 61540068, 254801390, 23691160, "Vuurkruisenlaan", - "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)", - "178;305;318;333;334;335;410;513;600;630;651;652;658"), - - new Val( 146, 4061640, 23691160, 4061640, "Vuurkruisenlaan"), - new Val( 145, 8109264, 23691160, 8109264, "Diestsepoort"), - - new Val( 144, 8109264, 23691160, 61556877, "Diestsepoort", - "Diestsepoort - Vuurkruisenlaan (305;333;334;335;513;600;630;651;652;658)", - "305;333;334;335;513;600;630;651;652;658"), + new Val( 147, 23691160, 61540068, 23691160, "Vuurkruisenlaan"), + new Val( 146, 4061640, 61540068, 4061640, "Vuurkruisenlaan"), + new Val( 145, 8109264, 61540068, 8109264, "Diestsepoort"), + new Val( 144, 8109264, 61540068, 61556877, "Diestsepoort", + "Diestsepoort - Joanna-Maria Artoisplein (305;333;334;335;513;600;630;651;652;658)"), new Val( 143, 663770966, 61556877, 663770966, "Diestsepoort"), new Val( 142, 584356749, 61556877, 584356749, "Diestsepoort"), new Val( 141, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 140, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), new Val( 139, 584356751, 198559166, 584356751, "Diestsepoort"), new Val( 138, 451873773, 198559166, 451873773, "Diestsepoort"), new Val( 137, 584356742, 198559166, 584356742, "Diestsepoort"), new Val( 136, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 135, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), new Val( 134, 79264890, 76867049, 79264890, null), new Val( 133, 79596965, 76867049, 79596965, null), - new Val( 132, 79596965, 76867049, 79596974, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), new Val( 131, 79596982, 79596974, 79596982, null), - new Val( 130, 79596982, 79596974, 79596987, null, - "perron 11 & 12 (3;333;334;335;433;600;630)", - "3;333;334;335;433;600;630"), + "perron 11 & 12 (3;333;334;335;433;600;630)"), new Val( 129, 377918658, 79596987, 377918658, null), new Val( 128, 79596980, 79596987, 79596980, null), - new Val( 127, 79596980, 79596987, 79193579, "Tiensevest", - "perron 11 & 12 (3;333;334;335;513;600;630)", - "3;333;334;335;513;600;630"), - + "perron 11 & 12 (3;333;334;335;513;600;630)"), new Val( 126, 79193579, 79193579, 258936980, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;600;616;630;658)"), new Val( 125, 258936980, 258936980, 79193580, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)"), new Val( 124, 79193580, 79193580, 79193581, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)"), new Val( 123, 79193581, 79193581, 78815505, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), - + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)"), new Val( 122, 78815505, 78815505, 84696751, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)"), new Val( 121, 79265237, 84696751, 79265237, "Tiensevest"), - new Val( 120, 79265237, 84696751, 89574079, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"), + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)"), new Val( 119, 81522744, 89574079, 81522744, "Tiensevest"), - new Val( 118, 81522744, 89574079, 19793223, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", - "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"), + "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)"), new Val( 117, 185988814, 19793223, 185988814, "Tiensevest"), - new Val( 116, 185988814, 19793223, 185988816, "Tiensevest", - "Tiensevest (1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630)", - "1;4;5;6;7;8;9;18;179;306 (student);337;380;600;616;630"), + "Tiensevest (1;4;5;6;7;8;9;18;179;337;380;600;616;630)"), new Val( 115, 15083398, 185988816, 15083398, "Tiensevest"), - - new Val( 114, 15083398, 185988816, 8154434, "Tiensevest", - "Tiensevest (7;8;9;18;179;306 (student);337;380;600;616;630)", - "7;8;9;18;179;306 (student);337;380;600;616;630"), - - new Val( 113, 4003927, 8154434, 4003927, "Tiensevest"), - new Val( 112, 521193609, 8154434, 521193609, "Tiensevest"), - new Val( 111, 586268892, 8154434, 586268892, "Tiensevest"), - new Val( 110, 521193611, 8154434, 521193611, "Tiensevest"), - - new Val( 109, 521193611, 8154434, 4003928, "Tiensepoort", - "Tiensevest (7;8;9;18;178;179;306 (student);337;380;600;616;630)", - "7;8;9;18;178;179;306 (student);337;380;600;616;630"), - - new Val( 108, 8130905, 4003928, 8130905, "Geldenaaksevest"), - new Val( 107, 24905256, 4003928, 24905256, "Geldenaaksevest"), - new Val( 106, 24905255, 4003928, 24905255, "Geldenaaksevest"), + new Val( 114, 8154434, 185988816, 8154434, "Tiensevest"), + new Val( 113, 4003927, 185988816, 4003927, "Tiensevest"), + new Val( 112, 4003927, 185988816, 521193609, "Tiensevest"), + new Val( 111, 4003927, 185988816, 586268892, "Tiensevest"), + new Val( 110, 4003927, 185988816, 521193611, "Tiensevest"), + new Val( 109, 4003927, 185988816, 4003928, "Tiensepoort", + "Tiensevest (7;8;9;18;179;337;380;600;616;630)"), + + new Val( 108, 4003928, 4003928, 8130905, "Geldenaaksevest"), + new Val( 107, 4003928, 4003928, 24905256, "Geldenaaksevest"), + new Val( 106, 4003928, 4003928, 24905255, "Geldenaaksevest"), new Val( 105, 491728135, 4003928, 491728135, "Geldenaaksevest"), new Val( 104, 24905254, 4003928, 24905254, "Geldenaaksevest"), new Val( 103, 199381120, 4003928, 199381120, "Geldenaaksevest"), - new Val( 102, 199381120, 4003928, 3991775, "Geldenaaksevest", - "Geldenaaksevest - Tiensepoort (18;178;179;306 (student);337;600;616;630)", - "18;178;179;306 (student);337;600;616;630"), + "Geldenaaksevest - Tiensepoort (18;178;179;337;600;616;630)"), new Val( 101, 120086001, 3991775, 120086001, "Erasme Ruelensvest"), new Val( 100, 608715575, 3991775, 608715575, "Erasme Ruelensvest"), new Val( 99, 608715579, 3991775, 608715579, "Erasme Ruelensvest"), - new Val( 98, 608715579, 3991775, 3677822, "Erasme Ruelensvest", - "Erasme Ruelensvest - Geldenaaksevest (18;178;179;306 (student);337;600;616)", - "18;178;179;306 (student);337;600;616"), + "Erasme Ruelensvest - Geldenaaksevest (18;178;179;337;600;616)"), new Val( 97, 120086003, 3677822, 120086003, "Tervuursevest"), - new Val( 96, 120086003, 3677822, 90168774, "Tervuursevest", - "Tervuursevest - Erasme Ruelensvest (178;179;306 (student);600)", - "178;179;306 (student);600"), + "Tervuursevest - Erasme Ruelensvest (178;179;600)"), new Val( 95, 3677329, 90168774, 3677329, "Tervuursevest"), new Val( 94, 608715614, 90168774, 608715614, "Tervuursevest"), new Val( 93, 608715615, 90168774, 608715615, "Tervuursevest"), new Val( 92, 85044922, 90168774, 85044922, "Tervuursevest"), - new Val( 91, 85044922, 90168774, 16771611, "Tervuursevest", - "Tervuursevest (178;179;306 (student);520;524;525;537;586;600)", - "178;179;306 (student);520;524;525;537;586;600"), - + "Tervuursevest (178;179;520;524;525;537;586;600)"), new Val( 90, 16771611, 16771611, 13246158, "Tervuursevest", - "Tervuursevest (178;520;524;525;537;586;600)", - "178;520;524;525;537;586;600"), - + "Tervuursevest (178;520;524;525;537;586;600)"), new Val( 89, 13246158, 13246158, 260405216, "Tervuursevest", - "Tervuursevest (7;8;9;178;520;524;525;527;537;586;600)", - "7;8;9;178;520;524;525;527;537;586;600"), + "Tervuursevest (7;8;9;178;520;524;525;527;537;586;600)"), new Val( 88, 16771609, 260405216, 16771609, "Tervuursevest"), - new Val( 87, 16771609, 260405216, 608715518, "Tervuursevest", - "Tervuursevest (7;8;9;178;527;600)", - "7;8;9;178;527;600"), + "Tervuursevest (7;8;9;178;527;600)"), new Val( 86, 608715519, 608715518, 608715519, "Tervuursevest"), new Val( 85, 3677336, 608715518, 3677336, "Tervuursevest"), @@ -758,192 +603,129 @@ public void bus601_600_3_Test() { new Val( 80, 521193382, 608715518, 521193382, "Tervuursevest"), new Val( 79, 521193383, 608715518, 521193383, "Tervuursevest"), new Val( 78, 3677945, 608715518, 3677945, "Tervuursevest"), - new Val( 77, 3677945, 608715518, 192559627, "Rennes-Singel", - "Tervuursevest (178;600)", - "178;600"), + "Tervuursevest (178;600)"), new Val( 76, 813979469, 192559627, 813979469, "Rennes-Singel"), new Val( 75, 192559626, 192559627, 192559626, "Rennes-Singel"), new Val( 74, 813979473, 192559627, 813979473, "Rennes-Singel"), - new Val( 73, 28982660, 192559627, 28982660, "Rennes-Singel"), - - new Val( 72, 28982660, 192559627, 78568455, "Herestraat", - "Rennes-Singel (178;318;600)", - "178;318;600"), + new Val( 73, 813979473, 192559627, 28982660, "Rennes-Singel", + "Rennes-Singel (178;318;600)"), - - new Val( 71, 78568455, 78568455, 813970227, "Herestraat", - "Herestraat (600)", - "600"), + new Val( 72, 78568455, 28982660, 78568455, "Herestraat"), + new Val( 71, 78568455, 28982660, 813970227, "Herestraat", + "Herestraat - Rennes-Singel (600)"), new Val( 70, 41403544, 813970227, 41403544, "Herestraat"), new Val( 69, 8079995, 813970227, 8079995, "Herestraat"), - new Val( 68, 8079995, 813970227, 41403538, "Rotonde Het Teken", - "Herestraat (410;600;601)", - "410;600;601"), + "Herestraat (410;600;601)"), new Val( 67, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 66, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - - new Val( 65, 11369123, 11369123, 159949154, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - new Val( 64, 159949154, 159949154, 332258104, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + new Val( 65, 159949154, 11369123, 159949154, null), + new Val( 64, 159949154, 11369123, 332258104, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600)"), new Val( 63, 78852604, 332258104, 78852604, null), - new Val( 62, 78852604, 332258104, 14508735, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), new Val( 61, 14508735, 14508735, 318878531, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600"), + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)"), new Val( 60, 14506241, 318878531, 14506241, null), - new Val( 59, 14506241, 318878531, 109267436, "Ring Zuid", - "(3;317;395;410;600)", - "3;317;395;410;600"), - + "(3;317;395;410;600)"), new Val( 58, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410;600;601)", - "3;317;395;410;600;601"), - + "Ring Zuid (3;317;395;410;600)"), new Val( 57, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600;601)", - "3;317;334;335;395;410;600;601"), - + "Ring Zuid (3;317;334;335;395;410;600)"), new Val( 56, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600;601)", - "3;317;334;335;380;395;410;600;601"), + "Ring Zuid (3;317;334;335;380;395;410;600)"), new Val( 55, 502328837, 502328838, 502328837, "Ring Zuid"), new Val( 54, 8080023, 502328838, 8080023, "Ring Zuid"), new Val( 53, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 52, 78568660, 502328838, 78873921, "Rotonde Het Teken", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), new Val( 51, 78873921, 78873921, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600)"), new Val( 50, 3752557, 3752557, 249333188, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600)"), new Val( 49, 249333188, 249333188, 249333187, "Rotonde Het Teken", - "Rotonde Het Teken (3;410;600;601)", - "3;410;600;601"), - + "Rotonde Het Teken (3;410;600)"), new Val( 48, 249333187, 249333187, 13067134, "Herestraat", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600)"), new Val( 47, 813970232, 13067134, 813970232, "Herestraat"), new Val( 46, 813970226, 13067134, 813970226, "Herestraat"), new Val( 45, 813970228, 13067134, 813970228, "Herestraat"), - new Val( 44, 813970228, 13067134, 270181177, "Herestraat", - "Herestraat (410;600;601)", - "410;600;601"), - - - new Val( 43, 270181177, 270181177, 78568454, "Rennes-Singel", - "Herestraat (410;600)", - "410;600"), - - new Val( 42, 225605633, 78568454, 225605633, "Rennes-Singel"), + "Herestraat (410;600;601)"), - new Val( 41, 225605633, 78568454, 8131123, "Rennes-Singel", - "Rennes-Singel (178;318;410;600)", - "178;318;410;600"), + new Val( 43, 78568454, 270181177, 78568454, "Rennes-Singel"), + new Val( 42, 225605633, 270181177, 225605633, "Rennes-Singel"), + new Val( 41, 225605633, 270181177, 8131123, "Rennes-Singel", + "Rennes-Singel - Herestraat (410;600)"), new Val( 40, 3680457, 8131123, 3680457, "Rennes-Singel"), new Val( 39, 192559625, 8131123, 192559625, "Den Boschsingel"), new Val( 38, 23837543, 8131123, 23837543, "Den Boschsingel"), - - new Val( 37, 23837543, 8131123, 146171867, "Den Boschsingel", - "Den Boschsingel - Rennes-Singel (318;410;600)", - "318;410;600"), - - new Val( 36, 125835586, 146171867, 125835586, "Den Boschsingel"), - new Val( 35, 3877104, 146171867, 3877104, null), - new Val( 34, 85048201, 146171867, 85048201, "Lüdenscheidsingel"), - - new Val( 33, 85048201, 146171867, 12891213, "Lüdenscheidsingel", - "Lüdenscheidsingel - Den Boschsingel (318;410;600;651;658)", - "318;410;600;651;658"), - - new Val( 32, 44932919, 12891213, 44932919, "Lüdenscheidsingel"), - new Val( 31, 8131040, 12891213, 8131040, "Lüdenscheidsingel"), - new Val( 30, 61540098, 12891213, 61540098, "Joanna-Maria Artoisplein"), - - new Val( 29, 61540098, 12891213, 254801390, "Joanna-Maria Artoisplein", - "Joanna-Maria Artoisplein - Lüdenscheidsingel (178;305;318;410;600;651;652;658)", - "178;305;318;410;600;651;652;658"), - - new Val( 28, 61540068, 254801390, 61540068, "Joanna-Maria Artoisplein"), - - new Val( 27, 61540068, 254801390, 23691160, "Vuurkruisenlaan", - "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)", - "178;305;318;333;334;335;410;513;600;630;651;652;658"), - - new Val( 26, 4061640, 23691160, 4061640, "Vuurkruisenlaan"), - new Val( 25, 8109264, 23691160, 8109264, "Diestsepoort"), - - new Val( 24, 8109264, 23691160, 61556877, "Diestsepoort", - "Diestsepoort - Vuurkruisenlaan (305;333;334;335;513;600;630;651;652;658)", - "305;333;334;335;513;600;630;651;652;658"), + new Val( 37, 146171867, 8131123, 146171867, "Den Boschsingel"), + new Val( 36, 125835586, 8131123, 125835586, "Den Boschsingel"), + new Val( 35, 125835586, 8131123, 3877104, null, + "Den Boschsingel - Rennes-Singel (318;410;600)"), + + new Val( 34, 85048201, 3877104, 85048201, "Lüdenscheidsingel"), + new Val( 33, 12891213, 3877104, 12891213, "Lüdenscheidsingel"), + new Val( 32, 44932919, 3877104, 44932919, "Lüdenscheidsingel"), + new Val( 31, 44932919, 3877104, 8131040, "Lüdenscheidsingel", + "Lüdenscheidsingel - R23 (318;410;600;651;658)"), + + new Val( 30, 61540098, 8131040, 61540098, "Joanna-Maria Artoisplein"), + new Val( 29, 61540098, 8131040, 254801390, "Joanna-Maria Artoisplein", + "Joanna-Maria Artoisplein - Lüdenscheidsingel (178;305;318;410;600;651;652;658)"), + + new Val( 28, 254801390, 254801390, 61540068, "Joanna-Maria Artoisplein", + "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)"), + + new Val( 27, 23691160, 61540068, 23691160, "Vuurkruisenlaan"), + new Val( 26, 4061640, 61540068, 4061640, "Vuurkruisenlaan"), + new Val( 25, 8109264, 61540068, 8109264, "Diestsepoort"), + new Val( 24, 8109264, 61540068, 61556877, "Diestsepoort", + "Diestsepoort - Joanna-Maria Artoisplein (305;333;334;335;513;600;630;651;652;658)"), new Val( 23, 663770966, 61556877, 663770966, "Diestsepoort"), new Val( 22, 584356749, 61556877, 584356749, "Diestsepoort"), new Val( 21, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 20, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), new Val( 19, 584356751, 198559166, 584356751, "Diestsepoort"), new Val( 18, 451873773, 198559166, 451873773, "Diestsepoort"), new Val( 17, 584356742, 198559166, 584356742, "Diestsepoort"), new Val( 16, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 15, 451873774, 198559166, 116797180, "Diestsepoort", - "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), new Val( 14, 23691157, 116797180, 23691157, "Diestsepoort"), - new Val( 13, 23691157, 116797180, 78815527, null, - "Diestsepoort (4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658)", - "4;5;6;7;8;9;179;306 (student);334;335;337;380;600;616;651;652;658"), + "Diestsepoort (4;5;6;7;8;9;179;334;335;337;380;600;616;651;652;658)"), new Val( 12, 377918658, 78815527, 377918658, null), new Val( 11, 377918658, 78815527, 377918658, null, - "perron 11 & 12 (395;600;651;652)", - "395;600;651;652") + "perron 11 & 12 (600;651;652)") ); testPtLine(expectedValues, PT_ROUTE_BUS_600); @@ -951,7 +733,7 @@ public void bus601_600_3_Test() { // *********************************************************** // Line 3 has the particularity that there are 2 variants // The longer version has a spoon to serve another hospital - // The following test block is for the last stretch of the shorter version + // The following test block is for the shorter version // *********************************************************** expectedValues = Arrays.asList( @@ -959,15 +741,11 @@ public void bus601_600_3_Test() { new Val( 193, 349396917, 27684829, 349396917, "Dorpskring"), new Val( 192, 349396921, 27684829, 349396921, "Dorpskring"), new Val( 191, 112917099, 27684829, 112917099, "Dorpskring"), - new Val( 190, 112917099, 27684829, 125835538, "Dorpskring", - "Dorpskring (3)", - "3"), - + "Dorpskring (3)"), new Val( 189, 125835538, 125835538, 81197019, "Bollenberg", - "Dorpskring (3;373;485)", - "3;373;485"), + "Dorpskring (3;373;485)"), new Val( 188, 112917100, 81197019, 112917100, "Bollenberg"), new Val( 187, 694551612, 81197019, 694551612, "Bollenberg"), @@ -979,10 +757,8 @@ public void bus601_600_3_Test() { new Val( 181, 636950670, 81197019, 636950670, "Kapelstraat"), new Val( 180, 16377722, 81197019, 16377722, "Kapelstraat"), new Val( 179, 16377612, 81197019, 16377612, "Kapelstraat"), - new Val( 178, 16377612, 81197019, 40189518, "Lostraat", - "Kapelstraat - Bollenberg (3)", - "3"), + "Kapelstraat - Bollenberg (3)"), new Val( 177, 351196789, 40189518, 351196789, "Lostraat"), new Val( 176, 350992067, 40189518, 350992067, "Lostraat"), @@ -1032,86 +808,60 @@ public void bus601_600_3_Test() { new Val( 132, 608715590, 40189518, 608715590, "Martelarenlaan"), new Val( 131, 3992546, 40189518, 3992546, "Martelarenlaan"), new Val( 130, 10230617, 40189518, 10230617, "Oude Diestsesteenweg"), - new Val( 129, 10230617, 40189518, 23707243, "Diestsesteenweg", - "Oude Diestsesteenweg - Lostraat (3)", - "3"), - + "Oude Diestsesteenweg - Lostraat (3)"), new Val( 128, 23707243, 23707243, 23707244, "Diestsesteenweg", - "Diestsesteenweg (3;370;371;373;374;475;485;524;525)", - "3;370;371;373;374;475;485;524;525"), + "Diestsesteenweg (3;370;371;373;374;475;485;524;525)"), new Val( 127, 12715116, 23707244, 12715116, "Diestsesteenweg"), - new Val( 126, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", - "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + "Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)"), new Val( 125, 663770966, 61556877, 663770966, "Diestsepoort"), new Val( 124, 584356749, 61556877, 584356749, "Diestsepoort"), new Val( 123, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 122, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), new Val( 121, 584356751, 198559166, 584356751, "Diestsepoort"), new Val( 120, 451873773, 198559166, 451873773, "Diestsepoort"), new Val( 119, 584356742, 198559166, 584356742, "Diestsepoort"), new Val( 118, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 117, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), new Val( 116, 79264890, 76867049, 79264890, null), new Val( 115, 79596965, 76867049, 79596965, null), - new Val( 114, 79596965, 76867049, 71754927, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), - + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), new Val( 113, 71754927, 71754927, 79264897, null, - "(2;3;310;370;371;373;374;475;485;513;520;524;525)", - "2;3;310;370;371;373;374;475;485;513;520;524;525"), + "(2;3;310;370;371;373;374;475;485;513;520;524;525)"), new Val( 112, 79596983, 79264897, 79596983, null), new Val( 111, 377918665, 79264897, 377918665, null), - new Val( 110, 377918665, 79264897, 78815513, null, - "perron 7 & 8 (2;3;310)", - "2;3;310"), + "perron 7 & 8 (2;3;310)"), new Val( 109, 377918666, 78815513, 377918666, null), new Val( 108, 79596978, 78815513, 79596978, null), - new Val( 107, 79596978, 78815513, 79193581, "Tiensevest", - "perron 7 & 8 (2;3)", - "2;3"), - + "perron 7 & 8 (2;3)"), new Val( 106, 79193581, 79193581, 78815505, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), - + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), new Val( 105, 78815505, 78815505, 84696751, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), new Val( 104, 79265237, 84696751, 79265237, "Tiensevest"), - new Val( 103, 79265237, 84696751, 89574079, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"), + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)"), new Val( 102, 81522744, 89574079, 81522744, "Tiensevest"), - new Val( 101, 81522744, 89574079, 305434579, "Bondgenotenlaan", - "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", - "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"), + "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)"), new Val( 100, 578662093, 305434579, 578662093, "Bondgenotenlaan"), new Val( 99, 578662092, 305434579, 578662092, "Bondgenotenlaan"), @@ -1120,16 +870,12 @@ public void bus601_600_3_Test() { new Val( 96, 3991636, 305434579, 3991636, "Bondgenotenlaan"), new Val( 95, 174985125, 305434579, 174985125, "Rector De Somerplein"), new Val( 94, 521211977, 305434579, 521211977, "Rector De Somerplein"), - new Val( 93, 521211977, 305434579, 521211976, "Rector De Somerplein", - "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), + "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), new Val( 92, 16771741, 521211976, 16771741, "Rector De Somerplein"), - new Val( 91, 16771741, 521211976, 3991635, "Margarethaplein", - "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), + "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), new Val( 90, 521211973, 3991635, 521211973, "Margarethaplein"), new Val( 89, 608715546, 3991635, 608715546, "Margarethaplein"), @@ -1143,34 +889,26 @@ public void bus601_600_3_Test() { new Val( 81, 3992578, 3991635, 3992578, "Dirk Boutslaan"), new Val( 80, 438252643, 3991635, 438252643, "Dirk Boutslaan"), new Val( 79, 284664268, 3991635, 284664268, "Brouwersstraat"), - new Val( 78, 284664268, 3991635, 608715545, "Brouwersstraat", - "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", - "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), new Val( 77, 608715543, 608715545, 608715543, "Brouwersstraat"), new Val( 76, 608715542, 608715545, 608715542, "Brouwersstraat"), new Val( 75, 608715544, 608715545, 608715544, "Brouwersstraat"), new Val( 74, 284664272, 608715545, 284664272, "Brouwersstraat"), - new Val( 73, 284664272, 608715545, 147856945, "Tessenstraat - Fonteinstraat", - "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", - "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), new Val( 72, 123929547, 147856945, 123929547, "Kapucijnenvoer"), - new Val( 71, 123929547, 147856945, 3358673, "Biezenstraat", - "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", - "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), new Val( 70, 578662071, 3358673, 578662071, "Sint-Jacobsplein"), new Val( 69, 521211966, 3358673, 521211966, "Sint-Jacobsplein"), new Val( 68, 3358671, 3358673, 3358671, "Sint-Jacobsplein"), new Val( 67, 123929615, 3358673, 123929615, "Sint-Hubertusstraat"), - new Val( 66, 123929615, 3358673, 189453003, "Monseigneur Van Waeyenberghlaan", - "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)", - "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513"), + "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)"), new Val( 65, 79289753, 189453003, 79289753, "Monseigneur Van Waeyenberghlaan"), new Val( 64, 189453004, 189453003, 189453004, "Monseigneur Van Waeyenberghlaan"), @@ -1178,77 +916,49 @@ public void bus601_600_3_Test() { new Val( 62, 189453001, 189453003, 189453001, "Monseigneur Van Waeyenberghlaan"), new Val( 61, 810592121, 189453003, 810592121, "Monseigneur Van Waeyenberghlaan"), new Val( 60, 249333181, 189453003, 249333181, "Monseigneur Van Waeyenberghlaan"), - new Val( 59, 249333181, 189453003, 249333187, "Rotonde Het Teken", - "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)", - "3;317;333;334;335;370;371;373;374;380;395;513"), - + "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)"), new Val( 58, 249333187, 249333187, 813970230, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 57, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - new Val( 56, 41403540, 813970230, 41403538, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)", - "3;317;333;334;335;370;371;373;374;380;395;513"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)"), new Val( 55, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 54, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 53, 11369123, 11369123, 159949154, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - - new Val( 52, 159949154, 159949154, 332258104, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + new Val( 53, 159949154, 11369123, 159949154, null), + new Val( 52, 159949154, 11369123, 332258104, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 51, 78852604, 332258104, 78852604, null), - new Val( 50, 78852604, 332258104, 14508735, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), new Val( 49, 14508735, 14508735, 318878531, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600"), + "(3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 48, 14506241, 318878531, 14506241, null), - new Val( 47, 14506241, 318878531, 109267436, "Ring Zuid", - "(3;317;395;410;600)", - "3;317;395;410;600"), - + "(3;317;395;410;600)"), new Val( 46, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410;600;601)", - "3;317;395;410;600;601"), - + "Ring Zuid (3;317;395;410)"), new Val( 45, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600;601)", - "3;317;334;335;395;410;600;601"), - + "Ring Zuid (3;317;334;335;395;410)"), new Val( 44, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600;601)", - "3;317;334;335;380;395;410;600;601"), + "Ring Zuid (3;317;334;335;380;395;410)"), new Val( 43, 502328837, 502328838, 502328837, "Ring Zuid"), new Val( 42, 8080023, 502328838, 8080023, "Ring Zuid"), new Val( 41, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 40, 78568660, 502328838, 15945426, "Ring Noord", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), new Val( 39, 502317795, 15945426, 502317795, "Ring Noord"), new Val( 38, 810580948, 15945426, 810580948, "Ring Noord"), @@ -1258,8 +968,7 @@ public void bus601_600_3_Test() { new Val( 34, 377918625, 15945426, 377918625, "Ring Noord"), new Val( 33, 377918625, 15945426, 377918625, "Ring Noord", - "Ring Noord (3)", - "3") + "Ring Noord (3)") ); testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); @@ -1275,15 +984,11 @@ public void bus601_600_3_Test() { new Val( 216, 349396917, 27684829, 349396917, "Dorpskring"), new Val( 215, 349396921, 27684829, 349396921, "Dorpskring"), new Val( 214, 112917099, 27684829, 112917099, "Dorpskring"), - new Val( 213, 112917099, 27684829, 125835538, "Dorpskring", - "Dorpskring (3)", - "3"), - + "Dorpskring (3)"), new Val( 212, 125835538, 125835538, 81197019, "Bollenberg", - "Dorpskring (3;373;485)", - "3;373;485"), + "Dorpskring (3;373;485)"), new Val( 211, 112917100, 81197019, 112917100, "Bollenberg"), new Val( 210, 694551612, 81197019, 694551612, "Bollenberg"), @@ -1295,20 +1000,16 @@ public void bus601_600_3_Test() { new Val( 204, 636950670, 81197019, 636950670, "Kapelstraat"), new Val( 203, 16377722, 81197019, 16377722, "Kapelstraat"), new Val( 202, 16377612, 81197019, 16377612, "Kapelstraat"), - new Val( 201, 16377612, 81197019, 112917224, "Ganzendries", - "Kapelstraat - Bollenberg (3)", - "3"), + "Kapelstraat - Bollenberg (3)"), new Val( 200, 319264895, 112917224, 319264895, "Ganzendries"), new Val( 199, 27682732, 112917224, 27682732, "Sint Barbaradreef"), new Val( 198, 527248228, 112917224, 527248228, null), new Val( 197, 27686451, 112917224, 27686451, null), new Val( 196, 847554912, 112917224, 847554912, null), - new Val( 195, 847554912, 112917224, 27686453, null, - "Sint Barbaradreef - Ganzendries (3)", - "3"), + "Sint Barbaradreef - Ganzendries (3)"), new Val( 194, 110643012, 27686453, 110643012, null), new Val( 193, 112917220, 27686453, 112917220, null), @@ -1316,20 +1017,16 @@ public void bus601_600_3_Test() { new Val( 191, 27682735, 27686453, 27682735, null), new Val( 190, 319269351, 27686453, 319269351, "Sint Barbaradreef"), new Val( 189, 112917225, 27686453, 112917225, "Sint Barbaradreef"), - new Val( 188, 112917225, 27686453, 847554912, null, - "Sint Barbaradreef (3)", - "3"), + "Sint Barbaradreef (3)"), new Val( 187, 27686451, 847554912, 27686451, null), new Val( 186, 527248228, 847554912, 527248228, null), new Val( 185, 27682732, 847554912, 27682732, "Sint Barbaradreef"), new Val( 184, 319264895, 847554912, 319264895, "Ganzendries"), new Val( 183, 112917224, 847554912, 112917224, "Ganzendries"), - new Val( 182, 112917224, 847554912, 40189518, "Lostraat", - "Ganzendries - Sint Barbaradreef (3)", - "3"), + "Ganzendries - Sint Barbaradreef (3)"), new Val( 181, 351196789, 40189518, 351196789, "Lostraat"), new Val( 180, 350992067, 40189518, 350992067, "Lostraat"), @@ -1379,95 +1076,65 @@ public void bus601_600_3_Test() { new Val( 136, 608715590, 40189518, 608715590, "Martelarenlaan"), new Val( 135, 3992546, 40189518, 3992546, "Martelarenlaan"), new Val( 134, 10230617, 40189518, 10230617, "Oude Diestsesteenweg"), - new Val( 133, 10230617, 40189518, 23707243, "Diestsesteenweg", - "Oude Diestsesteenweg - Lostraat (3)", - "3"), - + "Oude Diestsesteenweg - Lostraat (3)"), new Val( 132, 23707243, 23707243, 23707244, "Diestsesteenweg", - "Diestsesteenweg (3;370;371;373;374;475;485;524;525)", - "3;370;371;373;374;475;485;524;525"), + "Diestsesteenweg (3;370;371;373;374;475;485;524;525)"), new Val( 131, 12715116, 23707244, 12715116, "Diestsesteenweg"), - new Val( 130, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", - "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + "Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)"), new Val( 129, 663770966, 61556877, 663770966, "Diestsepoort"), new Val( 128, 584356749, 61556877, 584356749, "Diestsepoort"), new Val( 127, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 126, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), new Val( 125, 584356751, 198559166, 584356751, "Diestsepoort"), new Val( 124, 451873773, 198559166, 451873773, "Diestsepoort"), new Val( 123, 584356742, 198559166, 584356742, "Diestsepoort"), new Val( 122, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 121, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), new Val( 120, 79264890, 76867049, 79264890, null), new Val( 119, 79596965, 76867049, 79596965, null), - new Val( 118, 79596965, 76867049, 79596974, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), new Val( 117, 79596982, 79596974, 79596982, null), - new Val( 116, 79596982, 79596974, 79596987, null, - "perron 11 & 12 (3;333;334;335;433;600;630)", - "3;333;334;335;433;600;630"), + "perron 11 & 12 (3;333;334;335;433;600;630)"), new Val( 115, 377918658, 79596987, 377918658, null), new Val( 114, 79596980, 79596987, 79596980, null), - new Val( 113, 79596980, 79596987, 79193579, "Tiensevest", - "perron 11 & 12 (3;333;334;335;513;600;630)", - "3;333;334;335;513;600;630"), - + "perron 11 & 12 (3;333;334;335;513;600;630)"), new Val( 112, 79193579, 79193579, 258936980, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;380;513;600;601;616;630;658"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;616;630;658)"), new Val( 111, 258936980, 258936980, 79193580, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630;658)"), new Val( 110, 79193580, 79193580, 79193581, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), - + "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), new Val( 109, 79193581, 79193581, 78815505, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), - + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), new Val( 108, 78815505, 78815505, 84696751, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630"), + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), new Val( 107, 79265237, 84696751, 79265237, "Tiensevest"), - new Val( 106, 79265237, 84696751, 89574079, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", - "2;3;4;5;6;7;8;9;18;179;306 (student);333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630"), + "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)"), new Val( 105, 81522744, 89574079, 81522744, "Tiensevest"), - new Val( 104, 81522744, 89574079, 305434579, "Bondgenotenlaan", - "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", - "1;2;3;4;5;6;7;8;9;18;179;284;285;306 (student);315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630"), + "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)"), new Val( 103, 578662093, 305434579, 578662093, "Bondgenotenlaan"), new Val( 102, 578662092, 305434579, 578662092, "Bondgenotenlaan"), @@ -1476,16 +1143,12 @@ public void bus601_600_3_Test() { new Val( 99, 3991636, 305434579, 3991636, "Bondgenotenlaan"), new Val( 98, 174985125, 305434579, 174985125, "Rector De Somerplein"), new Val( 97, 521211977, 305434579, 521211977, "Rector De Somerplein"), - new Val( 96, 521211977, 305434579, 521211976, "Rector De Somerplein", - "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), + "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), new Val( 95, 16771741, 521211976, 16771741, "Rector De Somerplein"), - new Val( 94, 16771741, 521211976, 3991635, "Margarethaplein", - "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)", - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539"), + "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), new Val( 93, 521211973, 3991635, 521211973, "Margarethaplein"), new Val( 92, 608715546, 3991635, 608715546, "Margarethaplein"), @@ -1499,34 +1162,26 @@ public void bus601_600_3_Test() { new Val( 84, 3992578, 3991635, 3992578, "Dirk Boutslaan"), new Val( 83, 438252643, 3991635, 438252643, "Dirk Boutslaan"), new Val( 82, 284664268, 3991635, 284664268, "Brouwersstraat"), - new Val( 81, 284664268, 3991635, 608715545, "Brouwersstraat", - "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", - "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), new Val( 80, 608715543, 608715545, 608715543, "Brouwersstraat"), new Val( 79, 608715542, 608715545, 608715542, "Brouwersstraat"), new Val( 78, 608715544, 608715545, 608715544, "Brouwersstraat"), new Val( 77, 284664272, 608715545, 284664272, "Brouwersstraat"), - new Val( 76, 284664272, 608715545, 147856945, "Tessenstraat - Fonteinstraat", - "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", - "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), new Val( 75, 123929547, 147856945, 123929547, "Kapucijnenvoer"), - new Val( 74, 123929547, 147856945, 3358673, "Biezenstraat", - "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)", - "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537"), + "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), new Val( 73, 578662071, 3358673, 578662071, "Sint-Jacobsplein"), new Val( 72, 521211966, 3358673, 521211966, "Sint-Jacobsplein"), new Val( 71, 3358671, 3358673, 3358671, "Sint-Jacobsplein"), new Val( 70, 123929615, 3358673, 123929615, "Sint-Hubertusstraat"), - new Val( 69, 123929615, 3358673, 189453003, "Monseigneur Van Waeyenberghlaan", - "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)", - "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513"), + "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)"), new Val( 68, 79289753, 189453003, 79289753, "Monseigneur Van Waeyenberghlaan"), new Val( 67, 189453004, 189453003, 189453004, "Monseigneur Van Waeyenberghlaan"), @@ -1534,81 +1189,51 @@ public void bus601_600_3_Test() { new Val( 65, 189453001, 189453003, 189453001, "Monseigneur Van Waeyenberghlaan"), new Val( 64, 810592121, 189453003, 810592121, "Monseigneur Van Waeyenberghlaan"), new Val( 63, 249333181, 189453003, 249333181, "Monseigneur Van Waeyenberghlaan"), - new Val( 62, 249333181, 189453003, 249333187, "Rotonde Het Teken", - "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)", - "3;317;333;334;335;370;371;373;374;380;395;513"), - + "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)"), new Val( 61, 249333187, 249333187, 813970230, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 60, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - new Val( 59, 41403540, 813970230, 41403538, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)", - "3;317;333;334;335;370;371;373;374;380;395;513"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)"), new Val( 58, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 57, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - - new Val( 56, 11369123, 11369123, 159949154, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - new Val( 55, 159949154, 159949154, 332258104, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + new Val( 56, 159949154, 11369123, 159949154, null), + new Val( 55, 159949154, 11369123, 332258104, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 54, 78852604, 332258104, 78852604, null), - new Val( 53, 78852604, 332258104, 14508735, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), new Val( 52, 14508735, 14508735, 109267438, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600"), - + "(3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 51, 109267438, 109267438, 318878532, null, - "(3;333;334;335;370;371;373;374;380;513)", - "3;333;334;335;370;371;373;374;380;513"), - + "(3;333;334;335;370;371;373;374;380;513)"), new Val( 50, 318878532, 318878532, 100687528, null, - "(3;333;334;335;513)", - "3;333;334;335;513"), - + "(3;333;334;335;513)"), new Val( 49, 100687528, 100687528, 14508739, "Ring Zuid", - "(3;334;335)", - "3;334;335"), - + "(3;334;335)"), new Val( 48, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600;601)", - "3;317;334;335;395;410;600;601"), - + "Ring Zuid (3;317;334;335;395;410)"), new Val( 47, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600;601)", - "3;317;334;335;380;395;410;600;601"), + "Ring Zuid (3;317;334;335;380;395;410)"), new Val( 46, 502328837, 502328838, 502328837, "Ring Zuid"), new Val( 45, 8080023, 502328838, 8080023, "Ring Zuid"), new Val( 44, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 43, 78568660, 502328838, 15945426, "Ring Noord", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), new Val( 42, 502317795, 15945426, 502317795, "Ring Noord"), new Val( 41, 810580948, 15945426, 810580948, "Ring Noord"), @@ -1618,8 +1243,7 @@ public void bus601_600_3_Test() { new Val( 37, 377918625, 15945426, 377918625, "Ring Noord"), new Val( 36, 377918625, 15945426, 377918625, "Ring Noord", - "Ring Noord (3)", - "3") + "Ring Noord (3)") ); testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); @@ -1641,91 +1265,58 @@ public void bus601_600_3_Test() { new Val( 215, 112917238, 377918626, 112917238, "Ring Noord"), new Val( 214, 502317797, 377918626, 502317797, "Ring Noord"), new Val( 213, 112917239, 377918626, 112917239, "Ring Noord"), - new Val( 212, 112917239, 377918626, 3752557, "Rotonde Het Teken", - "Ring Noord (3)", - "3"), - + "Ring Noord (3)"), new Val( 211, 3752557, 3752557, 249333188, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410)"), new Val( 210, 249333188, 249333188, 249333187, "Rotonde Het Teken", - "Rotonde Het Teken (3;410;600;601)", - "3;410;600;601"), - + "Rotonde Het Teken (3;410)"), new Val( 209, 249333187, 249333187, 813970230, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 208, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - new Val( 207, 41403540, 813970230, 41403538, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)", - "3;317;333;334;335;370;371;373;374;380;395;513"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)"), new Val( 206, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 205, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - + "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - new Val( 204, 11369123, 11369123, 159949154, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), - - - new Val( 203, 159949154, 159949154, 332258104, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + new Val( 204, 159949154, 11369123, 159949154, null), + new Val( 203, 159949154, 11369123, 332258104, null, + "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513)"), new Val( 202, 78852604, 332258104, 78852604, null), - new Val( 201, 78852604, 332258104, 377918641, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;513;600;601"), + "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), new Val( 200, 14508736, 377918641, 14508736, null), - new Val( 199, 14508736, 377918641, 109267436, "Ring Zuid", - "(3;317;395;410;601)", - "3;317;395;410;601"), - + "(3;317;395;410;601)"), new Val( 198, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410;600;601)", - "3;317;395;410;600;601"), - + "Ring Zuid (3;317;395;410)"), new Val( 197, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600;601)", - "3;317;334;335;395;410;600;601"), - + "Ring Zuid (3;317;334;335;395;410)"), new Val( 196, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600;601)", - "3;317;334;335;380;395;410;600;601"), + "Ring Zuid (3;317;334;335;380;395;410)"), new Val( 195, 502328837, 502328838, 502328837, "Ring Zuid"), new Val( 194, 8080023, 502328838, 8080023, "Ring Zuid"), new Val( 193, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 192, 78568660, 502328838, 78873921, "Rotonde Het Teken", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), - - new Val( 191, 78873921, 78873921, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), + new Val( 191, 78873921, 78873921, 3752557, "Rotonde Het Teken", + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410)"), new Val( 190, 3752557, 3752557, 249333183, "Monseigneur Van Waeyenberghlaan", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - "3;317;333;334;335;370;371;373;374;380;395;410;600;601"), + "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410)"), new Val( 189, 810592121, 249333183, 810592121, "Monseigneur Van Waeyenberghlaan"), new Val( 188, 189453001, 249333183, 189453001, "Monseigneur Van Waeyenberghlaan"), @@ -1733,34 +1324,26 @@ public void bus601_600_3_Test() { new Val( 186, 189453004, 249333183, 189453004, "Monseigneur Van Waeyenberghlaan"), new Val( 185, 79289753, 249333183, 79289753, "Monseigneur Van Waeyenberghlaan"), new Val( 184, 189453003, 249333183, 189453003, "Monseigneur Van Waeyenberghlaan"), - new Val( 183, 189453003, 249333183, 123929615, "Sint-Hubertusstraat", - "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395)", - "3;317;333;334;335;370;371;373;374;380;395"), + "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395)"), new Val( 182, 3358671, 123929615, 3358671, "Sint-Jacobsplein"), new Val( 181, 521211966, 123929615, 521211966, "Sint-Jacobsplein"), new Val( 180, 578662071, 123929615, 578662071, "Sint-Jacobsplein"), new Val( 179, 3358673, 123929615, 3358673, "Biezenstraat"), - new Val( 178, 3358673, 123929615, 123929547, "Kapucijnenvoer", - "Biezenstraat - Sint-Hubertusstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395)", - "3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395"), + "Biezenstraat - Sint-Hubertusstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395)"), new Val( 177, 147856945, 123929547, 147856945, "Tessenstraat - Fonteinstraat"), - new Val( 176, 147856945, 123929547, 284664272, "Brouwersstraat", - "Tessenstraat - Fonteinstraat - Kapucijnenvoer (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)", - "3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"), + "Tessenstraat - Fonteinstraat - Kapucijnenvoer (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)"), new Val( 175, 608715544, 284664272, 608715544, "Brouwersstraat"), new Val( 174, 608715542, 284664272, 608715542, "Brouwersstraat"), new Val( 173, 608715543, 284664272, 608715543, "Brouwersstraat"), new Val( 172, 608715545, 284664272, 608715545, "Brouwersstraat"), - new Val( 171, 608715545, 284664272, 284664268, "Brouwersstraat", - "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)", - "3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"), + "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)"), new Val( 170, 438252643, 284664268, 438252643, "Dirk Boutslaan"), new Val( 169, 3992578, 284664268, 3992578, "Dirk Boutslaan"), @@ -1774,10 +1357,8 @@ public void bus601_600_3_Test() { new Val( 161, 608715546, 284664268, 608715546, "Margarethaplein"), new Val( 160, 521211973, 284664268, 521211973, "Margarethaplein"), new Val( 159, 3991635, 284664268, 3991635, "Margarethaplein"), - new Val( 158, 3991635, 284664268, 16771741, "Rector De Somerplein", - "Margarethaplein - Brouwersstraat (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)", - "3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586"), + "Margarethaplein - Brouwersstraat (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)"), new Val( 157, 521211976, 16771741, 521211976, "Rector De Somerplein"), new Val( 156, 521211977, 16771741, 521211977, "Rector De Somerplein"), @@ -1788,65 +1369,45 @@ public void bus601_600_3_Test() { new Val( 151, 578662092, 16771741, 578662092, "Bondgenotenlaan"), new Val( 150, 578662093, 16771741, 578662093, "Bondgenotenlaan"), new Val( 149, 305434579, 16771741, 305434579, "Bondgenotenlaan"), - new Val( 148, 305434579, 16771741, 81522744, "Tiensevest", - "Bondgenotenlaan - Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586)", - "2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586"), + "Bondgenotenlaan - Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586)"), new Val( 147, 89574079, 81522744, 89574079, "Tiensevest"), - new Val( 146, 89574079, 81522744, 79265237, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586;616)", - "1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586;616"), - + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586)"), new Val( 145, 79265237, 79265237, 79211473, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586;616)", - "1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586;616"), - + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586)"), new Val( 144, 79211473, 79211473, 79605527, null, - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", - "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;658)"), new Val( 143, 79605524, 79605527, 79605524, null), new Val( 142, 377918661, 79605527, 377918661, null), new Val( 141, 79596984, 79605527, 79596984, null), new Val( 140, 377918662, 79605527, 377918662, null), new Val( 139, 79596971, 79605527, 79596971, null), - new Val( 138, 79596971, 79605527, 377918635, null, - "perron 3 & 4 (3;4;5;6;7;8;9)", - "3;4;5;6;7;8;9"), - + "perron 3 & 4 (3;4;5;6;7;8;9)"), new Val( 137, 377918635, 377918635, 79264888, null, - "(3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601)", - "3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;601"), - + "(3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512)"), new Val( 136, 79264888, 79264888, 79264897, null, - "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601)", - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;525;601"), + "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;525)"), new Val( 135, 71754927, 79264897, 71754927, null), - new Val( 134, 71754927, 79264897, 79596965, null, - "(2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601)", - "2;3;4;5;6;7;8;9;18;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525;601"), + "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525;601)"), new Val( 133, 79264890, 79596965, 79264890, null), new Val( 132, 76867049, 79596965, 76867049, null), - new Val( 131, 76867049, 79596965, 451873774, "Diestsepoort", - "(2;3;4;5;6;7;8;9;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525)", - "2;3;4;5;6;7;8;9;178;179;306 (student);333;334;335;337;370;371;373;374;380;512;520;524;525"), + "(2;3;4;5;6;7;8;9;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525)"), new Val( 130, 584356742, 451873774, 584356742, "Diestsepoort"), - new Val( 129, 584356742, 451873774, 451873773, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)", - "2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525"), + "Diestsepoort (2;3;178;179;306;310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)"), new Val( 128, 584356751, 451873773, 584356751, "Diestsepoort"), new Val( 127, 198559166, 451873773, 198559166, "Diestsepoort"), @@ -1854,22 +1415,16 @@ public void bus601_600_3_Test() { new Val( 125, 584356749, 451873773, 584356749, "Diestsepoort"), new Val( 124, 663770966, 451873773, 663770966, "Diestsepoort"), new Val( 123, 61556877, 451873773, 61556877, "Diestsepoort"), - new Val( 122, 61556877, 451873773, 8109264, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", - "2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + "Diestsepoort (2;3;178;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), new Val( 121, 125835524, 8109264, 125835524, "Diestsesteenweg"), new Val( 120, 23707244, 8109264, 23707244, "Diestsesteenweg"), - new Val( 119, 23707244, 8109264, 23707243, "Diestsesteenweg", - "Diestsesteenweg - Diestsepoort (2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", - "2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), - + "Diestsesteenweg - Diestsepoort (2;3;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), new Val( 118, 23707243, 23707243, 10230617, "Oude Diestsesteenweg", - "Diestsesteenweg (3;370;371;373;374;475;485;524;525)", - "3;370;371;373;374;475;485;524;525"), + "Diestsesteenweg (3;370;371;373;374;475;485;524;525)"), new Val( 117, 3992546, 10230617, 3992546, "Martelarenlaan"), new Val( 116, 608715590, 10230617, 608715590, "Martelarenlaan"), @@ -1919,20 +1474,16 @@ public void bus601_600_3_Test() { new Val( 72, 350992067, 10230617, 350992067, "Lostraat"), new Val( 71, 351196789, 10230617, 351196789, "Lostraat"), new Val( 70, 40189518, 10230617, 40189518, "Lostraat"), - new Val( 69, 40189518, 10230617, 112917224, "Ganzendries", - "Lostraat - Oude Diestsesteenweg (3)", - "3"), + "Lostraat - Oude Diestsesteenweg (3)"), new Val( 68, 319264895, 112917224, 319264895, "Ganzendries"), new Val( 67, 27682732, 112917224, 27682732, "Sint Barbaradreef"), new Val( 66, 527248228, 112917224, 527248228, null), new Val( 65, 27686451, 112917224, 27686451, null), new Val( 64, 847554912, 112917224, 847554912, null), - new Val( 63, 847554912, 112917224, 27686453, null, - "Sint Barbaradreef - Ganzendries (3)", - "3"), + "Sint Barbaradreef - Ganzendries (3)"), new Val( 62, 110643012, 27686453, 110643012, null), new Val( 61, 112917220, 27686453, 112917220, null), @@ -1940,20 +1491,16 @@ public void bus601_600_3_Test() { new Val( 59, 27682735, 27686453, 27682735, null), new Val( 58, 319269351, 27686453, 319269351, "Sint Barbaradreef"), new Val( 57, 112917225, 27686453, 112917225, "Sint Barbaradreef"), - new Val( 56, 112917225, 27686453, 847554912, null, - "Sint Barbaradreef (3)", - "3"), + "Sint Barbaradreef (3)"), new Val( 55, 27686451, 847554912, 27686451, null), new Val( 54, 527248228, 847554912, 527248228, null), new Val( 53, 27682732, 847554912, 27682732, "Sint Barbaradreef"), new Val( 52, 319264895, 847554912, 319264895, "Ganzendries"), new Val( 51, 112917224, 847554912, 112917224, "Ganzendries"), - new Val( 50, 112917224, 847554912, 16377612, "Kapelstraat", - "Ganzendries - Sint Barbaradreef (3)", - "3"), + "Ganzendries - Sint Barbaradreef (3)"), new Val( 49, 16377722, 16377612, 16377722, "Kapelstraat"), new Val( 48, 636950670, 16377612, 636950670, "Kapelstraat"), @@ -1965,26 +1512,18 @@ public void bus601_600_3_Test() { new Val( 42, 694551612, 16377612, 694551612, "Bollenberg"), new Val( 41, 112917100, 16377612, 112917100, "Bollenberg"), new Val( 40, 81197019, 16377612, 81197019, "Bollenberg"), - new Val( 39, 81197019, 16377612, 125835541, "Dorpskring", - "Bollenberg - Kapelstraat (3)", - "3"), - + "Bollenberg - Kapelstraat (3)"), new Val( 38, 125835541, 125835541, 81083332, "Dorpskring", - "Dorpskring (3;373;485)", - "3;373;485"), + "Dorpskring (3;373;485)"), new Val( 37, 125835543, 81083332, 125835543, "Dorpskring"), - new Val( 36, 125835543, 81083332, 608754701, "Dorpskring", - "Dorpskring (3;373;485)", - "3;373;485"), - + "Dorpskring (3;373;485)"), new Val( 35, 608754701, 608754701, 608754701, "Dorpskring", - "Dorpskring (3;373;485)", - "3;373;485") + "Dorpskring (3;373;485)") ); testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); @@ -1998,38 +1537,28 @@ public void bus601_600_3_Test() { expectedValues = Arrays.asList( new Val( 213, 13856192, 13856192, 13856192, null), new Val( 212, 100289896, 13856192, 100289896, "Statieplein"), - new Val( 211, 100289896, 13856192, 100289859, "Statieplein", - "Statieplein (310;334;335)", - "310;334;335"), + "Statieplein (310;334;335)"), new Val( 210, 100289892, 100289859, 100289892, "Statieplein"), new Val( 209, 100289852, 100289859, 100289852, "Statieplein"), new Val( 208, 125101590, 100289859, 125101590, "Statieplein"), new Val( 207, 101376793, 100289859, 101376793, "Statiestraat"), new Val( 206, 41405911, 100289859, 41405911, "Statiestraat"), - new Val( 205, 41405911, 100289859, 125101554, "Albertlaan", - "Statiestraat - Statieplein (305;306;306 (student);310;334;335)", - "305;306;306 (student);310;334;335"), - + "Statiestraat - Statieplein (305;306;310;334;335)"), new Val( 204, 125101554, 125101554, 13892080, "Albertlaan", - "Albertlaan (305;306;306 (student);310;334;335;513)", - "305;306;306 (student);310;334;335;513"), + "Albertlaan (305;306;310;334;335;513)"), new Val( 203, 412810122, 13892080, 412810122, "Leuvensesteenweg"), new Val( 202, 125101584, 13892080, 125101584, "Leuvensesteenweg"), - new Val( 201, 125101584, 13892080, 188863432, "Leuvensesteenweg", - "Leuvensesteenweg - Albertlaan (310;334;335;513)", - "310;334;335;513"), + "Leuvensesteenweg - Albertlaan (310;334;335;513)"), new Val( 200, 125101583, 188863432, 125101583, "Leuvensesteenweg"), - new Val( 199, 125101583, 188863432, 345152127, "Steenweg op Sint-Joris-Winge", - "Leuvensesteenweg (305;306;306 (student);310;334;335;513)", - "305;306;306 (student);310;334;335;513"), + "Leuvensesteenweg (305;306;310;334;335;513)"), new Val( 198, 412810127, 345152127, 412810127, "Steenweg op Sint-Joris-Winge"), new Val( 197, 345152132, 345152127, 345152132, "Steenweg op Sint-Joris-Winge"), @@ -2054,10 +1583,8 @@ public void bus601_600_3_Test() { new Val( 178, 22870199, 345152127, 22870199, "Rijksweg"), new Val( 177, 345078875, 345152127, 345078875, "Rijksweg"), new Val( 176, 13856508, 345152127, 13856508, "Rijksweg Aarschot-Winge"), - new Val( 175, 13856508, 345152127, 345078877, "Rijksweg", - "Rijksweg Aarschot-Winge - Steenweg op Sint-Joris-Winge (305;306;306 (student);310)", - "305;306;306 (student);310"), + "Rijksweg Aarschot-Winge - Steenweg op Sint-Joris-Winge (305;306;310)"), new Val( 174, 345078878, 345078877, 345078878, "Rijksweg"), new Val( 173, 38208830, 345078877, 38208830, "Rijksweg"), @@ -2112,29 +1639,21 @@ public void bus601_600_3_Test() { new Val( 124, 450119553, 345078877, 450119553, "Kortrijksebaan"), new Val( 123, 181347873, 345078877, 181347873, "Nobelberg"), new Val( 122, 16302925, 345078877, 16302925, "Nobelberg"), - new Val( 121, 16302925, 345078877, 64487963, "Rotselaarsebaan", - "Nobelberg - Rijksweg (310)", - "310"), + "Nobelberg - Rijksweg (310)"), new Val( 120, 310435233, 64487963, 310435233, "Rotselaarsebaan"), - new Val( 119, 310435233, 64487963, 112566004, "Sint-Maurusstraat", - "Rotselaarsebaan (310)", - "310"), + "Rotselaarsebaan (310)"), new Val( 118, 16302928, 112566004, 16302928, null), new Val( 117, 25667798, 112566004, 25667798, "Rotselaarsebaan"), - new Val( 116, 25667798, 112566004, 310435233, "Rotselaarsebaan", - "Rotselaarsebaan - Sint-Maurusstraat (310)", - "310"), + "Rotselaarsebaan - Sint-Maurusstraat (310)"), new Val( 115, 64487963, 310435233, 64487963, "Rotselaarsebaan"), - new Val( 114, 64487963, 310435233, 310435232, "Nobelberg", - "Rotselaarsebaan (310)", - "310"), + "Rotselaarsebaan (310)"), new Val( 113, 19166179, 310435232, 19166179, "Nobelberg"), new Val( 112, 492765776, 310435232, 492765776, "Nobelberg"), @@ -2160,19 +1679,15 @@ public void bus601_600_3_Test() { new Val( 92, 192559637, 310435232, 192559637, "Wilselsesteenweg"), new Val( 91, 114935420, 310435232, 114935420, "Wilselsesteenweg"), new Val( 90, 243884410, 310435232, 243884410, "Wilselsesteenweg"), - new Val( 89, 243884410, 310435232, 98645243, "Wilselsesteenweg", - "Wilselsesteenweg - Nobelberg (310)", - "310"), + "Wilselsesteenweg - Nobelberg (310)"), new Val( 88, 98645223, 98645243, 98645223, "Wilselsesteenweg"), new Val( 87, 38209648, 98645243, 38209648, "Wilselsesteenweg"), new Val( 86, 125835556, 98645243, 125835556, "Kesseldallaan"), new Val( 85, 112566013, 98645243, 112566013, "Kesseldallaan"), - new Val( 84, 112566013, 98645243, 112566017, "Kesseldallaan", - "Kesseldallaan - Wilselsesteenweg (2;310)", - "2;310"), + "Kesseldallaan - Wilselsesteenweg (2;310)"), new Val( 83, 112566021, 112566017, 112566021, "Kesseldallaan"), new Val( 82, 440732696, 112566017, 440732696, "Kesseldallaan"), @@ -2182,15 +1697,11 @@ public void bus601_600_3_Test() { new Val( 78, 112566011, 112566017, 112566011, "Kesseldallaan"), new Val( 77, 112565986, 112566017, 112565986, "Kesseldallaan"), new Val( 76, 242622340, 112566017, 242622340, "Kesseldallaan"), - new Val( 75, 242622340, 112566017, 33233154, "Kesseldallaan", - "Kesseldallaan (2;179;306;306 (student);310;433)", - "2;179;306;306 (student);310;433"), - + "Kesseldallaan (2;179;306;310;433)"), new Val( 74, 33233154, 33233154, 112566015, "Eénmeilaan", - "Kesseldallaan (2;179;306;306 (student);310;433)", - "2;179;306;306 (student);310;433"), + "Kesseldallaan (2;179;306;310;433)"), new Val( 73, 80284458, 112566015, 80284458, "Eénmeilaan"), new Val( 72, 38245753, 112566015, 38245753, "Eénmeilaan"), @@ -2206,15 +1717,11 @@ public void bus601_600_3_Test() { new Val( 62, 22476095, 112566015, 22476095, "Eénmeilaan"), new Val( 61, 138017381, 112566015, 138017381, "Eénmeilaan"), new Val( 60, 125835547, 112566015, 125835547, "Eénmeilaan"), - new Val( 59, 125835547, 112566015, 79366165, "Baron August de Becker Remyplein", - "Eénmeilaan (179;306;306 (student);310;433)", - "179;306;306 (student);310;433"), - + "Eénmeilaan (179;306;310;433)"), new Val( 58, 79366165, 79366165, 79366167, "Baron August de Becker Remyplein", - "Baron August de Becker Remyplein (2;179;306;306 (student);310;433;520)", - "2;179;306;306 (student);310;433;520"), + "Baron August de Becker Remyplein (2;179;306;310;433;520)"), new Val( 57, 79366164, 79366167, 79366164, "Baron August de Becker Remyplein"), new Val( 56, 35633068, 79366167, 35633068, "Baron August de Becker Remyplein"), @@ -2224,56 +1731,40 @@ public void bus601_600_3_Test() { new Val( 52, 608715603, 79366167, 608715603, "Baron August de Becker Remyplein"), new Val( 51, 429571921, 79366167, 429571921, "Baron August de Becker Remyplein"), new Val( 50, 125835568, 79366167, 125835568, "Leuvensestraat"), - new Val( 49, 125835568, 79366167, 23707244, "Diestsesteenweg", - "Leuvensestraat - Baron August de Becker Remyplein (2;179;306;306 (student);310;433;520)", - "2;179;306;306 (student);310;433;520"), + "Leuvensestraat - Baron August de Becker Remyplein (2;179;306;310;433;520)"), new Val( 48, 12715116, 23707244, 12715116, "Diestsesteenweg"), - new Val( 47, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525)", - "2;3;179;306;306 (student);310;370;371;373;374;433;475;485;520;524;525"), + "Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)"), new Val( 46, 663770966, 61556877, 663770966, "Diestsepoort"), new Val( 45, 584356749, 61556877, 584356749, "Diestsepoort"), new Val( 44, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 43, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", - "2;3;179;305;306;306 (student);310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658"), + "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), new Val( 42, 584356751, 198559166, 584356751, "Diestsepoort"), new Val( 41, 451873773, 198559166, 451873773, "Diestsepoort"), new Val( 40, 584356742, 198559166, 584356742, "Diestsepoort"), new Val( 39, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 38, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - "2;3;179;306 (student);310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658"), + "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), new Val( 37, 79264890, 76867049, 79264890, null), new Val( 36, 79596965, 76867049, 79596965, null), - new Val( 35, 79596965, 76867049, 71754927, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", - "2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630"), - + "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), new Val( 34, 71754927, 71754927, 79264897, null, - "(2;3;310;370;371;373;374;475;485;513;520;524;525)", - "2;3;310;370;371;373;374;475;485;513;520;524;525"), + "(2;310;370;371;373;374;475;485;513;520;524;525)"), new Val( 33, 79596983, 79264897, 79596983, null), - new Val( 32, 79596983, 79264897, 377918665, null, - "(2;3;310)", - "2;3;310"), - + "(2;3;310)"), new Val( 31, 377918665, 377918665, 377918665, null, - "perron 7 & 8 (2;3;310)", - "2;3;310") + "perron 7 & 8 (2;3;310)") ); testPtLine(expectedValues, PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); @@ -2282,67 +1773,41 @@ public void bus601_600_3_Test() { // Line 433 is an express bus // During interactive testing it causes an Index out of bounds exception // for the variant that goes from Tremelo to Leuven - // Line 333 has the same issue, but this one is a bit shorter + // Line 333 has the same issue, but 433 is a bit shorter // *********************************************************** expectedValues = Arrays.asList( new Val( 167, 78579065, 78579065, 78579065, null), new Val( 166, 377814547, 78579065, 377814547, null), - new Val( 165, 377814547, 78579065, 79596986, null, - "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", - "1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658"), - + "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)"), new Val( 164, 79596986, 79596986, 79211473, "Tiensevest", - "(305;306;310;318;358;410;433;475;485;601;658)", - "305;306;310;318;358;410;433;475;485;601;658"), - + "(305;306;310;318;358;410;433;475;485;658)"), new Val( 163, 79211473, 79211473, 79211472, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", - "1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), - + "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;658)"), new Val( 162, 79211472, 79211472, 79175435, "Tiensevest", - "Tiensevest (2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658)", - "2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;616;658"), - + "Tiensevest (1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;658)"), new Val( 161, 79175435, 79175435, 80458208, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)", - "284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658"), - + "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;651;652;658)"), new Val( 160, 80458208, 80458208, 19793164, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658)", - "284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;630;651;652;658"), - + "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;651;652;658)"), new Val( 159, 19793164, 19793164, 4884707, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658)", - "284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;630;651;652;658"), - + "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;651;652;658)"), - new Val( 158, 4884707, 4884707, 116797179, "Diestsepoort", - "Tiensevest (284;285;306;310;315;316;317;395;433;475;485)", - "284;285;306;310;315;316;317;395;433;475;485"), - - - new Val( 157, 116797179, 116797179, 116797180, "Diestsepoort", - "Diestsepoort (306;310;318;410;433)", - "306;310;318;410;433"), - - - new Val( 156, 116797180, 116797180, 451873774, "Diestsepoort", - "Diestsepoort (306;310;318;410;433;475;485)", - "306;310;318;410;433;475;485"), + new Val( 158, 116797179, 4884707, 116797179, "Diestsepoort"), + new Val( 157, 116797180, 4884707, 116797180, "Diestsepoort"), + new Val( 156, 116797180, 4884707, 451873774, "Diestsepoort", + "Diestsepoort - Tiensevest (306;310;433)"), new Val( 155, 584356742, 451873774, 584356742, "Diestsepoort"), - new Val( 154, 584356742, 451873774, 451873773, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)", - "2;3;178;179;306;306 (student);310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525"), + "Diestsepoort (2;3;178;179;306;310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)"), new Val( 153, 584356751, 451873773, 584356751, "Diestsepoort"), new Val( 152, 198559166, 451873773, 198559166, "Diestsepoort"), @@ -2350,17 +1815,13 @@ public void bus601_600_3_Test() { new Val( 150, 584356749, 451873773, 584356749, "Diestsepoort"), new Val( 149, 663770966, 451873773, 663770966, "Diestsepoort"), new Val( 148, 61556877, 451873773, 61556877, "Diestsepoort"), - new Val( 147, 61556877, 451873773, 8109264, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", - "2;3;178;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + "Diestsepoort (2;3;178;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), new Val( 146, 125835524, 8109264, 125835524, "Diestsesteenweg"), new Val( 145, 23707244, 8109264, 23707244, "Diestsesteenweg"), - new Val( 144, 23707244, 8109264, 125835568, "Leuvensestraat", - "Diestsesteenweg - Diestsepoort (2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525)", - "2;3;179;306;306 (student);310;333;370;371;373;374;433;475;485;512;520;524;525"), + "Diestsesteenweg - Diestsepoort (2;3;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), new Val( 143, 429571921, 125835568, 429571921, "Baron August de Becker Remyplein"), new Val( 142, 608715603, 125835568, 608715603, "Baron August de Becker Remyplein"), @@ -2369,10 +1830,8 @@ public void bus601_600_3_Test() { new Val( 139, 608715602, 125835568, 608715602, "Baron August de Becker Remyplein"), new Val( 138, 35633068, 125835568, 35633068, "Baron August de Becker Remyplein"), new Val( 137, 125835500, 125835568, 125835500, "Baron August de Becker Remyplein"), - new Val( 136, 125835500, 125835568, 125835547, "Eénmeilaan", - "Baron August de Becker Remyplein - Leuvensestraat (2;179;306;306 (student);310;333;433;512;520)", - "2;179;306;306 (student);310;333;433;512;520"), + "Baron August de Becker Remyplein - Leuvensestraat (2;179;306;310;333;433;512;520)"), new Val( 135, 138017386, 125835547, 138017386, "Eénmeilaan"), new Val( 134, 138017384, 125835547, 138017384, "Eénmeilaan"), @@ -2385,10 +1844,8 @@ public void bus601_600_3_Test() { new Val( 127, 38245753, 125835547, 38245753, "Eénmeilaan"), new Val( 126, 80284458, 125835547, 80284458, "Eénmeilaan"), new Val( 125, 112566018, 125835547, 112566018, "Eénmeilaan"), - new Val( 124, 112566018, 125835547, 242622344, "Kesseldallaan", - "Eénmeilaan (179;306;306 (student);310;333;433;512)", - "179;306;306 (student);310;333;433;512"), + "Eénmeilaan (179;306;310;333;433;512)"), new Val( 123, 125835557, 242622344, 125835557, "Kesseldallaan"), new Val( 122, 112566011, 242622344, 112566011, "Kesseldallaan"), @@ -2398,37 +1855,27 @@ public void bus601_600_3_Test() { new Val( 118, 440732696, 242622344, 440732696, "Kesseldallaan"), new Val( 117, 13823565, 242622344, 13823565, "Kesseldallaan"), new Val( 116, 112565989, 242622344, 112565989, "Kesseldallaan"), - new Val( 115, 112565989, 242622344, 192559635, "Duchesnelaan", - "Kesseldallaan (2;179;306;306 (student);310;333;433;512)", - "2;179;306;306 (student);310;333;433;512"), + "Kesseldallaan (2;179;306;310;333;433;512)"), new Val( 114, 149117671, 192559635, 149117671, "Duchesnelaan"), new Val( 113, 17540907, 192559635, 17540907, "Vuntcomplex"), new Val( 112, 17540932, 192559635, 17540932, "Vuntcomplex"), new Val( 111, 315666514, 192559635, 315666514, "Vuntcomplex"), - new Val( 110, 315666514, 192559635, 315666515, "Vuntcomplex", - "Vuntcomplex - Duchesnelaan (179;306;306 (student);333;433;512)", - "179;306;306 (student);333;433;512"), - + "Vuntcomplex - Duchesnelaan (179;306;333;433;512)"), new Val( 109, 315666515, 315666515, 345381449, "Vuntcomplex", - "Vuntcomplex (179;306;306 (student);333;433;512)", - "179;306;306 (student);333;433;512"), + "Vuntcomplex (179;306;333;433;512)"), new Val( 108, 225497053, 345381449, 225497053, "Vuntcomplex"), - new Val( 107, 225497053, 345381449, 345381452, "Vuntcomplex", - "Vuntcomplex (179;306;306 (student);333;433;512)", - "179;306;306 (student);333;433;512"), + "Vuntcomplex (179;306;333;433;512)"), new Val( 106, 345381453, 345381452, 345381453, "Vuntcomplex"), new Val( 105, 4004855, 345381452, 4004855, "Vuntcomplex"), - new Val( 104, 4004855, 345381452, 13882237, "Aarschotsesteenweg", - "Vuntcomplex (333;433;512)", - "333;433;512"), + "Vuntcomplex (333;433;512)"), new Val( 103, 351000218, 13882237, 351000218, "Aarschotsesteenweg"), new Val( 102, 440732691, 13882237, 440732691, "Aarschotsesteenweg"), @@ -2437,115 +1884,106 @@ public void bus601_600_3_Test() { new Val( 99, 377918608, 13882237, 377918608, "Aarschotsesteenweg"), new Val( 98, 37713149, 13882237, 37713149, "Aarschotsesteenweg"), new Val( 97, 631979428, 13882237, 631979428, "Aarschotsesteenweg"), - new Val( 96, 345381435, 13882237, 345381435, "Aarschotsesteenweg"), - new Val( 95, 79299306, 13882237, 79299306, "Aarschotsesteenweg"), - - new Val( 94, 79299306, 13882237, 345381434, "Aarschotsesteenweg", - "Aarschotsesteenweg (333;334;335;433;512;513;630)", - "333;334;335;433;512;513;630"), - - new Val( 93, 38159440, 345381434, 38159440, "Aarschotsesteenweg"), - new Val( 92, 780600572, 345381434, 780600572, "Aarschotsesteenweg"), - new Val( 91, 780600573, 345381434, 780600573, "Aarschotsesteenweg"), - new Val( 90, 38159437, 345381434, 38159437, "Aarschotsesteenweg"), - new Val( 89, 16201617, 345381434, 16201617, "Aarschotsesteenweg"), - new Val( 88, 663909831, 345381434, 663909831, "Aarschotsesteenweg"), - new Val( 87, 440732693, 345381434, 440732693, "Aarschotsesteenweg"), - new Val( 86, 439397679, 345381434, 439397679, "Aarschotsesteenweg"), - new Val( 85, 441677446, 345381434, 441677446, "Aarschotsesteenweg"), - new Val( 84, 14099896, 345381434, 14099896, "Aarschotsesteenweg"), - new Val( 83, 14099966, 345381434, 14099966, "Aarschotsesteenweg"), - new Val( 82, 16201055, 345381434, 16201055, "Aarschotsesteenweg"), - - new Val( 81, 16201055, 345381434, 23781189, "Stationsstraat", - "Aarschotsesteenweg (333;334;335;433;512;513)", - "333;334;335;433;512;513"), - - new Val( 80, 663909838, 23781189, 663909838, "Stationsstraat"), - new Val( 79, 98825487, 23781189, 98825487, "Stationsstraat"), - new Val( 78, 23024091, 23781189, 23024091, "Stationsstraat"), - new Val( 77, 23024090, 23781189, 23024090, "Stationsstraat"), - new Val( 76, 15220439, 23781189, 15220439, "Stationsstraat"), - - new Val( 75, 15220439, 23781189, 13899067, "Provinciebaan", - "Stationsstraat (333;335;433;513)", - "333;335;433;513"), - - new Val( 74, 116535756, 13899067, 116535756, "Provinciebaan"), - new Val( 73, 116535766, 13899067, 116535766, "Provinciebaan"), - new Val( 72, 521082436, 13899067, 521082436, "Provinciebaan"), - new Val( 71, 100083559, 13899067, 100083559, "Provinciebaan"), - new Val( 70, 25706275, 13899067, 25706275, "Provinciebaan"), - new Val( 69, 25706276, 13899067, 25706276, "Provinciebaan"), - new Val( 68, 37712785, 13899067, 37712785, "Provinciebaan"), - new Val( 67, 116535777, 13899067, 116535777, "Provinciebaan"), - new Val( 66, 100086271, 13899067, 100086271, "Provinciebaan"), - new Val( 65, 27107407, 13899067, 27107407, "Provinciebaan"), - - new Val( 64, 27107407, 13899067, 24041208, "Provinciebaan", - "Provinciebaan (333;433;512;513)", - "333;433;512;513"), - - new Val( 63, 292670112, 24041208, 292670112, "Nieuwebaan"), - new Val( 62, 292670110, 24041208, 292670110, "Nieuwebaan"), - new Val( 61, 292670113, 24041208, 292670113, "Nieuwebaan"), - new Val( 60, 292670115, 24041208, 292670115, "Nieuwebaan"), - new Val( 59, 292670109, 24041208, 292670109, "Nieuwebaan"), - new Val( 58, 98918943, 24041208, 98918943, "Nieuwebaan"), - new Val( 57, 292820652, 24041208, 292820652, "Nieuwebaan"), - new Val( 56, 13858894, 24041208, 13858894, "Hoekje"), - new Val( 55, 24037032, 24041208, 24037032, "Hoekje"), - new Val( 54, 26591703, 24041208, 26591703, "Werchterplein"), - new Val( 53, 21355673, 24041208, 21355673, "Sint-Jansstraat"), - new Val( 52, 116911351, 24041208, 116911351, "Sint-Jansstraat"), - new Val( 51, 205303321, 24041208, 205303321, "Sint-Jansstraat"), - new Val( 50, 205303322, 24041208, 205303322, "Sint-Jansstraat"), - new Val( 49, 205303320, 24041208, 205303320, "Sint-Jansstraat"), - new Val( 48, 49577807, 24041208, 49577807, "Sint-Jansstraat"), - new Val( 47, 116704290, 24041208, 116704290, "Tremelobaan"), - new Val( 46, 32823731, 24041208, 32823731, "Tremelobaan"), - new Val( 45, 349648271, 24041208, 349648271, "Tremelobaan"), - new Val( 44, 25706363, 24041208, 25706363, "Tremelobaan"), - new Val( 43, 349648272, 24041208, 349648272, "Tremelobaan"), - new Val( 42, 349648273, 24041208, 349648273, "Tremelobaan"), - new Val( 41, 349648270, 24041208, 349648270, "Tremelobaan"), - new Val( 40, 25706405, 24041208, 25706405, "Tremelobaan"), - new Val( 39, 126264637, 24041208, 126264637, "Tremelobaan"), - new Val( 38, 22080651, 24041208, 22080651, "Tremelobaan"), - new Val( 37, 22080665, 24041208, 22080665, "Werchtersebaan"), - new Val( 36, 116911317, 24041208, 116911317, "Werchtersebaan"), - new Val( 35, 116911322, 24041208, 116911322, "Werchtersebaan"), - new Val( 34, 116911310, 24041208, 116911310, "Werchtersebaan"), - new Val( 33, 116911314, 24041208, 116911314, "Werchtersebaan"), - new Val( 32, 106526409, 24041208, 106526409, "Werchtersebaan"), - new Val( 31, 106526391, 24041208, 106526391, "Werchtersebaan"), - new Val( 30, 106526331, 24041208, 106526331, null), - new Val( 29, 79057173, 24041208, 79057173, null), - new Val( 28, 106526457, 24041208, 106526457, null), - new Val( 27, 25706520, 24041208, 25706520, "Schrieksebaan"), - new Val( 26, 244077928, 24041208, 244077928, "Schrieksebaan"), - new Val( 25, 79057162, 24041208, 79057162, "Schrieksebaan"), - new Val( 24, 348402887, 24041208, 348402887, "Schrieksebaan"), - new Val( 23, 116911330, 24041208, 116911330, "Schrieksebaan"), - new Val( 22, 20402695, 24041208, 20402695, "Astridstraat"), - new Val( 21, 26614159, 24041208, 26614159, null), - new Val( 20, 255018560, 24041208, 255018560, null), - new Val( 19, 845727172, 24041208, 845727172, null), - new Val( 18, 255018553, 24041208, 255018553, null), - new Val( 17, 520502050, 24041208, 520502050, null), - - new Val( 16, 520502050, 24041208, 520502050, null, - "Astridstraat - Provinciebaan (333;433)", - "333;433") + new Val( 96, 863731643, 13882237, 863731643, "Aarschotsesteenweg"), + new Val( 95, 345381435, 13882237, 345381435, "Aarschotsesteenweg"), + new Val( 94, 79299306, 13882237, 79299306, "Aarschotsesteenweg"), + new Val( 93, 79299306, 13882237, 345381434, "Aarschotsesteenweg", + "Aarschotsesteenweg (333;334;335;433;512;513;630)"), + + new Val( 92, 38159440, 345381434, 38159440, "Aarschotsesteenweg"), + new Val( 91, 780600572, 345381434, 780600572, "Aarschotsesteenweg"), + new Val( 90, 780600573, 345381434, 780600573, "Aarschotsesteenweg"), + new Val( 89, 38159437, 345381434, 38159437, "Aarschotsesteenweg"), + new Val( 88, 16201617, 345381434, 16201617, "Aarschotsesteenweg"), + new Val( 87, 663909831, 345381434, 663909831, "Aarschotsesteenweg"), + new Val( 86, 440732693, 345381434, 440732693, "Aarschotsesteenweg"), + new Val( 85, 439397679, 345381434, 439397679, "Aarschotsesteenweg"), + new Val( 84, 441677446, 345381434, 441677446, "Aarschotsesteenweg"), + new Val( 83, 14099896, 345381434, 14099896, "Aarschotsesteenweg"), + new Val( 82, 14099966, 345381434, 14099966, "Aarschotsesteenweg"), + new Val( 81, 16201055, 345381434, 16201055, "Aarschotsesteenweg"), + new Val( 80, 16201055, 345381434, 23781189, "Stationsstraat", + "Aarschotsesteenweg (333;334;335;433;512;513)"), + + new Val( 79, 663909838, 23781189, 663909838, "Stationsstraat"), + new Val( 78, 98825487, 23781189, 98825487, "Stationsstraat"), + new Val( 77, 23024091, 23781189, 23024091, "Stationsstraat"), + new Val( 76, 23024090, 23781189, 23024090, "Stationsstraat"), + new Val( 75, 15220439, 23781189, 15220439, "Stationsstraat"), + new Val( 74, 15220439, 23781189, 13899067, "Provinciebaan", + "Stationsstraat (333;335;433;513)"), + + new Val( 73, 116535756, 13899067, 116535756, "Provinciebaan"), + new Val( 72, 116535766, 13899067, 116535766, "Provinciebaan"), + new Val( 71, 521082436, 13899067, 521082436, "Provinciebaan"), + new Val( 70, 100083559, 13899067, 100083559, "Provinciebaan"), + new Val( 69, 25706275, 13899067, 25706275, "Provinciebaan"), + new Val( 68, 25706276, 13899067, 25706276, "Provinciebaan"), + new Val( 67, 37712785, 13899067, 37712785, "Provinciebaan"), + new Val( 66, 116535777, 13899067, 116535777, "Provinciebaan"), + new Val( 65, 100086271, 13899067, 100086271, "Provinciebaan"), + new Val( 64, 100086271, 13899067, 24041208, "Provinciebaan"), + new Val( 63, 100086271, 13899067, 292670112, "Nieuwebaan"), + new Val( 62, 100086271, 13899067, 292670110, "Nieuwebaan"), + new Val( 61, 100086271, 13899067, 292670113, "Nieuwebaan", + "Provinciebaan (333;433;512;513)"), + + new Val( 60, 292670115, 292670113, 292670115, "Nieuwebaan"), + new Val( 59, 292670109, 292670113, 292670109, "Nieuwebaan"), + new Val( 58, 98918943, 292670113, 98918943, "Nieuwebaan"), + new Val( 57, 292820652, 292670113, 292820652, "Nieuwebaan"), + new Val( 56, 13858894, 292670113, 13858894, "Hoekje"), + new Val( 55, 24037032, 292670113, 24037032, "Hoekje"), + new Val( 54, 26591703, 292670113, 26591703, "Werchterplein"), + new Val( 53, 21355673, 292670113, 21355673, "Sint-Jansstraat"), + new Val( 52, 116911351, 292670113, 116911351, "Sint-Jansstraat"), + new Val( 51, 205303321, 292670113, 205303321, "Sint-Jansstraat"), + new Val( 50, 205303322, 292670113, 205303322, "Sint-Jansstraat"), + new Val( 49, 205303320, 292670113, 205303320, "Sint-Jansstraat"), + new Val( 48, 49577807, 292670113, 49577807, "Sint-Jansstraat"), + new Val( 47, 116704290, 292670113, 116704290, "Tremelobaan"), + new Val( 46, 32823731, 292670113, 32823731, "Tremelobaan"), + new Val( 45, 349648271, 292670113, 349648271, "Tremelobaan"), + new Val( 44, 25706363, 292670113, 25706363, "Tremelobaan"), + new Val( 43, 349648272, 292670113, 349648272, "Tremelobaan"), + new Val( 42, 349648273, 292670113, 349648273, "Tremelobaan"), + new Val( 41, 349648270, 292670113, 349648270, "Tremelobaan"), + new Val( 40, 25706405, 292670113, 25706405, "Tremelobaan"), + new Val( 39, 126264637, 292670113, 126264637, "Tremelobaan"), + new Val( 38, 22080651, 292670113, 22080651, "Tremelobaan"), + new Val( 37, 22080665, 292670113, 22080665, "Werchtersebaan"), + new Val( 36, 116911317, 292670113, 116911317, "Werchtersebaan"), + new Val( 35, 116911322, 292670113, 116911322, "Werchtersebaan"), + new Val( 34, 116911310, 292670113, 116911310, "Werchtersebaan"), + new Val( 33, 116911314, 292670113, 116911314, "Werchtersebaan"), + new Val( 32, 106526409, 292670113, 106526409, "Werchtersebaan"), + new Val( 31, 106526391, 292670113, 106526391, "Werchtersebaan"), + new Val( 30, 106526331, 292670113, 106526331, null), + new Val( 29, 79057173, 292670113, 79057173, null), + new Val( 28, 106526457, 292670113, 106526457, null), + new Val( 27, 25706520, 292670113, 25706520, "Schrieksebaan"), + new Val( 26, 244077928, 292670113, 244077928, "Schrieksebaan"), + new Val( 25, 79057162, 292670113, 79057162, "Schrieksebaan"), + new Val( 24, 348402887, 292670113, 348402887, "Schrieksebaan"), + new Val( 23, 116911330, 292670113, 116911330, "Schrieksebaan"), + new Val( 22, 20402695, 292670113, 20402695, "Astridstraat"), + new Val( 21, 26614159, 292670113, 26614159, null), + new Val( 20, 255018560, 292670113, 255018560, null), + new Val( 19, 845727172, 292670113, 845727172, null), + new Val( 18, 255018553, 292670113, 255018553, null), + new Val( 17, 520502050, 292670113, 520502050, null), + + new Val( 16, 520502050, 292670113, 520502050, null, + "Astridstraat - Nieuwebaan (333;433)") ); testPtLine(expectedValues, PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); -// printListOfExpectedValues(5451452); +// printListOfExpectedValues(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); } - public void testPtLine(List expectedValues, final Relation busRouteRelation) { + public void testPtLine(List expectedValues, Relation busRouteRelation) { assertNotNull(busRouteRelation); @@ -2568,8 +2006,8 @@ public void testPtLine(List expectedValues, final Relation busRouteRelation for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, clonedRelation, v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, - null, v.expectedRouteRef); + extractAndAssertValues(v.index, previousSegment, segment, clonedRelation, + v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, v.note); previousSegment = segment; UndoRedoHandler.getInstance().add(new ChangeCommand(busRouteRelation, clonedRelation)); System.out.printf("% 3d ", busRouteRelation.getMembersCount()); @@ -2579,21 +2017,19 @@ public void testPtLine(List expectedValues, final Relation busRouteRelation UndoRedoHandler.getInstance().add(new ChangeCommand(busRouteRelation, clonedRelation)); System.out.printf("%s\n", busRouteRelation.getMembersCount()); - System.out.print("\n"); + System.out.print("\n\n"); } - public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, + public void extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, Relation superRouteRelation, int firstWayId, int lastWayId, int firstWayIdForNewSegment, - String nameOfNewWay, - String expectedColours, String expectedRouteRef) { + String nameOfNewWay, String expectedNote) { Relation extractedRelation = createdSegment.extractToRelation(Arrays.asList("type", "route"), true); - System.out.println(index + " " + extractedRelation.get("note")); + final String note = extractedRelation.get("note"); + System.out.println(index + " " + note); assertEquals(String.format("%d first way not correct %s%s\n%s%s\n", index, rc, firstWayId, rc, extractedRelation.firstMember().getWay().getId()), firstWayId, extractedRelation.firstMember().getWay().getId()); assertEquals(String.format("%d last way not correct %s%s\n%s%s\n", index, rc, lastWayId, rc, extractedRelation.lastMember().getWay().getId()), lastWayId, extractedRelation.lastMember().getWay().getId()); - if (expectedColours != null) assertEquals(expectedColours, createdSegment.getColoursSignature()); - final String actualRouteRef = createdSegment.getLineIdentifiersSignature(); - assertEquals(expectedRouteRef, actualRouteRef); - assertEquals(expectedRouteRef, extractedRelation.get("route_ref")); + assertEquals(String.format("\nnote differs\n%s%s,way%s", rc, firstWayId, lastWayId), expectedNote, createdSegment.getNote()); + assertEquals(expectedNote, note); // assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); // newSegment should have the last way that was added to this segment @@ -2603,39 +2039,41 @@ public Relation extractAndAssertValues(int index, RouteSegmentToExtract createdS assertEquals(String.format("%d name of last added way not correct %s%s\n ", index, rc, wayId), nameOfNewWay, newSegment.getWayMembers().get(0).getWay().get("name")); assertEquals(String.format("%d id of first way not correct %s%s\n", index, rc, wayId), firstWayIdForNewSegment, wayId); } - return extractedRelation; } /** * This prints a list of known values to be used in unit tests * - * @param relation the route relation + * @param relation route relation */ @SuppressWarnings("unused") - public void printListOfExpectedValues(final Relation relation) { + public void printListOfExpectedValues(Relation relation) { List members = relation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(relation); List wayMembers = segment.getWayMembers(); String listVal = ""; String className = ""; Way way = null; + String wayName = null; + String note = null; int lastIndex = 0; System.out.printf(" %sexpectedValues = Arrays.asList(\n", listVal); for (int i = members.size() - 1; i >= 0; i--) { RelationMember member = members.get(i); if (member.isWay() && RouteUtils.isPTWay(member)) { way = member.getWay(); + wayName = (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"" : "null"; + note = segment.getNote(); RouteSegmentToExtract ns = segment.addPTWayMember(i); wayMembers = segment.getWayMembers(); if (ns != null) { - System.out.printf("\n new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\",\n \"%s\"),\n\n", + System.out.printf(" new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\"),\n\n", i, wayMembers.get(0).getMember().getId(), wayMembers.get(wayMembers.size() - 1).getMember().getId(), (way != null && way.getId() != 0) ? way.getId() : 0, - (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"": null, - segment.getNote(), - segment.getLineIdentifiersSignature() + wayName, + note ); segment = ns; } else { @@ -2644,7 +2082,7 @@ public void printListOfExpectedValues(final Relation relation) { wayMembers.get(0).getMember().getId(), wayMembers.get(wayMembers.size() - 1).getMember().getId(), (way != null && way.getId() != 0) ? way.getId() : 0, - (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"": null + wayName ); } } else { @@ -2652,16 +2090,14 @@ public void printListOfExpectedValues(final Relation relation) { break; } } - System.out.printf("\n new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\",\n \"%s\")\n );\n\n", + System.out.printf("\n new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\")\n );\n\n", lastIndex, (wayMembers != null && wayMembers.size() > 0) ? wayMembers.get(0).getMember().getId() : 0, (wayMembers != null && wayMembers.size() > 1) ? wayMembers.get(wayMembers.size() - 1).getMember().getId() : 0, (way != null && way.getId() != 0) ? way.getId() : 0, - (way != null && way.get("name") != null) ? "\"" + way.get("name") + "\"": null, - segment.getNote(), - segment.getLineIdentifiersSignature() + wayName, + note ); - System.out.printf(" testPtLine(expectedValues, %d);\n", relation.getId()); - System.out.print (" System.out.print(\"\\n\");\n\n"); + System.out.printf(" testPtLine(expectedValues, %d);\n", relation.getId()); } } From 616e9558c43a0f72c8ef1804efcc1927a5d4a018 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Mon, 2 Nov 2020 18:37:22 +0100 Subject: [PATCH 50/52] Reworked the tests. For removing members from a relation, it makes most sense to work backwards. But having the tests from last member to first is confusing. So now it's incrementing and moving forward through the members. This changes much in the logic about when to split, but it's a lot easier to follow. To make this possible, a list of indices to remove and a list of relations to add are and this is done in outside of the main loop. It seems to also solve the index out of bounds issue. It does not solve the problem where it complains when browsing through the elements of a relation that had its members reloaded: ava.lang.IllegalArgumentException: Width and height must be >= 0 --- ...actRelationMembersToNewRelationAction.java | 44 +- .../data/RouteSegmentToExtract.java | 74 +- test/data/buses_before_splitting.osm | 1184 +++++-- .../data/RouteSegmentToExtractTest.java | 2887 ++++++----------- 4 files changed, 2076 insertions(+), 2113 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index 7dd6fd55..d793a517 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -53,11 +53,6 @@ public void actionPerformed(ActionEvent actionEvent) { final MemberTableModel memberTableModel = editorAccess.getMemberTableModel(); IRelationEditor editor = editorAccess.getEditor(); final Relation originalRelation = editor.getRelation(); -// Relation editedRelation = new Relation(originalRelation); -// // save the current state, otherwise accidents happen -// memberTableModel.applyToRelation(editedRelation); -// editorAccess.getTagModel().applyToPrimitive(editedRelation); -// UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, editedRelation)); final Collection selectedMembers = memberTableModel.getSelectedMembers(); @@ -126,6 +121,7 @@ public void actionPerformed(ActionEvent actionEvent) { } Relation extractedRelation = segment.extractToRelation( Arrays.asList("type", "route", "cycle_network", "network", "operator", "ref"), + true, true); if (extractedRelation != null) { if (extractedRelation.isNew() && cbConvertToSuperroute.isSelected()) { @@ -147,16 +143,8 @@ public void actionPerformed(ActionEvent actionEvent) { } } /* - Doing this suppresses the exception to be shown to the user, - something fishy is still happening though. - And the stack trace comes anyway when the user presses - the reload button in the relation editor. - This is annoying, I have no idea how to solve this. - The problem has been there since the beginning. - Oddly there are relations for which it doesn't happen. - It must have something to do with the fact that the member - count is always lower after converting ways to relations - that contain those ways. + This consistently causes an IndexOutOfBounds exception AND + I don't know why. */ try { editor.reloadDataFromRelation(); @@ -167,20 +155,34 @@ public void actionPerformed(ActionEvent actionEvent) { } public void splitInSegments(Relation originalRelation, Boolean convertToSuperroute) { - final Relation clonedRelation = new Relation(originalRelation); - final List members = clonedRelation.getMembers(); - RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); - RouteSegmentToExtract newSegment = null; - for (int i = members.size() - 1; i >= 0; i--) { + ArrayList segmentRelationsList = new ArrayList<>(); + ArrayList indicesToRemoveList = new ArrayList<>(); + final List members = originalRelation.getMembers(); + RouteSegmentToExtract segment = new RouteSegmentToExtract(originalRelation); + segment.setActiveDataSet(originalRelation.getDataSet()); + RouteSegmentToExtract newSegment; + for (int i = 0; i < members.size(); i++) { newSegment = segment.addPTWayMember(i); if (newSegment != null) { - segment.extractToRelation(Arrays.asList("type", "route"), true); + Relation extractedRelation = segment.extractToRelation(Arrays.asList("type", "route"), + false, false); + if (extractedRelation != null) { + segmentRelationsList.add(new RelationMember("", extractedRelation)); + } segment = newSegment; } + if (i < originalRelation.getMembersCount() && RouteUtils.isPTWay(originalRelation.getMembers().get(i))) { + indicesToRemoveList.add(0, i); + } } + final Relation clonedRelation = new Relation(originalRelation); if (convertToSuperroute) { clonedRelation.put("type", "superroute"); } + for (Integer integer : indicesToRemoveList) { + clonedRelation.removeMember(integer); + } + segmentRelationsList.forEach(clonedRelation::addMember); UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); } /** This method modifies clonedRelation in place if substituteWaysWithRelation is true diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index b90dd154..370dfdb6 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -174,9 +174,9 @@ private void addWay(Integer index, boolean updateIndices) { final RelationMember member = relation.getMember(index); if (member.isWay()) { if (updateIndices) { - indices.add(0, index); + indices.add(index); } - wayMembers.add(0, member); + wayMembers.add(member); streetNames = null; wayIds = null; } @@ -184,16 +184,14 @@ private void addWay(Integer index, boolean updateIndices) { public RouteSegmentToExtract addPTWayMember(Integer index) { assert relation != null; - if (index < 1) { - return this; // make sure all segments are processed in route relations without stop members - } WaySequence ws = new WaySequence(relation, index); - if (ws.currentWay == null && ws.nextWay != null) { - return this; // make sure all segments are processed for route relations when stop members are reached - } if (ws.currentWay == null || ws.hasGap) { return null; } + if (getLastWay(relation).equals(ws.currentWay)) { + addWay(index); + return this; + } if (this.itinerariesInSameDirection == null) { TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(ws); @@ -212,7 +210,11 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { boolean startNewSegmentInNewSegment = false; List segmentRelations = Utils.filteredCollection(ws.currentWay.getReferrers(), Relation.class).stream() - .filter(r -> "route".equals(r.get("type")) && "bus".equals(r.get("route")) && r.hasKey("note")) + .filter(r -> !r.hasKey("name") + && RouteUtils.isPTRoute(r) + && r.hasKey("note") +// && r.get("note").matches(".*\\([\\d;]+\\)") + ) .collect(Collectors.toList()); List parentRouteRelations = Utils.filteredCollection(ws.currentWay.getReferrers(), Relation.class).stream() @@ -222,12 +224,11 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { RouteSegmentToExtract existingSegment = new RouteSegmentToExtract(sr, false); if (existingSegment.isLastWay(ws.currentWay)) { final int existingSegmentSize = existingSegment.getWayMembers().size(); - if (existingSegmentSize < 2) break; final int startIndexOfRange = index - existingSegmentSize + 1; if (startIndexOfRange > 0) { List sl = relation.getMembers().subList(startIndexOfRange, index + 1); - if (sl.equals(existingSegment.getWayMembers())) { - startNewSegment = true; + if (sl.equals(existingSegment.getWayMembers()) && existingSegmentSize > 1) { + startNewSegmentInNewSegment = true; } } } @@ -238,27 +239,20 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { TreeSet itinerariesInSameDirection = getItinerariesInSameDirection(ws, parentRouteRelations); - if (this.itinerariesInSameDirection != null - && itinerariesInSameDirection.size() != 0 - && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection) - && !(isFirstWay(ws.currentWay) && getMembershipCount(ws.currentWay, relation) < 2) - ) { + if (isDifferentBundleOfItinerariesAndNotFirstWayOrMultipleOccurrences(itinerariesInSameDirection)) { startNewSegment = true; } else { - this.itinerariesInSameDirection = itinerariesInSameDirection; + if (!this.itinerariesInSameDirection.equals(itinerariesInSameDirection)) { + this.itinerariesInSameDirection = itinerariesInSameDirection; + } for (Relation parentRoute : itinerariesInSameDirection) { + final Optional commonNode1 = WayUtils.findFirstCommonNode(ws.previousWay, ws.currentWay); final Optional commonNode2 = WayUtils.findFirstCommonNode(ws.currentWay, ws.nextWay); - final long membershipCountOfWayInSameDirectionInParentRoute = - getMembershipCountOfWayInSameDirection(ws.currentWay, parentRoute); - if (ws.currentWay == getLastWay(parentRoute) - || membershipCountOfWayInSameDirectionInParentRoute > 1 - && !parentRoute.equals(relation) - && (commonNode2.map(it -> it.getParentWays().size() > 2).orElse(false)) - ) { + if (!parentRoute.equals(relation) && (ws.currentWay == getLastWay(parentRoute) + || getMembershipCountOfWayInSameDirection(ws.currentWay, parentRoute) > 1 + || getMembershipCountOfWayInSameDirection(ws.previousWay, parentRoute) > 1 + && (commonNode1.map(it -> it.getParentWays().size() > 2).orElse(false)))) { startNewSegment = true; - if (membershipCountOfWayInSameDirectionInParentRoute > 1) { - startNewSegmentInNewSegment = true; - } break; } // Some PT lines have variants that make a 'spoon like loop' @@ -298,16 +292,18 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { return null; } - /** - * @return The first way of the relation that is being processed - */ - public boolean isFirstWay(Way way) { - return wayMembers.get(0).getWay().equals(way); + private boolean isDifferentBundleOfItinerariesAndNotFirstWayOrMultipleOccurrences(TreeSet itinerariesInSameDirection) { + if (this.itinerariesInSameDirection == null) { + this.itinerariesInSameDirection = itinerariesInSameDirection; + } + return itinerariesInSameDirection != null + && itinerariesInSameDirection.size() != 0 + && !itinerariesInSameDirection.equals(this.itinerariesInSameDirection); } /** * @param way to compare - * @return is this the last way of the relation that is being processed + * @return is this the last way in our list of wayMembers? */ public boolean isLastWay(Way way) { return wayMembers.get(wayMembers.size() - 1).getWay().equals(way); @@ -495,6 +491,7 @@ private static List findPreviousAndNextWayInRoute(List highway return waySequences; } + @SuppressWarnings("unused") public List getWayIds() { if (wayIds == null) { wayIds = new ArrayList<>(); @@ -639,7 +636,7 @@ public List getIndices() { * @param substituteWaysWithRelation add the extracted relation where the ways were removed? * @return the relation that contains the extracted ways, or null if an empty relation would have been created */ - public Relation extractToRelation(List tagsToTransfer, Boolean substituteWaysWithRelation) { + public Relation extractToRelation(List tagsToTransfer, Boolean removeWaysFromRelation , Boolean substituteWaysWithRelation) { assert relation != null; boolean extractedRelationAlreadyExists = false; if (ptSegments.containsKey(getWayIdsSignature())) { @@ -657,7 +654,12 @@ public Relation extractToRelation(List tagsToTransfer, Boolean substitut int index = 0; for (int i = indices.size() - 1; i >= 0; i--) { index = indices.get(i); - RelationMember relationMember = relation.removeMember(index); + RelationMember relationMember; + if (removeWaysFromRelation) { + relationMember = relation.removeMember(index); + } else { + relationMember = relation.getMember(index); + } if (!extractedRelationAlreadyExists && isPTWay(relationMember)) { extractedRelation.addMember(0, new RelationMember("", relationMember.getMember())); diff --git a/test/data/buses_before_splitting.osm b/test/data/buses_before_splitting.osm index 821ba7ac..ac0ef068 100644 --- a/test/data/buses_before_splitting.osm +++ b/test/data/buses_before_splitting.osm @@ -249,6 +249,7 @@ + @@ -333,6 +334,7 @@ + @@ -340,6 +342,7 @@ + @@ -350,6 +353,12 @@ + + + + + + @@ -450,9 +459,15 @@ + + + + + + @@ -588,9 +603,13 @@ + + + + @@ -2725,6 +2744,7 @@ + @@ -2853,6 +2873,7 @@ + @@ -3257,6 +3278,7 @@ + @@ -5147,8 +5169,14 @@ + + + + + + @@ -6280,6 +6308,9 @@ + + + @@ -7084,6 +7115,7 @@ + @@ -8359,7 +8391,6 @@ - @@ -8499,7 +8530,6 @@ - @@ -8518,7 +8548,6 @@ - @@ -8571,8 +8600,6 @@ - - @@ -8708,6 +8735,7 @@ + @@ -9700,6 +9728,10 @@ + + + + @@ -10715,6 +10747,7 @@ + @@ -10723,12 +10756,16 @@ + + + + @@ -10945,6 +10982,7 @@ + @@ -12361,6 +12399,15 @@ + + + + + + + + + @@ -12377,11 +12424,28 @@ + + + + + + + + + + + + + + + + + @@ -12715,7 +12779,6 @@ - @@ -12723,8 +12786,6 @@ - - @@ -14398,7 +14459,7 @@ - + @@ -14727,6 +14788,7 @@ + @@ -15585,9 +15647,17 @@ + + + + + + + + @@ -16604,13 +16674,18 @@ + + + + + @@ -16652,6 +16727,7 @@ + @@ -16676,8 +16752,10 @@ + + @@ -16858,7 +16936,6 @@ - @@ -16877,6 +16954,10 @@ + + + + @@ -17725,7 +17806,10 @@ + + + @@ -17836,6 +17920,7 @@ + @@ -18001,8 +18086,10 @@ + + @@ -18040,6 +18127,11 @@ + + + + + @@ -18375,6 +18467,8 @@ + + @@ -18581,6 +18675,8 @@ + + @@ -18592,6 +18688,12 @@ + + + + + + @@ -18666,6 +18768,7 @@ + @@ -18680,6 +18783,7 @@ + @@ -19341,50 +19445,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -19395,9 +19468,6 @@ - - - @@ -19742,6 +19812,9 @@ + + + @@ -20013,6 +20086,7 @@ + @@ -20027,7 +20101,9 @@ + + @@ -20096,6 +20172,9 @@ + + + @@ -21524,6 +21603,24 @@ + + + + + + + + + + + + + + + + + + @@ -21923,6 +22020,25 @@ + + + + + + + + + + + + + + + + + + + @@ -21970,7 +22086,7 @@ - + @@ -21981,7 +22097,7 @@ - + @@ -22138,6 +22254,18 @@ + + + + + + + + + + + + @@ -22179,6 +22307,23 @@ + + + + + + + + + + + + + + + + + @@ -22764,6 +22909,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -22847,6 +23028,20 @@ + + + + + + + + + + + + + + @@ -22981,6 +23176,20 @@ + + + + + + + + + + + + + + @@ -23056,6 +23265,19 @@ + + + + + + + + + + + + + @@ -23261,6 +23483,22 @@ + + + + + + + + + + + + + + + + @@ -23854,7 +24092,7 @@ - + @@ -23864,7 +24102,7 @@ - + @@ -24631,7 +24869,7 @@ - + @@ -24640,10 +24878,11 @@ + - + @@ -24651,10 +24890,11 @@ + - + @@ -24662,6 +24902,7 @@ + @@ -24683,7 +24924,7 @@ - + @@ -24693,26 +24934,27 @@ + - + - + - + - + @@ -24883,6 +25125,20 @@ + + + + + + + + + + + + + + @@ -25527,6 +25783,19 @@ + + + + + + + + + + + + + @@ -25829,6 +26098,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26504,6 +26808,20 @@ + + + + + + + + + + + + + + @@ -27366,6 +27684,15 @@ + + + + + + + + + @@ -30145,6 +30472,23 @@ + + + + + + + + + + + + + + + + + @@ -30157,6 +30501,24 @@ + + + + + + + + + + + + + + + + + + @@ -30219,6 +30581,20 @@ + + + + + + + + + + + + + + @@ -30824,34 +31200,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -30959,46 +31307,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -31084,7 +31392,7 @@ - + @@ -31094,7 +31402,7 @@ - + @@ -31255,7 +31563,7 @@ - + @@ -31269,10 +31577,11 @@ + - + @@ -31281,7 +31590,7 @@ - + @@ -31685,10 +31994,6 @@ - - - - @@ -31850,13 +32155,14 @@ - + + @@ -32253,21 +32559,6 @@ - - - - - - - - - - - - - - - @@ -32498,6 +32789,18 @@ + + + + + + + + + + + + @@ -32805,6 +33108,25 @@ + + + + + + + + + + + + + + + + + + + @@ -32813,6 +33135,19 @@ + + + + + + + + + + + + + @@ -33664,6 +33999,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33904,6 +34266,18 @@ + + + + + + + + + + + + @@ -34024,6 +34398,16 @@ + + + + + + + + + + @@ -34313,7 +34697,7 @@ - + @@ -34321,6 +34705,7 @@ + @@ -34670,6 +35055,21 @@ + + + + + + + + + + + + + + + @@ -34887,13 +35287,13 @@ - + - + @@ -37092,6 +37492,14 @@ + + + + + + + + @@ -37105,6 +37513,17 @@ + + + + + + + + + + + @@ -38423,12 +38842,13 @@ - + + @@ -39530,6 +39950,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -41181,7 +41644,7 @@ - + @@ -41189,7 +41652,7 @@ - + @@ -41327,6 +41790,22 @@ + + + + + + + + + + + + + + + + @@ -41492,6 +41971,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -41503,6 +42008,19 @@ + + + + + + + + + + + + + @@ -43523,27 +44041,29 @@ - + + - + + - + @@ -43551,6 +44071,7 @@ + @@ -43588,13 +44109,14 @@ - + + @@ -44332,13 +44854,14 @@ - + + @@ -46703,13 +47226,14 @@ - + + @@ -46735,25 +47259,6 @@ - - - - - - - - - - - - - - - - - - - @@ -48433,6 +48938,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -48485,6 +49018,22 @@ + + + + + + + + + + + + + + + + @@ -49022,6 +49571,21 @@ + + + + + + + + + + + + + + + @@ -52620,6 +53184,20 @@ + + + + + + + + + + + + + + @@ -52853,6 +53431,13 @@ + + + + + + + @@ -54165,7 +54750,6 @@ - @@ -54659,7 +55243,7 @@ - + @@ -54677,7 +55261,6 @@ - @@ -54886,7 +55469,7 @@ - + @@ -54904,7 +55487,6 @@ - @@ -55144,13 +55726,12 @@ - + - @@ -61759,7 +62340,7 @@ - + @@ -61824,7 +62405,6 @@ - @@ -64798,10 +65378,15 @@ + + + + + @@ -65328,7 +65913,7 @@ - + @@ -65346,7 +65931,6 @@ - @@ -66435,13 +67019,12 @@ - + - @@ -67054,13 +67637,12 @@ - + - @@ -67318,7 +67900,7 @@ - + @@ -67377,7 +67959,6 @@ - @@ -68274,7 +68855,6 @@ - @@ -68910,13 +69490,12 @@ - + - @@ -69184,13 +69763,12 @@ - + - @@ -73439,6 +74017,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -73797,6 +74403,13 @@ + + + + + + + @@ -79162,13 +79775,12 @@ - + - @@ -79468,13 +80080,12 @@ - + - @@ -79993,7 +80604,7 @@ - + @@ -80048,7 +80659,6 @@ - @@ -80917,11 +81527,10 @@ - + - @@ -81211,7 +81820,7 @@ - + @@ -81258,7 +81867,6 @@ - @@ -81511,7 +82119,7 @@ - + @@ -81553,7 +82161,6 @@ - @@ -81807,7 +82414,7 @@ - + @@ -81864,7 +82471,6 @@ - @@ -83032,6 +83638,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84060,6 +84709,13 @@ + + + + + + + @@ -85039,7 +85695,15 @@ - + + + + + + + + + @@ -85055,7 +85719,6 @@ - @@ -88779,14 +89442,13 @@ - + - @@ -90205,13 +90867,12 @@ - + - @@ -90477,13 +91138,12 @@ - + - @@ -92335,7 +92995,7 @@ - + @@ -92345,7 +93005,6 @@ - @@ -92820,7 +93479,7 @@ - + @@ -92830,7 +93489,6 @@ - @@ -93742,7 +94400,7 @@ - + @@ -93793,7 +94451,6 @@ - @@ -94010,7 +94667,7 @@ - + @@ -94028,7 +94685,6 @@ - @@ -94268,7 +94924,7 @@ - + @@ -94286,7 +94942,6 @@ - @@ -94778,13 +95433,12 @@ - + - @@ -102120,6 +102774,13 @@ + + + + + + + @@ -102528,6 +103189,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -103535,8 +104231,8 @@ + - @@ -103693,4 +104389,18 @@ + + + + + + + + + + + + + + diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 5367b95f..1047fdd1 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -8,9 +8,11 @@ import static org.openstreetmap.josm.io.OsmReader.parseDataSet; import java.io.FileInputStream; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Locale; import org.junit.Test; import org.openstreetmap.josm.command.ChangeCommand; @@ -35,8 +37,8 @@ class Val { int iDOfLastWay; String note = null; - public Val(int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, - String nameOfNextWay, String note) { + public Val(String note, int index, int iDOfFirstWay, int iDOfLastWay, int iDOfNextWay, + String nameOfNextWay) { this.index = index; this.nameOfNextWay = nameOfNextWay; this.iDOfFirstWay = iDOfFirstWay; @@ -70,15 +72,11 @@ private static DataSet loadDataSet(final String path) { private static final Relation PT_ROUTE_BUS_358 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(6695469, OsmPrimitiveType.RELATION); private static final Relation PT_ROUTE_BUS_371 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(1606056, OsmPrimitiveType.RELATION); - private static final Relation PT_ROUTE_BUS_600 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(955908, OsmPrimitiveType.RELATION); - private static final Relation PT_ROUTE_BUS_601 = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3612781, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_600_TO_LEUVEN_VAARTKOM = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(955908, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_601_TO_LEUVEN_STATION = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3612781, OsmPrimitiveType.RELATION); - private static final Relation PT_ROUTE_BUS_3_TO_LUBBEEK_KERK = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3297543, OsmPrimitiveType.RELATION); - private static final Relation PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(2815, OsmPrimitiveType.RELATION); - private static final Relation PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(1583303, OsmPrimitiveType.RELATION); - - private static final Relation PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3297278, OsmPrimitiveType.RELATION); - private static final Relation PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(5451452, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_310_TO_AARSCHOT_STATION = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(3297278, OsmPrimitiveType.RELATION); + private static final Relation PT_ROUTE_BUS_433_TO_LEUVEN_STATION = (Relation) DATASET_BUSES_BEFORE_SPLITTING.getPrimitiveById(5451452, OsmPrimitiveType.RELATION); private static final Relation BICYCLE_ROUTE_F75 = (Relation) DATASET_F74_F75.getPrimitiveById(11021011, OsmPrimitiveType.RELATION); @@ -87,9 +85,9 @@ private static DataSet loadDataSet(final String path) { @Test public void isItineraryInSameDirectionTest() { WaySequence waysInParentRouteOf601 = new WaySequence( - PT_ROUTE_BUS_601.getMembers().get(156).getWay(), - PT_ROUTE_BUS_601.getMembers().get(157).getWay(), - PT_ROUTE_BUS_601.getMembers().get(158).getWay()); + PT_ROUTE_BUS_601_TO_LEUVEN_STATION.getMembers().get(156).getWay(), + PT_ROUTE_BUS_601_TO_LEUVEN_STATION.getMembers().get(157).getWay(), + PT_ROUTE_BUS_601_TO_LEUVEN_STATION.getMembers().get(158).getWay()); WaySequence waysInParentRouteOf358 = new WaySequence( PT_ROUTE_BUS_358.getMembers().get(114).getWay(), @@ -100,7 +98,7 @@ public void isItineraryInSameDirectionTest() { PT_ROUTE_BUS_371.getMembers().get(132).getWay(), PT_ROUTE_BUS_371.getMembers().get(133).getWay(), PT_ROUTE_BUS_371.getMembers().get(134).getWay()); - RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(PT_ROUTE_BUS_601); + RouteSegmentToExtract segment601_1 = new RouteSegmentToExtract(PT_ROUTE_BUS_601_TO_LEUVEN_STATION); segment601_1.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); assertTrue(waysInParentRouteOf601.compareTraversal(waysInParentRouteOf358)); assertFalse(waysInParentRouteOf601.compareTraversal(waysInParentRouteOf371)); @@ -183,7 +181,7 @@ public void f74_F75_Test() { s1.put("state", "proposed"); assertEquals(3, s1.getWayMembers().size()); - Relation rel1 = s1.extractToRelation(Arrays.asList("type", "route"), true); + Relation rel1 = s1.extractToRelation(Arrays.asList("type", "route"), true, true); assertEquals(28, BICYCLE_ROUTE_F75.getMembersCount()); assertEquals("proposed", rel1.get("state")); } @@ -192,1341 +190,574 @@ public void f74_F75_Test() { public void bus601_600_3_Test() { List expectedValues; - expectedValues = Arrays.asList( - new Val( 163, 78579065, 78579065, 78579065, null), - new Val( 162, 377814547, 78579065, 377814547, null), - new Val( 161, 377814547, 78579065, 79596986, null, - "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)"), + expectedValues = Arrays.asList( + new Val( 14, 338057820, 338057820, 338057820, "Engels Plein"), + new Val( 15, 338057820, 3869812, 3869812, "Engels Plein"), + new Val( 16, 338057820, 25928482, 25928482, "Wolvengang"), + new Val( 17, 338057820, 659297690, 659297690, "Wolvengang"), + new Val( 18, 338057820, 330300723, 330300723, "Achter de latten"), + new Val( 19, 338057820, 3869822, 3869822, "Burchtstraat"), + new Val( 20, 338057820, 330300725, 330300725, "Havenkant"), + new Val( 21, 338057820, 270181176, 270181176, "Havenkant"), + new Val( 22, 338057820, 406205781, 406205781, "Havenkant"), + new Val( 23, 338057820, 843534478, 843534478, "Havenkant"), + new Val( 24, 338057820, 314635787, 314635787, "Havenkant"), + new Val( 25, 338057820, 510790348, 510790348, "Havenkant"), + new Val( 26, 338057820, 510790349, 510790349, "Havenkant"), + new Val("Engels Plein - Havenkant (601)", + + 27, 338057820, 510790349, 3992548, "Zoutstraat"), + new Val("Zoutstraat (334;335;513;601;630)", + + 28, 3992548, 3992548, 254800931, "Joanna-Maria Artoisplein"), + new Val("Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", + + 29, 254800931, 254800931, 8133608, "Diestsevest"), + new Val( 30, 8133608, 4003924, 4003924, "Diestsevest"), + new Val( 31, 8133608, 81457878, 81457878, "Diestsevest"), + new Val( 32, 8133608, 6184898, 6184898, "Diestsevest"), + new Val("Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", + + 33, 8133608, 6184898, 19793164, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)", + + 34, 19793164, 19793164, 19793394, null), + new Val("(334;335;513;601)", + + 35, 19793394, 19793394, 79193579, "Tiensevest"), + new Val("Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;600;601;616;630;658)", + + 36, 79193579, 79193579, 78568409, "Tiensevest"), + new Val("Tiensevest (4;5;6;7;8;9;18;179;284;285;315;316;317;334;335;337;380;601;616;658)", + + 37, 78568409, 78568409, 79264891, null), + new Val("perron 13 (18;601)", + + 38, 79264891, 79264891, 377918638, null), + new Val("perron 13 (18;601)", + + 39, 377918638, 377918638, 71754927, null), + new Val( 40, 71754927, 79264897, 79264897, null), + new Val("(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525;601)", + + 41, 71754927, 79264897, 79264888, null), + new Val("(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;525;601)", + + 42, 79264888, 79264888, 377918635, null), + new Val("(3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;601)", + + 43, 377918635, 377918635, 79264899, null), + new Val("(4;5;6;18;178;179;333;334;335;337;370;371;373;374;380;512;601;630)", + + 44, 79264899, 79264899, 78815533, null), + new Val( 45, 78815533, 459446600, 459446600, "Martelarenplein"), + new Val( 46, 78815533, 459446598, 459446598, "Martelarenplein"), + new Val( 47, 78815533, 76856823, 76856823, "Martelarenplein"), + new Val("Martelarenplein (4;5;6;7;8;9;18;178;179;337;380;527;601;630)", + + 48, 78815533, 76856823, 185988814, "Tiensevest"), + new Val("Tiensevest (1;4;5;6;7;8;9;18;178;179;337;380;527;601;630)", + + 49, 185988814, 185988814, 8590231, "Tiensevest"), + new Val("Tiensevest (7;8;9;18;178;179;337;380;527;601;630)", + + 50, 8590231, 8590231, 12712557, "Tiensevest"), + new Val( 51, 12712557, 8131717, 8131717, "Tiensevest"), + new Val( 52, 12712557, 863272994, 863272994, "Tiensevest"), + new Val( 53, 12712557, 863272993, 863272993, "Tiensevest"), + new Val( 54, 12712557, 863272992, 863272992, "Tiensevest"), + new Val( 55, 12712557, 863272995, 863272995, "Tiensevest"), + new Val( 56, 12712557, 863272991, 863272991, "Tiensevest"), + new Val( 57, 12712557, 16775171, 16775171, "Tiensepoort"), + new Val("Tiensevest - Tiensepoort (7;8;9;18;178;179;337;380;527;601;616;630)", + + 58, 12712557, 16775171, 8130906, "Geldenaaksevest"), + new Val( 59, 8130906, 586268893, 586268893, "Geldenaaksevest"), + new Val( 60, 8130906, 94585453, 94585453, "Geldenaaksevest"), + new Val( 61, 8130906, 521193607, 521193607, "Geldenaaksevest"), + new Val( 62, 8130906, 10296368, 10296368, "Geldenaaksevest"), + new Val( 63, 8130906, 79299303, 79299303, "Geldenaaksevest"), + new Val("Geldenaaksevest (18;178;179;337;601;616;630)", + + 64, 8130906, 79299303, 608715606, "Geldenaaksevest"), + new Val( 65, 608715606, 608715605, 608715605, "Geldenaaksevest"), + new Val( 66, 608715606, 24905257, 24905257, "Geldenaaksevest"), + new Val( 67, 608715606, 3677823, 3677823, "Naamsevest"), + new Val( 68, 608715606, 655251292, 655251292, "Naamsevest"), + new Val( 69, 608715606, 661733369, 661733369, "Naamsevest"), + new Val( 70, 608715606, 131571763, 131571763, "Naamsevest"), + new Val( 71, 608715606, 655251293, 655251293, "Naamsevest"), + new Val( 72, 608715606, 86164005, 86164005, "Naamsevest"), + new Val("Geldenaaksevest - Naamsevest (18;178;179;337;601;616)", + + 73, 608715606, 86164005, 3677330, "Tervuursevest"), + new Val( 74, 3677330, 608715562, 608715562, "Tervuursevest"), + new Val( 75, 3677330, 608715561, 608715561, "Tervuursevest"), + new Val( 76, 3677330, 23237287, 23237287, "Tervuursevest"), + new Val( 77, 3677330, 90168773, 90168773, "Tervuursevest"), + new Val( 78, 3677330, 23237288, 23237288, "Tervuursevest"), + new Val( 79, 3677330, 31474001, 31474001, "Tervuursevest"), + new Val( 80, 3677330, 3677335, 3677335, "Tervuursevest"), + new Val( 81, 3677330, 461159367, 461159367, "Tervuursevest"), + new Val( 82, 3677330, 344507822, 344507822, "Tervuursevest"), + new Val( 83, 3677330, 461159362, 461159362, "Tervuursevest"), + new Val("Tervuursevest (178;179;520;524;525;537;601)", + + 84, 3677330, 461159362, 461159345, "Tervuursevest"), + new Val("Tervuursevest (178;179;601)", + + 85, 461159345, 461159345, 88361317, "Tervuursevest"), + new Val( 86, 88361317, 429706866, 429706866, "Tervuursevest"), + new Val( 87, 88361317, 174338459, 174338459, "Tervuursevest"), + new Val( 88, 88361317, 3677944, 3677944, "Tervuursevest"), + new Val( 89, 88361317, 608715521, 608715521, "Tervuursevest"), + new Val( 90, 88361317, 608715520, 608715520, "Tervuursevest"), + new Val( 91, 88361317, 174338458, 174338458, "Tervuursevest"), + new Val( 92, 88361317, 813979465, 813979465, "Tervuursevest"), + new Val( 93, 88361317, 521193380, 521193380, "Tervuursevest"), + new Val( 94, 88361317, 521193379, 521193379, "Tervuursevest"), + new Val( 95, 88361317, 99583853, 99583853, "Tervuursevest"), + new Val("Tervuursevest (601)", + + 96, 88361317, 99583853, 429706864, "Rennes-Singel"), + new Val("Tervuursevest - Rennes-Singel (601)", + + 97, 88361317, 429706864, 8131120, "Rennes-Singel"), + new Val( 98, 8131120, 813979472, 813979472, "Rennes-Singel"), + new Val( 99, 8131120, 79289746, 79289746, "Rennes-Singel"), + new Val( 100, 8131120, 813979470, 813979470, "Rennes-Singel"), + new Val( 101, 8131120, 161166589, 161166589, "Rennes-Singel"), + new Val( 102, 8131120, 192559628, 192559628, "Rennes-Singel"), + new Val( 103, 8131120, 249333186, 249333186, "Rennes-Singel"), + new Val("Rennes-Singel (318;601)", + + 104, 429706864, 249333186, 249333184, "Herestraat"), + new Val( 105, 249333184, 813970231, 813970231, "Herestraat"), + new Val( 106, 249333184, 813970229, 813970229, "Herestraat"), + new Val("Herestraat (601)", + + 107, 249333184, 813970229, 813970228, "Herestraat"), + new Val( 108, 813970228, 813970226, 813970226, "Herestraat"), + new Val( 109, 813970228, 813970232, 813970232, "Herestraat"), + new Val( 110, 813970228, 13067134, 13067134, "Herestraat"), + new Val("Herestraat (410;600;601)", + + 111, 813970228, 13067134, 249333187, "Rotonde Het Teken"), + new Val("Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 112, 249333187, 249333187, 249333188, "Rotonde Het Teken (MgrVWB)"), + new Val("Rotonde Het Teken (MgrVWB) (3;410;600;601)", + + 113, 249333188, 249333188, 3752557, "Rotonde Het Teken (to Ring Noord)"), + new Val("Rotonde Het Teken (to Ring Noord) (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + + 114, 3752557, 3752557, 78873921, "Rotonde Het Teken (Ring Noord)"), // todo where Campus 3 loops + new Val("Rotonde Het Teken (Ring Noord) (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + + 115, 78873921, 78873921, 78568660, "Rotonde Het Teken (from Ring Noord)"), + new Val( 116, 78568660, 8080023, 8080023, "Ring Zuid"), + new Val( 117, 78568660, 502328837, 502328837, "Ring Zuid"), + new Val( 118, 78568660, 502328838, 502328838, "Ring Zuid"), + new Val("Rotonde Het Teken (from Ring Noord) - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + + 119, 78568660, 502328838, 14508740, "Ring Zuid (1 - 2)"), + new Val("Ring Zuid (1 - 2) (3;317;334;335;380;395;410;600;601)", + + 120, 14508740, 14508740, 14508739, "Ring Zuid (2 - 3)"), + new Val("Ring Zuid (2 - 3) (3;317;334;335;395;410;600;601)", + + 121, 14508739, 14508739, 109267436, "Ring Zuid (3 - 4&5)"), + new Val("Ring Zuid (3 - 4&5) (3;317;395;410;600;601)", + + 122, 109267436, 109267436, 14508736, null), + new Val( 123, 14508736, 377918641, 377918641, "perron 5"), + new Val("perron 5 (3;317;395;410;601)", + + 124, 14508736, 377918641, 78852604, null), + new Val( 125, 78852604, 332258104, 332258104, null), + new Val("GHB (ingang) - GHB (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 126, 78852604, 332258104, 159949154, null), + new Val("(from GHB to Ring Zuid) (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 127, 159949154, 159949154, 11369123, "Ring Zuid (GHB)"), + new Val("Ring Zuid (GHB) (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 128, 11369123, 11369123, 79340950, "Ring Zuid"), + new Val( 129, 79340950, 41403538, 41403538, "Rotonde Het Teken"), + new Val("Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 130, 79340950, 41403538, 8079995, "Herestraat"), + new Val( 131, 8079995, 41403544, 41403544, "Herestraat"), + new Val( 132, 8079995, 813970227, 813970227, "Herestraat"), + new Val("Herestraat (410;600;601)", + + 133, 8079995, 813970227, 681081951, "Herestraat"), + new Val( 134, 681081951, 813970231, 813970231, "Herestraat"), + new Val( 135, 681081951, 249333184, 249333184, "Herestraat"), + new Val("Herestraat (410;601)", + + 136, 681081951, 249333184, 249333185, "Rennes-Singel"), + new Val( 137, 249333185, 3994257, 3994257, "Rennes-Singel"), + new Val( 138, 249333185, 3680456, 3680456, "Rennes-Singel"), + new Val( 139, 249333185, 8131121, 8131121, "Den Boschsingel"), + new Val( 140, 249333185, 225605630, 225605630, "Den Boschsingel"), + new Val("Rennes-Singel - Den Boschsingel (318;410;601)", + + 141, 249333185, 225605630, 23837544, "Den Boschsingel"), + new Val("Rennes-Singel - Den Boschsingel (318;410;601)", + + 142, 249333185, 23837544, 146171871, "Den Boschsingel"), + new Val( 143, 146171871, 3877105, 3877105, null), + new Val( 144, 146171871, 8131125, 8131125, null), + new Val( 145, 146171871, 3993387, 3993387, "Lüdenscheidsingel"), + new Val("Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)", - new Val( 160, 79596986, 79596986, 79211473, "Tiensevest", - "(305;306;310;318;358;410;433;475;485;601;658)"), + 146, 23837544, 3993387, 109267417, "Lüdenscheidsingel"), + new Val("Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)", - new Val( 159, 79211473, 79211473, 79211472, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)"), + 147, 146171871, 109267417, 3993388, "Lüdenscheidsingel"), + new Val( 148, 3993388, 44932921, 44932921, "Lüdenscheidsingel"), + new Val( 149, 3993388, 254800932, 254800932, "Lüdenscheidsingel"), + new Val("Lüdenscheidsingel (178;305;318;358;410;601;651;652;658)", - new Val( 158, 79211472, 79211472, 79175435, "Tiensevest", - "Tiensevest (1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)"), + 150, 3993388, 254800932, 23691158, "Joanna-Maria Artoisplein"), + new Val("Lüdenscheidsingel - Joanna-Maria Artoisplein (178;305;318;358;410;601;651;652;658)", - new Val( 157, 79175435, 79175435, 80458208, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)"), + 151, 109267417, 23691158, 254800931, "Joanna-Maria Artoisplein"), + new Val("Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", - new Val( 156, 80458208, 80458208, 19793164, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;651;652;658)"), + 152, 254800931, 254800931, 8133608, "Diestsevest"), + new Val( 153, 254800931, 4003924, 4003924, "Diestsevest"), + new Val( 154, 254800931, 81457878, 81457878, "Diestsevest"), + new Val( 155, 254800931, 6184898, 6184898, "Diestsevest"), + new Val("Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", - new Val( 155, 19793164, 19793164, 6184898, "Diestsevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)"), - - new Val( 154, 81457878, 6184898, 81457878, "Diestsevest"), - new Val( 153, 4003924, 6184898, 4003924, "Diestsevest"), - new Val( 152, 8133608, 6184898, 8133608, "Diestsevest"), - new Val( 151, 254800931, 6184898, 254800931, "Joanna-Maria Artoisplein"), - new Val( 150, 254800931, 6184898, 23691158, "Joanna-Maria Artoisplein", - "Joanna-Maria Artoisplein - Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)"), - - new Val( 149, 23691158, 23691158, 254800932, "Lüdenscheidsingel", - "Joanna-Maria Artoisplein (305;318;358;410;601;651;652;658)"), - - new Val( 148, 44932921, 254800932, 44932921, "Lüdenscheidsingel"), - new Val( 147, 3993388, 254800932, 3993388, "Lüdenscheidsingel"), - new Val( 146, 3993388, 254800932, 109267417, "Lüdenscheidsingel", - "Lüdenscheidsingel (178;305;318;358;410;601;651;652;658)"), - - new Val( 145, 3993387, 109267417, 3993387, "Lüdenscheidsingel"), - new Val( 144, 8131125, 109267417, 8131125, null), - new Val( 143, 3877105, 109267417, 3877105, null), - new Val( 142, 146171871, 109267417, 146171871, "Den Boschsingel"), - new Val( 141, 146171871, 109267417, 23837544, "Den Boschsingel", - "Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)"), - - new Val( 140, 225605630, 23837544, 225605630, "Den Boschsingel"), - new Val( 139, 8131121, 23837544, 8131121, "Den Boschsingel"), - new Val( 138, 3680456, 23837544, 3680456, "Rennes-Singel"), - new Val( 137, 3994257, 23837544, 3994257, "Rennes-Singel"), - new Val( 136, 249333185, 23837544, 249333185, "Rennes-Singel"), - new Val( 135, 249333185, 23837544, 249333184, "Herestraat", - "Rennes-Singel - Den Boschsingel (318;410;601)"), - - new Val( 134, 813970231, 249333184, 813970231, "Herestraat"), - new Val( 133, 681081951, 249333184, 681081951, "Herestraat"), - new Val( 132, 681081951, 249333184, 813970227, "Herestraat", - "Herestraat (410;601)"), - - new Val( 131, 41403544, 813970227, 41403544, "Herestraat"), - new Val( 130, 8079995, 813970227, 8079995, "Herestraat"), - new Val( 129, 8079995, 813970227, 41403538, "Rotonde Het Teken", - "Herestraat (410;600;601)"), - - new Val( 128, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 127, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 126, 11369123, 11369123, 159949154, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 125, 159949154, 159949154, 332258104, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 124, 78852604, 332258104, 78852604, null), - new Val( 123, 78852604, 332258104, 377918641, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 122, 14508736, 377918641, 14508736, null), - new Val( 121, 14508736, 377918641, 109267436, "Ring Zuid", - "(3;317;395;410;601)"), - - new Val( 120, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410;600;601)"), - - new Val( 119, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600;601)"), - - new Val( 118, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600;601)"), - - new Val( 117, 502328837, 502328838, 502328837, "Ring Zuid"), - new Val( 116, 8080023, 502328838, 8080023, "Ring Zuid"), - new Val( 115, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 114, 78568660, 502328838, 78873921, "Rotonde Het Teken", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 113, 78873921, 78873921, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 112, 3752557, 3752557, 249333188, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 111, 249333188, 249333188, 249333187, "Rotonde Het Teken", - "Rotonde Het Teken (3;410;600;601)"), - - new Val( 110, 249333187, 249333187, 13067134, "Herestraat", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 109, 813970232, 13067134, 813970232, "Herestraat"), - new Val( 108, 813970226, 13067134, 813970226, "Herestraat"), - new Val( 107, 813970228, 13067134, 813970228, "Herestraat"), - new Val( 106, 813970228, 13067134, 813970229, "Herestraat", - "Herestraat (410;600;601)"), - - new Val( 105, 813970231, 813970229, 813970231, "Herestraat"), - new Val( 104, 249333184, 813970229, 249333184, "Herestraat"), - new Val( 103, 249333184, 813970229, 249333186, "Rennes-Singel", - "Herestraat (601)"), - - new Val( 102, 192559628, 249333186, 192559628, "Rennes-Singel"), - new Val( 101, 161166589, 249333186, 161166589, "Rennes-Singel"), - new Val( 100, 813979470, 249333186, 813979470, "Rennes-Singel"), - new Val( 99, 79289746, 249333186, 79289746, "Rennes-Singel"), - new Val( 98, 813979472, 249333186, 813979472, "Rennes-Singel"), - new Val( 97, 8131120, 249333186, 8131120, "Rennes-Singel"), - new Val( 96, 8131120, 249333186, 429706864, "Rennes-Singel", - "Rennes-Singel (318;601)"), - - new Val( 95, 99583853, 429706864, 99583853, "Tervuursevest"), - new Val( 94, 521193379, 429706864, 521193379, "Tervuursevest"), - new Val( 93, 521193380, 429706864, 521193380, "Tervuursevest"), - new Val( 92, 813979465, 429706864, 813979465, "Tervuursevest"), - new Val( 91, 174338458, 429706864, 174338458, "Tervuursevest"), - new Val( 90, 608715520, 429706864, 608715520, "Tervuursevest"), - new Val( 89, 608715521, 429706864, 608715521, "Tervuursevest"), - new Val( 88, 3677944, 429706864, 3677944, "Tervuursevest"), - new Val( 87, 174338459, 429706864, 174338459, "Tervuursevest"), - new Val( 86, 429706866, 429706864, 429706866, "Tervuursevest"), - new Val( 85, 88361317, 429706864, 88361317, "Tervuursevest"), - new Val( 84, 88361317, 429706864, 461159345, "Tervuursevest", - "Tervuursevest - Rennes-Singel (601)"), - - new Val( 83, 461159345, 461159345, 461159362, "Tervuursevest", - "Tervuursevest (178;179;601)"), - - new Val( 82, 344507822, 461159362, 344507822, "Tervuursevest"), - new Val( 81, 461159367, 461159362, 461159367, "Tervuursevest"), - new Val( 80, 3677335, 461159362, 3677335, "Tervuursevest"), - new Val( 79, 31474001, 461159362, 31474001, "Tervuursevest"), - new Val( 78, 23237288, 461159362, 23237288, "Tervuursevest"), - new Val( 77, 90168773, 461159362, 90168773, "Tervuursevest"), - new Val( 76, 23237287, 461159362, 23237287, "Tervuursevest"), - new Val( 75, 608715561, 461159362, 608715561, "Tervuursevest"), - new Val( 74, 608715562, 461159362, 608715562, "Tervuursevest"), - new Val( 73, 3677330, 461159362, 3677330, "Tervuursevest"), - new Val( 72, 3677330, 461159362, 86164005, "Naamsevest", - "Tervuursevest (178;179;520;524;525;537;601)"), - - new Val( 71, 655251293, 86164005, 655251293, "Naamsevest"), - new Val( 70, 131571763, 86164005, 131571763, "Naamsevest"), - new Val( 69, 661733369, 86164005, 661733369, "Naamsevest"), - new Val( 68, 655251292, 86164005, 655251292, "Naamsevest"), - new Val( 67, 3677823, 86164005, 3677823, "Naamsevest"), - new Val( 66, 24905257, 86164005, 24905257, "Geldenaaksevest"), - new Val( 65, 608715605, 86164005, 608715605, "Geldenaaksevest"), - new Val( 64, 608715606, 86164005, 608715606, "Geldenaaksevest"), - new Val( 63, 608715606, 86164005, 79299303, "Geldenaaksevest", - "Geldenaaksevest - Naamsevest (18;178;179;337;601;616)"), - - new Val( 62, 10296368, 79299303, 10296368, "Geldenaaksevest"), - new Val( 61, 521193607, 79299303, 521193607, "Geldenaaksevest"), - new Val( 60, 94585453, 79299303, 94585453, "Geldenaaksevest"), - new Val( 59, 586268893, 79299303, 586268893, "Geldenaaksevest"), - new Val( 58, 8130906, 79299303, 8130906, "Geldenaaksevest"), - new Val( 57, 8130906, 79299303, 16775171, "Tiensepoort", - "Geldenaaksevest (18;178;179;337;601;616;630)"), - - new Val( 56, 863272991, 16775171, 863272991, "Tiensevest"), - new Val( 55, 863272995, 16775171, 863272995, "Tiensevest"), - new Val( 54, 863272992, 16775171, 863272992, "Tiensevest"), - new Val( 53, 863272993, 16775171, 863272993, "Tiensevest"), - new Val( 52, 863272994, 16775171, 863272994, "Tiensevest"), - new Val( 51, 8131717, 16775171, 8131717, "Tiensevest"), - new Val( 50, 12712557, 16775171, 12712557, "Tiensevest"), - new Val( 49, 12712557, 16775171, 8590231, "Tiensevest", - "Tiensevest - Tiensepoort (7;8;9;18;178;179;337;380;527;601;616;630)"), - - new Val( 48, 8590231, 8590231, 185988814, "Tiensevest", - "Tiensevest (7;8;9;18;178;179;337;380;527;601;630)"), - - new Val( 47, 185988814, 185988814, 76856823, "Martelarenplein", - "Tiensevest (1;4;5;6;7;8;9;18;178;179;337;380;527;601;630)"), - - new Val( 46, 459446598, 76856823, 459446598, "Martelarenplein"), - new Val( 45, 459446600, 76856823, 459446600, "Martelarenplein"), - new Val( 44, 78815533, 76856823, 78815533, null), - new Val( 43, 78815533, 76856823, 79264899, null, - "Martelarenplein (4;5;6;7;8;9;18;178;179;337;380;527;601;630)"), - - new Val( 42, 79264899, 79264899, 377918635, null, - "(4;5;6;18;178;179;333;334;335;337;370;371;373;374;380;512;601;630)"), - - new Val( 41, 377918635, 377918635, 79264888, null, - "(3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;601)"), - - new Val( 40, 79264888, 79264888, 79264897, null, - "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;525;601)"), - - new Val( 39, 71754927, 79264897, 71754927, null), - new Val( 38, 71754927, 79264897, 377918638, null, - "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525;601)"), - - new Val( 37, 377918638, 377918638, 79264891, null, - "perron 13 (18;601)"), - - new Val( 36, 79264891, 79264891, 78568409, "Tiensevest", - "perron 13 (18;601)"), - - new Val( 35, 78568409, 78568409, 79193579, "Tiensevest", - "Tiensevest (4;5;6;7;8;9;18;179;334;335;337;380;601;616;658)"), - - new Val( 34, 79193579, 79193579, 19793394, null, - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;600;601;616;630;658)"), - - new Val( 33, 19793394, 19793394, 19793164, "Tiensevest", - "(334;335;513;601)"), - - new Val( 32, 19793164, 19793164, 6184898, "Diestsevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)"), - - new Val( 31, 81457878, 6184898, 81457878, "Diestsevest"), - new Val( 30, 4003924, 6184898, 4003924, "Diestsevest"), - new Val( 29, 8133608, 6184898, 8133608, "Diestsevest"), - new Val( 28, 254800931, 6184898, 254800931, "Joanna-Maria Artoisplein"), - new Val( 27, 254800931, 6184898, 3992548, "Zoutstraat", - "Joanna-Maria Artoisplein - Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)"), - - new Val( 26, 3992548, 3992548, 510790349, "Havenkant", - "Zoutstraat (334;335;513;601;630)"), - - new Val( 25, 510790348, 510790349, 510790348, "Havenkant"), - new Val( 24, 314635787, 510790349, 314635787, "Havenkant"), - new Val( 23, 843534478, 510790349, 843534478, "Havenkant"), - new Val( 22, 406205781, 510790349, 406205781, "Havenkant"), - new Val( 21, 270181176, 510790349, 270181176, "Havenkant"), - new Val( 20, 330300725, 510790349, 330300725, "Havenkant"), - new Val( 19, 3869822, 510790349, 3869822, "Burchtstraat"), - new Val( 18, 330300723, 510790349, 330300723, "Achter de latten"), - new Val( 17, 659297690, 510790349, 659297690, "Wolvengang"), - new Val( 16, 25928482, 510790349, 25928482, "Wolvengang"), - new Val( 15, 3869812, 510790349, 3869812, "Engels Plein"), - new Val( 14, 338057820, 510790349, 338057820, "Engels Plein"), - - new Val( 13, 338057820, 510790349, 338057820, "Engels Plein", - "Engels Plein - Havenkant (601)") - ); + 156, 8133608, 6184898, 19793164, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)", - testPtLine(expectedValues, PT_ROUTE_BUS_601); + 157, 19793164, 19793164, 80458208, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;651;652;658)", - // *********************************************************** - // *********************************************************** - // *********************************************************** + 158, 80458208, 80458208, 79175435, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)", - expectedValues = Arrays.asList( - new Val( 169, 608715622, 608715622, 608715622, "Engels Plein"), - new Val( 168, 338057819, 608715622, 338057819, "Engels Plein"), - new Val( 167, 305316104, 608715622, 305316104, "Engels Plein"), - new Val( 166, 3869812, 608715622, 3869812, "Engels Plein"), - new Val( 165, 25928482, 608715622, 25928482, "Wolvengang"), - new Val( 164, 659297690, 608715622, 659297690, "Wolvengang"), - new Val( 163, 330300723, 608715622, 330300723, "Achter de latten"), - new Val( 162, 3869822, 608715622, 3869822, "Burchtstraat"), - new Val( 161, 330300725, 608715622, 330300725, "Havenkant"), - new Val( 160, 270181176, 608715622, 270181176, "Havenkant"), - new Val( 159, 406205781, 608715622, 406205781, "Havenkant"), - new Val( 158, 843534478, 608715622, 843534478, "Havenkant"), - new Val( 157, 314635787, 608715622, 314635787, "Havenkant"), - new Val( 156, 510790348, 608715622, 510790348, "Havenkant"), - new Val( 155, 29283599, 608715622, 29283599, "Havenkant"), - new Val( 154, 29283599, 608715622, 304241968, "Havenkant", - "Havenkant - Engels Plein (600)"), - - new Val( 153, 304241967, 304241968, 304241967, "Aarschotsesteenweg"), - new Val( 152, 304241967, 304241968, 340265961, "Redersstraat", - "Aarschotsesteenweg - Havenkant (334;335;513;600;630)"), - - new Val( 151, 318825613, 340265961, 318825613, "Redersstraat"), - new Val( 150, 318825613, 340265961, 340265962, "Redersstraat", - "Redersstraat (600)"), - - new Val( 149, 340265962, 340265962, 254801390, "Joanna-Maria Artoisplein", - "Redersstraat (333;334;335;513;600;630)"), - - new Val( 148, 254801390, 254801390, 61540068, "Joanna-Maria Artoisplein", - "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)"), - - new Val( 147, 23691160, 61540068, 23691160, "Vuurkruisenlaan"), - new Val( 146, 4061640, 61540068, 4061640, "Vuurkruisenlaan"), - new Val( 145, 8109264, 61540068, 8109264, "Diestsepoort"), - new Val( 144, 8109264, 61540068, 61556877, "Diestsepoort", - "Diestsepoort - Joanna-Maria Artoisplein (305;333;334;335;513;600;630;651;652;658)"), - - new Val( 143, 663770966, 61556877, 663770966, "Diestsepoort"), - new Val( 142, 584356749, 61556877, 584356749, "Diestsepoort"), - new Val( 141, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 140, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), - - new Val( 139, 584356751, 198559166, 584356751, "Diestsepoort"), - new Val( 138, 451873773, 198559166, 451873773, "Diestsepoort"), - new Val( 137, 584356742, 198559166, 584356742, "Diestsepoort"), - new Val( 136, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 135, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), - - new Val( 134, 79264890, 76867049, 79264890, null), - new Val( 133, 79596965, 76867049, 79596965, null), - new Val( 132, 79596965, 76867049, 79596974, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), - - new Val( 131, 79596982, 79596974, 79596982, null), - new Val( 130, 79596982, 79596974, 79596987, null, - "perron 11 & 12 (3;333;334;335;433;600;630)"), - - new Val( 129, 377918658, 79596987, 377918658, null), - new Val( 128, 79596980, 79596987, 79596980, null), - new Val( 127, 79596980, 79596987, 79193579, "Tiensevest", - "perron 11 & 12 (3;333;334;335;513;600;630)"), - - new Val( 126, 79193579, 79193579, 258936980, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;600;616;630;658)"), - - new Val( 125, 258936980, 258936980, 79193580, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)"), - - new Val( 124, 79193580, 79193580, 79193581, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)"), - - new Val( 123, 79193581, 79193581, 78815505, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)"), - - new Val( 122, 78815505, 78815505, 84696751, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)"), - - new Val( 121, 79265237, 84696751, 79265237, "Tiensevest"), - new Val( 120, 79265237, 84696751, 89574079, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)"), - - new Val( 119, 81522744, 89574079, 81522744, "Tiensevest"), - new Val( 118, 81522744, 89574079, 19793223, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)"), - - new Val( 117, 185988814, 19793223, 185988814, "Tiensevest"), - new Val( 116, 185988814, 19793223, 185988816, "Tiensevest", - "Tiensevest (1;4;5;6;7;8;9;18;179;337;380;600;616;630)"), - - new Val( 115, 15083398, 185988816, 15083398, "Tiensevest"), - new Val( 114, 8154434, 185988816, 8154434, "Tiensevest"), - new Val( 113, 4003927, 185988816, 4003927, "Tiensevest"), - new Val( 112, 4003927, 185988816, 521193609, "Tiensevest"), - new Val( 111, 4003927, 185988816, 586268892, "Tiensevest"), - new Val( 110, 4003927, 185988816, 521193611, "Tiensevest"), - new Val( 109, 4003927, 185988816, 4003928, "Tiensepoort", - "Tiensevest (7;8;9;18;179;337;380;600;616;630)"), - - new Val( 108, 4003928, 4003928, 8130905, "Geldenaaksevest"), - new Val( 107, 4003928, 4003928, 24905256, "Geldenaaksevest"), - new Val( 106, 4003928, 4003928, 24905255, "Geldenaaksevest"), - new Val( 105, 491728135, 4003928, 491728135, "Geldenaaksevest"), - new Val( 104, 24905254, 4003928, 24905254, "Geldenaaksevest"), - new Val( 103, 199381120, 4003928, 199381120, "Geldenaaksevest"), - new Val( 102, 199381120, 4003928, 3991775, "Geldenaaksevest", - "Geldenaaksevest - Tiensepoort (18;178;179;337;600;616;630)"), - - new Val( 101, 120086001, 3991775, 120086001, "Erasme Ruelensvest"), - new Val( 100, 608715575, 3991775, 608715575, "Erasme Ruelensvest"), - new Val( 99, 608715579, 3991775, 608715579, "Erasme Ruelensvest"), - new Val( 98, 608715579, 3991775, 3677822, "Erasme Ruelensvest", - "Erasme Ruelensvest - Geldenaaksevest (18;178;179;337;600;616)"), - - new Val( 97, 120086003, 3677822, 120086003, "Tervuursevest"), - new Val( 96, 120086003, 3677822, 90168774, "Tervuursevest", - "Tervuursevest - Erasme Ruelensvest (178;179;600)"), - - new Val( 95, 3677329, 90168774, 3677329, "Tervuursevest"), - new Val( 94, 608715614, 90168774, 608715614, "Tervuursevest"), - new Val( 93, 608715615, 90168774, 608715615, "Tervuursevest"), - new Val( 92, 85044922, 90168774, 85044922, "Tervuursevest"), - new Val( 91, 85044922, 90168774, 16771611, "Tervuursevest", - "Tervuursevest (178;179;520;524;525;537;586;600)"), - - new Val( 90, 16771611, 16771611, 13246158, "Tervuursevest", - "Tervuursevest (178;520;524;525;537;586;600)"), - - new Val( 89, 13246158, 13246158, 260405216, "Tervuursevest", - "Tervuursevest (7;8;9;178;520;524;525;527;537;586;600)"), - - new Val( 88, 16771609, 260405216, 16771609, "Tervuursevest"), - new Val( 87, 16771609, 260405216, 608715518, "Tervuursevest", - "Tervuursevest (7;8;9;178;527;600)"), - - new Val( 86, 608715519, 608715518, 608715519, "Tervuursevest"), - new Val( 85, 3677336, 608715518, 3677336, "Tervuursevest"), - new Val( 84, 15051052, 608715518, 15051052, "Tervuursevest"), - new Val( 83, 814322832, 608715518, 814322832, "Tervuursevest"), - new Val( 82, 80194318, 608715518, 80194318, "Tervuursevest"), - new Val( 81, 813979466, 608715518, 813979466, "Tervuursevest"), - new Val( 80, 521193382, 608715518, 521193382, "Tervuursevest"), - new Val( 79, 521193383, 608715518, 521193383, "Tervuursevest"), - new Val( 78, 3677945, 608715518, 3677945, "Tervuursevest"), - new Val( 77, 3677945, 608715518, 192559627, "Rennes-Singel", - "Tervuursevest (178;600)"), - - new Val( 76, 813979469, 192559627, 813979469, "Rennes-Singel"), - new Val( 75, 192559626, 192559627, 192559626, "Rennes-Singel"), - new Val( 74, 813979473, 192559627, 813979473, "Rennes-Singel"), - new Val( 73, 813979473, 192559627, 28982660, "Rennes-Singel", - "Rennes-Singel (178;318;600)"), - - new Val( 72, 78568455, 28982660, 78568455, "Herestraat"), - new Val( 71, 78568455, 28982660, 813970227, "Herestraat", - "Herestraat - Rennes-Singel (600)"), - - new Val( 70, 41403544, 813970227, 41403544, "Herestraat"), - new Val( 69, 8079995, 813970227, 8079995, "Herestraat"), - new Val( 68, 8079995, 813970227, 41403538, "Rotonde Het Teken", - "Herestraat (410;600;601)"), - - new Val( 67, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 66, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 65, 159949154, 11369123, 159949154, null), - new Val( 64, 159949154, 11369123, 332258104, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513;600)"), - - new Val( 63, 78852604, 332258104, 78852604, null), - new Val( 62, 78852604, 332258104, 14508735, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 61, 14508735, 14508735, 318878531, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600)"), - - new Val( 60, 14506241, 318878531, 14506241, null), - new Val( 59, 14506241, 318878531, 109267436, "Ring Zuid", - "(3;317;395;410;600)"), - - new Val( 58, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410;600)"), - - new Val( 57, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410;600)"), - - new Val( 56, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410;600)"), - - new Val( 55, 502328837, 502328838, 502328837, "Ring Zuid"), - new Val( 54, 8080023, 502328838, 8080023, "Ring Zuid"), - new Val( 53, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 52, 78568660, 502328838, 78873921, "Rotonde Het Teken", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 51, 78873921, 78873921, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600)"), - - new Val( 50, 3752557, 3752557, 249333188, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;600)"), - - new Val( 49, 249333188, 249333188, 249333187, "Rotonde Het Teken", - "Rotonde Het Teken (3;410;600)"), - - new Val( 48, 249333187, 249333187, 13067134, "Herestraat", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600)"), - - new Val( 47, 813970232, 13067134, 813970232, "Herestraat"), - new Val( 46, 813970226, 13067134, 813970226, "Herestraat"), - new Val( 45, 813970228, 13067134, 813970228, "Herestraat"), - new Val( 44, 813970228, 13067134, 270181177, "Herestraat", - "Herestraat (410;600;601)"), - - new Val( 43, 78568454, 270181177, 78568454, "Rennes-Singel"), - new Val( 42, 225605633, 270181177, 225605633, "Rennes-Singel"), - new Val( 41, 225605633, 270181177, 8131123, "Rennes-Singel", - "Rennes-Singel - Herestraat (410;600)"), - - new Val( 40, 3680457, 8131123, 3680457, "Rennes-Singel"), - new Val( 39, 192559625, 8131123, 192559625, "Den Boschsingel"), - new Val( 38, 23837543, 8131123, 23837543, "Den Boschsingel"), - new Val( 37, 146171867, 8131123, 146171867, "Den Boschsingel"), - new Val( 36, 125835586, 8131123, 125835586, "Den Boschsingel"), - new Val( 35, 125835586, 8131123, 3877104, null, - "Den Boschsingel - Rennes-Singel (318;410;600)"), - - new Val( 34, 85048201, 3877104, 85048201, "Lüdenscheidsingel"), - new Val( 33, 12891213, 3877104, 12891213, "Lüdenscheidsingel"), - new Val( 32, 44932919, 3877104, 44932919, "Lüdenscheidsingel"), - new Val( 31, 44932919, 3877104, 8131040, "Lüdenscheidsingel", - "Lüdenscheidsingel - R23 (318;410;600;651;658)"), - - new Val( 30, 61540098, 8131040, 61540098, "Joanna-Maria Artoisplein"), - new Val( 29, 61540098, 8131040, 254801390, "Joanna-Maria Artoisplein", - "Joanna-Maria Artoisplein - Lüdenscheidsingel (178;305;318;410;600;651;652;658)"), - - new Val( 28, 254801390, 254801390, 61540068, "Joanna-Maria Artoisplein", - "Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)"), - - new Val( 27, 23691160, 61540068, 23691160, "Vuurkruisenlaan"), - new Val( 26, 4061640, 61540068, 4061640, "Vuurkruisenlaan"), - new Val( 25, 8109264, 61540068, 8109264, "Diestsepoort"), - new Val( 24, 8109264, 61540068, 61556877, "Diestsepoort", - "Diestsepoort - Joanna-Maria Artoisplein (305;333;334;335;513;600;630;651;652;658)"), - - new Val( 23, 663770966, 61556877, 663770966, "Diestsepoort"), - new Val( 22, 584356749, 61556877, 584356749, "Diestsepoort"), - new Val( 21, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 20, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), - - new Val( 19, 584356751, 198559166, 584356751, "Diestsepoort"), - new Val( 18, 451873773, 198559166, 451873773, "Diestsepoort"), - new Val( 17, 584356742, 198559166, 584356742, "Diestsepoort"), - new Val( 16, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 15, 451873774, 198559166, 116797180, "Diestsepoort", - "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), - - new Val( 14, 23691157, 116797180, 23691157, "Diestsepoort"), - new Val( 13, 23691157, 116797180, 78815527, null, - "Diestsepoort (4;5;6;7;8;9;179;334;335;337;380;600;616;651;652;658)"), - - new Val( 12, 377918658, 78815527, 377918658, null), - - new Val( 11, 377918658, 78815527, 377918658, null, - "perron 11 & 12 (600;651;652)") - ); + 159, 79175435, 79175435, 79211472, "Tiensevest"), + new Val("Tiensevest (1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)", - testPtLine(expectedValues, PT_ROUTE_BUS_600); + 160, 79211472, 79211472, 79211473, "Tiensevest"), + new Val("Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)", - // *********************************************************** - // Line 3 has the particularity that there are 2 variants - // The longer version has a spoon to serve another hospital - // The following test block is for the shorter version - // *********************************************************** + 161, 79211473, 79211473, 79596986, null), + new Val("(305;306;310;318;358;410;433;475;485;601;658)", - expectedValues = Arrays.asList( - new Val( 194, 27684829, 27684829, 27684829, "Dorpskring"), - new Val( 193, 349396917, 27684829, 349396917, "Dorpskring"), - new Val( 192, 349396921, 27684829, 349396921, "Dorpskring"), - new Val( 191, 112917099, 27684829, 112917099, "Dorpskring"), - new Val( 190, 112917099, 27684829, 125835538, "Dorpskring", - "Dorpskring (3)"), - - new Val( 189, 125835538, 125835538, 81197019, "Bollenberg", - "Dorpskring (3;373;485)"), - - new Val( 188, 112917100, 81197019, 112917100, "Bollenberg"), - new Val( 187, 694551612, 81197019, 694551612, "Bollenberg"), - new Val( 186, 645048305, 81197019, 645048305, "Bollenberg"), - new Val( 185, 27688813, 81197019, 27688813, "Bollenberg"), - new Val( 184, 232474772, 81197019, 232474772, "Lubbeekstraat"), - new Val( 183, 10658839, 81197019, 10658839, "Lubbeekstraat"), - new Val( 182, 319269331, 81197019, 319269331, "Kapelstraat"), - new Val( 181, 636950670, 81197019, 636950670, "Kapelstraat"), - new Val( 180, 16377722, 81197019, 16377722, "Kapelstraat"), - new Val( 179, 16377612, 81197019, 16377612, "Kapelstraat"), - new Val( 178, 16377612, 81197019, 40189518, "Lostraat", - "Kapelstraat - Bollenberg (3)"), - - new Val( 177, 351196789, 40189518, 351196789, "Lostraat"), - new Val( 176, 350992067, 40189518, 350992067, "Lostraat"), - new Val( 175, 636491595, 40189518, 636491595, "Lostraat"), - new Val( 174, 636491594, 40189518, 636491594, "Lostraat"), - new Val( 173, 124913579, 40189518, 124913579, "Lostraat"), - new Val( 172, 10672044, 40189518, 10672044, "Lostraat"), - new Val( 171, 633919766, 40189518, 633919766, "Lostraat"), - new Val( 170, 10672080, 40189518, 10672080, "Heidebergstraat"), - new Val( 169, 10672083, 40189518, 10672083, "Heidebergstraat"), - new Val( 168, 79801761, 40189518, 79801761, "Heidebergstraat"), - new Val( 167, 112917249, 40189518, 112917249, "Heidebergstraat"), - new Val( 166, 112917247, 40189518, 112917247, "Heidebergstraat"), - new Val( 165, 192706264, 40189518, 192706264, "Heidebergstraat"), - new Val( 164, 318216944, 40189518, 318216944, "Heidebergstraat"), - new Val( 163, 192706265, 40189518, 192706265, "Heidebergstraat"), - new Val( 162, 586861164, 40189518, 586861164, "Heidebergstraat"), - new Val( 161, 10672031, 40189518, 10672031, "Heidebergstraat"), - new Val( 160, 10672135, 40189518, 10672135, "Koetsweg"), - new Val( 159, 608754691, 40189518, 608754691, "Koetsweg"), - new Val( 158, 608754692, 40189518, 608754692, "Koetsweg"), - new Val( 157, 10672174, 40189518, 10672174, "Gaston Eyskenslaan"), - new Val( 156, 23436182, 40189518, 23436182, "Platte-Lostraat"), - new Val( 155, 112917234, 40189518, 112917234, "Duivenstraat"), - new Val( 154, 23707216, 40189518, 23707216, "Duivenstraat"), - new Val( 153, 608754700, 40189518, 608754700, "Lijsterlaan"), - new Val( 152, 10672177, 40189518, 10672177, "Lijsterlaan"), - new Val( 151, 112917228, 40189518, 112917228, "Prins Regentplein"), - new Val( 150, 112917229, 40189518, 112917229, "Prins Regentplein"), - new Val( 149, 10672178, 40189518, 10672178, "Prins Regentplein"), - new Val( 148, 10657957, 40189518, 10657957, "Prins-Regentlaan"), - new Val( 147, 25155107, 40189518, 25155107, "Willem Coosemansstraat"), - new Val( 146, 79784138, 40189518, 79784138, "Koning Albertlaan"), - new Val( 145, 23707241, 40189518, 23707241, "Koning Albertlaan"), - new Val( 144, 112917227, 40189518, 112917227, "Koning Albertlaan"), - new Val( 143, 101619135, 40189518, 101619135, "Koning Albertlaan"), - new Val( 142, 622063635, 40189518, 622063635, "Koning Albertlaan"), - new Val( 141, 622063636, 40189518, 622063636, "Koning Albertlaan"), - new Val( 140, 101619136, 40189518, 101619136, "Koning Albertlaan"), - new Val( 139, 16377030, 40189518, 16377030, "Martelarenlaan"), - new Val( 138, 485802425, 40189518, 485802425, "Spoordijk"), - new Val( 137, 23707242, 40189518, 23707242, "Martelarenlaan"), - new Val( 136, 608715582, 40189518, 608715582, "Martelarenlaan"), - new Val( 135, 608715584, 40189518, 608715584, "Martelarenlaan"), - new Val( 134, 284832275, 40189518, 284832275, "Martelarenlaan"), - new Val( 133, 608715586, 40189518, 608715586, "Martelarenlaan"), - new Val( 132, 608715590, 40189518, 608715590, "Martelarenlaan"), - new Val( 131, 3992546, 40189518, 3992546, "Martelarenlaan"), - new Val( 130, 10230617, 40189518, 10230617, "Oude Diestsesteenweg"), - new Val( 129, 10230617, 40189518, 23707243, "Diestsesteenweg", - "Oude Diestsesteenweg - Lostraat (3)"), - - new Val( 128, 23707243, 23707243, 23707244, "Diestsesteenweg", - "Diestsesteenweg (3;370;371;373;374;475;485;524;525)"), - - new Val( 127, 12715116, 23707244, 12715116, "Diestsesteenweg"), - new Val( 126, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)"), - - new Val( 125, 663770966, 61556877, 663770966, "Diestsepoort"), - new Val( 124, 584356749, 61556877, 584356749, "Diestsepoort"), - new Val( 123, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 122, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), - - new Val( 121, 584356751, 198559166, 584356751, "Diestsepoort"), - new Val( 120, 451873773, 198559166, 451873773, "Diestsepoort"), - new Val( 119, 584356742, 198559166, 584356742, "Diestsepoort"), - new Val( 118, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 117, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), - - new Val( 116, 79264890, 76867049, 79264890, null), - new Val( 115, 79596965, 76867049, 79596965, null), - new Val( 114, 79596965, 76867049, 71754927, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), - - new Val( 113, 71754927, 71754927, 79264897, null, - "(2;3;310;370;371;373;374;475;485;513;520;524;525)"), - - new Val( 112, 79596983, 79264897, 79596983, null), - new Val( 111, 377918665, 79264897, 377918665, null), - new Val( 110, 377918665, 79264897, 78815513, null, - "perron 7 & 8 (2;3;310)"), - - new Val( 109, 377918666, 78815513, 377918666, null), - new Val( 108, 79596978, 78815513, 79596978, null), - new Val( 107, 79596978, 78815513, 79193581, "Tiensevest", - "perron 7 & 8 (2;3)"), - - new Val( 106, 79193581, 79193581, 78815505, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), - - new Val( 105, 78815505, 78815505, 84696751, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), - - new Val( 104, 79265237, 84696751, 79265237, "Tiensevest"), - new Val( 103, 79265237, 84696751, 89574079, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)"), - - new Val( 102, 81522744, 89574079, 81522744, "Tiensevest"), - new Val( 101, 81522744, 89574079, 305434579, "Bondgenotenlaan", - "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)"), - - new Val( 100, 578662093, 305434579, 578662093, "Bondgenotenlaan"), - new Val( 99, 578662092, 305434579, 578662092, "Bondgenotenlaan"), - new Val( 98, 578662095, 305434579, 578662095, "Bondgenotenlaan"), - new Val( 97, 578662094, 305434579, 578662094, "Bondgenotenlaan"), - new Val( 96, 3991636, 305434579, 3991636, "Bondgenotenlaan"), - new Val( 95, 174985125, 305434579, 174985125, "Rector De Somerplein"), - new Val( 94, 521211977, 305434579, 521211977, "Rector De Somerplein"), - new Val( 93, 521211977, 305434579, 521211976, "Rector De Somerplein", - "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), - - new Val( 92, 16771741, 521211976, 16771741, "Rector De Somerplein"), - new Val( 91, 16771741, 521211976, 3991635, "Margarethaplein", - "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), - - new Val( 90, 521211973, 3991635, 521211973, "Margarethaplein"), - new Val( 89, 608715546, 3991635, 608715546, "Margarethaplein"), - new Val( 88, 453538107, 3991635, 453538107, "Margarethaplein"), - new Val( 87, 80194313, 3991635, 80194313, "Mathieu de Layensplein"), - new Val( 86, 293288706, 3991635, 293288706, "Mathieu de Layensplein"), - new Val( 85, 10269271, 3991635, 10269271, "Dirk Boutslaan"), - new Val( 84, 578662072, 3991635, 578662072, "Dirk Boutslaan"), - new Val( 83, 608715541, 3991635, 608715541, "Dirk Boutslaan"), - new Val( 82, 293149632, 3991635, 293149632, "Dirk Boutslaan"), - new Val( 81, 3992578, 3991635, 3992578, "Dirk Boutslaan"), - new Val( 80, 438252643, 3991635, 438252643, "Dirk Boutslaan"), - new Val( 79, 284664268, 3991635, 284664268, "Brouwersstraat"), - new Val( 78, 284664268, 3991635, 608715545, "Brouwersstraat", - "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), - - new Val( 77, 608715543, 608715545, 608715543, "Brouwersstraat"), - new Val( 76, 608715542, 608715545, 608715542, "Brouwersstraat"), - new Val( 75, 608715544, 608715545, 608715544, "Brouwersstraat"), - new Val( 74, 284664272, 608715545, 284664272, "Brouwersstraat"), - new Val( 73, 284664272, 608715545, 147856945, "Tessenstraat - Fonteinstraat", - "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), - - new Val( 72, 123929547, 147856945, 123929547, "Kapucijnenvoer"), - new Val( 71, 123929547, 147856945, 3358673, "Biezenstraat", - "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), - - new Val( 70, 578662071, 3358673, 578662071, "Sint-Jacobsplein"), - new Val( 69, 521211966, 3358673, 521211966, "Sint-Jacobsplein"), - new Val( 68, 3358671, 3358673, 3358671, "Sint-Jacobsplein"), - new Val( 67, 123929615, 3358673, 123929615, "Sint-Hubertusstraat"), - new Val( 66, 123929615, 3358673, 189453003, "Monseigneur Van Waeyenberghlaan", - "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)"), - - new Val( 65, 79289753, 189453003, 79289753, "Monseigneur Van Waeyenberghlaan"), - new Val( 64, 189453004, 189453003, 189453004, "Monseigneur Van Waeyenberghlaan"), - new Val( 63, 189453002, 189453003, 189453002, "Monseigneur Van Waeyenberghlaan"), - new Val( 62, 189453001, 189453003, 189453001, "Monseigneur Van Waeyenberghlaan"), - new Val( 61, 810592121, 189453003, 810592121, "Monseigneur Van Waeyenberghlaan"), - new Val( 60, 249333181, 189453003, 249333181, "Monseigneur Van Waeyenberghlaan"), - new Val( 59, 249333181, 189453003, 249333187, "Rotonde Het Teken", - "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)"), - - new Val( 58, 249333187, 249333187, 813970230, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 57, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - new Val( 56, 41403540, 813970230, 41403538, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)"), - - new Val( 55, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 54, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 53, 159949154, 11369123, 159949154, null), - new Val( 52, 159949154, 11369123, 332258104, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 51, 78852604, 332258104, 78852604, null), - new Val( 50, 78852604, 332258104, 14508735, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 49, 14508735, 14508735, 318878531, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 48, 14506241, 318878531, 14506241, null), - new Val( 47, 14506241, 318878531, 109267436, "Ring Zuid", - "(3;317;395;410;600)"), - - new Val( 46, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410)"), - - new Val( 45, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410)"), - - new Val( 44, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410)"), - - new Val( 43, 502328837, 502328838, 502328837, "Ring Zuid"), - new Val( 42, 8080023, 502328838, 8080023, "Ring Zuid"), - new Val( 41, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 40, 78568660, 502328838, 15945426, "Ring Noord", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 39, 502317795, 15945426, 502317795, "Ring Noord"), - new Val( 38, 810580948, 15945426, 810580948, "Ring Noord"), - new Val( 37, 502317796, 15945426, 502317796, "Ring Noord"), - new Val( 36, 112917238, 15945426, 112917238, "Ring Noord"), - new Val( 35, 608754690, 15945426, 608754690, "Ring Noord"), - new Val( 34, 377918625, 15945426, 377918625, "Ring Noord"), - - new Val( 33, 377918625, 15945426, 377918625, "Ring Noord", - "Ring Noord (3)") - ); + 162, 79596986, 79596986, 377814547, null), + new Val("perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", - testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK); + 163, 377814547, 78579065, 0, null) + ); + + testPtLine(expectedValues, PT_ROUTE_BUS_601_TO_LEUVEN_STATION); // *********************************************************** - // Line 3 has the particularity that there are 2 variants - // The longer version has a spoon to serve another hospital - // This is testing the longer version completely + // *********************************************************** // *********************************************************** - expectedValues = Arrays.asList( - new Val( 217, 27684829, 27684829, 27684829, "Dorpskring"), - new Val( 216, 349396917, 27684829, 349396917, "Dorpskring"), - new Val( 215, 349396921, 27684829, 349396921, "Dorpskring"), - new Val( 214, 112917099, 27684829, 112917099, "Dorpskring"), - new Val( 213, 112917099, 27684829, 125835538, "Dorpskring", - "Dorpskring (3)"), - - new Val( 212, 125835538, 125835538, 81197019, "Bollenberg", - "Dorpskring (3;373;485)"), - - new Val( 211, 112917100, 81197019, 112917100, "Bollenberg"), - new Val( 210, 694551612, 81197019, 694551612, "Bollenberg"), - new Val( 209, 645048305, 81197019, 645048305, "Bollenberg"), - new Val( 208, 27688813, 81197019, 27688813, "Bollenberg"), - new Val( 207, 232474772, 81197019, 232474772, "Lubbeekstraat"), - new Val( 206, 10658839, 81197019, 10658839, "Lubbeekstraat"), - new Val( 205, 319269331, 81197019, 319269331, "Kapelstraat"), - new Val( 204, 636950670, 81197019, 636950670, "Kapelstraat"), - new Val( 203, 16377722, 81197019, 16377722, "Kapelstraat"), - new Val( 202, 16377612, 81197019, 16377612, "Kapelstraat"), - new Val( 201, 16377612, 81197019, 112917224, "Ganzendries", - "Kapelstraat - Bollenberg (3)"), - - new Val( 200, 319264895, 112917224, 319264895, "Ganzendries"), - new Val( 199, 27682732, 112917224, 27682732, "Sint Barbaradreef"), - new Val( 198, 527248228, 112917224, 527248228, null), - new Val( 197, 27686451, 112917224, 27686451, null), - new Val( 196, 847554912, 112917224, 847554912, null), - new Val( 195, 847554912, 112917224, 27686453, null, - "Sint Barbaradreef - Ganzendries (3)"), - - new Val( 194, 110643012, 27686453, 110643012, null), - new Val( 193, 112917220, 27686453, 112917220, null), - new Val( 192, 70869366, 27686453, 70869366, null), - new Val( 191, 27682735, 27686453, 27682735, null), - new Val( 190, 319269351, 27686453, 319269351, "Sint Barbaradreef"), - new Val( 189, 112917225, 27686453, 112917225, "Sint Barbaradreef"), - new Val( 188, 112917225, 27686453, 847554912, null, - "Sint Barbaradreef (3)"), - - new Val( 187, 27686451, 847554912, 27686451, null), - new Val( 186, 527248228, 847554912, 527248228, null), - new Val( 185, 27682732, 847554912, 27682732, "Sint Barbaradreef"), - new Val( 184, 319264895, 847554912, 319264895, "Ganzendries"), - new Val( 183, 112917224, 847554912, 112917224, "Ganzendries"), - new Val( 182, 112917224, 847554912, 40189518, "Lostraat", - "Ganzendries - Sint Barbaradreef (3)"), - - new Val( 181, 351196789, 40189518, 351196789, "Lostraat"), - new Val( 180, 350992067, 40189518, 350992067, "Lostraat"), - new Val( 179, 636491595, 40189518, 636491595, "Lostraat"), - new Val( 178, 636491594, 40189518, 636491594, "Lostraat"), - new Val( 177, 124913579, 40189518, 124913579, "Lostraat"), - new Val( 176, 10672044, 40189518, 10672044, "Lostraat"), - new Val( 175, 633919766, 40189518, 633919766, "Lostraat"), - new Val( 174, 10672080, 40189518, 10672080, "Heidebergstraat"), - new Val( 173, 10672083, 40189518, 10672083, "Heidebergstraat"), - new Val( 172, 79801761, 40189518, 79801761, "Heidebergstraat"), - new Val( 171, 112917249, 40189518, 112917249, "Heidebergstraat"), - new Val( 170, 112917247, 40189518, 112917247, "Heidebergstraat"), - new Val( 169, 192706264, 40189518, 192706264, "Heidebergstraat"), - new Val( 168, 318216944, 40189518, 318216944, "Heidebergstraat"), - new Val( 167, 192706265, 40189518, 192706265, "Heidebergstraat"), - new Val( 166, 586861164, 40189518, 586861164, "Heidebergstraat"), - new Val( 165, 10672031, 40189518, 10672031, "Heidebergstraat"), - new Val( 164, 10672135, 40189518, 10672135, "Koetsweg"), - new Val( 163, 608754691, 40189518, 608754691, "Koetsweg"), - new Val( 162, 608754692, 40189518, 608754692, "Koetsweg"), - new Val( 161, 10672174, 40189518, 10672174, "Gaston Eyskenslaan"), - new Val( 160, 23436182, 40189518, 23436182, "Platte-Lostraat"), - new Val( 159, 112917234, 40189518, 112917234, "Duivenstraat"), - new Val( 158, 23707216, 40189518, 23707216, "Duivenstraat"), - new Val( 157, 608754700, 40189518, 608754700, "Lijsterlaan"), - new Val( 156, 10672177, 40189518, 10672177, "Lijsterlaan"), - new Val( 155, 112917228, 40189518, 112917228, "Prins Regentplein"), - new Val( 154, 112917229, 40189518, 112917229, "Prins Regentplein"), - new Val( 153, 10672178, 40189518, 10672178, "Prins Regentplein"), - new Val( 152, 10657957, 40189518, 10657957, "Prins-Regentlaan"), - new Val( 151, 25155107, 40189518, 25155107, "Willem Coosemansstraat"), - new Val( 150, 79784138, 40189518, 79784138, "Koning Albertlaan"), - new Val( 149, 23707241, 40189518, 23707241, "Koning Albertlaan"), - new Val( 148, 112917227, 40189518, 112917227, "Koning Albertlaan"), - new Val( 147, 101619135, 40189518, 101619135, "Koning Albertlaan"), - new Val( 146, 622063635, 40189518, 622063635, "Koning Albertlaan"), - new Val( 145, 622063636, 40189518, 622063636, "Koning Albertlaan"), - new Val( 144, 101619136, 40189518, 101619136, "Koning Albertlaan"), - new Val( 143, 16377030, 40189518, 16377030, "Martelarenlaan"), - new Val( 142, 485802425, 40189518, 485802425, "Spoordijk"), - new Val( 141, 23707242, 40189518, 23707242, "Martelarenlaan"), - new Val( 140, 608715582, 40189518, 608715582, "Martelarenlaan"), - new Val( 139, 608715584, 40189518, 608715584, "Martelarenlaan"), - new Val( 138, 284832275, 40189518, 284832275, "Martelarenlaan"), - new Val( 137, 608715586, 40189518, 608715586, "Martelarenlaan"), - new Val( 136, 608715590, 40189518, 608715590, "Martelarenlaan"), - new Val( 135, 3992546, 40189518, 3992546, "Martelarenlaan"), - new Val( 134, 10230617, 40189518, 10230617, "Oude Diestsesteenweg"), - new Val( 133, 10230617, 40189518, 23707243, "Diestsesteenweg", - "Oude Diestsesteenweg - Lostraat (3)"), - - new Val( 132, 23707243, 23707243, 23707244, "Diestsesteenweg", - "Diestsesteenweg (3;370;371;373;374;475;485;524;525)"), - - new Val( 131, 12715116, 23707244, 12715116, "Diestsesteenweg"), - new Val( 130, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)"), - - new Val( 129, 663770966, 61556877, 663770966, "Diestsepoort"), - new Val( 128, 584356749, 61556877, 584356749, "Diestsepoort"), - new Val( 127, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 126, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), - - new Val( 125, 584356751, 198559166, 584356751, "Diestsepoort"), - new Val( 124, 451873773, 198559166, 451873773, "Diestsepoort"), - new Val( 123, 584356742, 198559166, 584356742, "Diestsepoort"), - new Val( 122, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 121, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), - - new Val( 120, 79264890, 76867049, 79264890, null), - new Val( 119, 79596965, 76867049, 79596965, null), - new Val( 118, 79596965, 76867049, 79596974, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), - - new Val( 117, 79596982, 79596974, 79596982, null), - new Val( 116, 79596982, 79596974, 79596987, null, - "perron 11 & 12 (3;333;334;335;433;600;630)"), - - new Val( 115, 377918658, 79596987, 377918658, null), - new Val( 114, 79596980, 79596987, 79596980, null), - new Val( 113, 79596980, 79596987, 79193579, "Tiensevest", - "perron 11 & 12 (3;333;334;335;513;600;630)"), - - new Val( 112, 79193579, 79193579, 258936980, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;616;630;658)"), - - new Val( 111, 258936980, 258936980, 79193580, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630;658)"), - - new Val( 110, 79193580, 79193580, 79193581, "Tiensevest", - "Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), - - new Val( 109, 79193581, 79193581, 78815505, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), - - new Val( 108, 78815505, 78815505, 84696751, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;616;630)"), - - new Val( 107, 79265237, 84696751, 79265237, "Tiensevest"), - new Val( 106, 79265237, 84696751, 89574079, "Tiensevest", - "Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)"), - - new Val( 105, 81522744, 89574079, 81522744, "Tiensevest"), - new Val( 104, 81522744, 89574079, 305434579, "Bondgenotenlaan", - "Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)"), - - new Val( 103, 578662093, 305434579, 578662093, "Bondgenotenlaan"), - new Val( 102, 578662092, 305434579, 578662092, "Bondgenotenlaan"), - new Val( 101, 578662095, 305434579, 578662095, "Bondgenotenlaan"), - new Val( 100, 578662094, 305434579, 578662094, "Bondgenotenlaan"), - new Val( 99, 3991636, 305434579, 3991636, "Bondgenotenlaan"), - new Val( 98, 174985125, 305434579, 174985125, "Rector De Somerplein"), - new Val( 97, 521211977, 305434579, 521211977, "Rector De Somerplein"), - new Val( 96, 521211977, 305434579, 521211976, "Rector De Somerplein", - "Rector De Somerplein - Bondgenotenlaan (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), - - new Val( 95, 16771741, 521211976, 16771741, "Rector De Somerplein"), - new Val( 94, 16771741, 521211976, 3991635, "Margarethaplein", - "Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539)"), - - new Val( 93, 521211973, 3991635, 521211973, "Margarethaplein"), - new Val( 92, 608715546, 3991635, 608715546, "Margarethaplein"), - new Val( 91, 453538107, 3991635, 453538107, "Margarethaplein"), - new Val( 90, 80194313, 3991635, 80194313, "Mathieu de Layensplein"), - new Val( 89, 293288706, 3991635, 293288706, "Mathieu de Layensplein"), - new Val( 88, 10269271, 3991635, 10269271, "Dirk Boutslaan"), - new Val( 87, 578662072, 3991635, 578662072, "Dirk Boutslaan"), - new Val( 86, 608715541, 3991635, 608715541, "Dirk Boutslaan"), - new Val( 85, 293149632, 3991635, 293149632, "Dirk Boutslaan"), - new Val( 84, 3992578, 3991635, 3992578, "Dirk Boutslaan"), - new Val( 83, 438252643, 3991635, 438252643, "Dirk Boutslaan"), - new Val( 82, 284664268, 3991635, 284664268, "Brouwersstraat"), - new Val( 81, 284664268, 3991635, 608715545, "Brouwersstraat", - "Brouwersstraat - Margarethaplein (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), - - new Val( 80, 608715543, 608715545, 608715543, "Brouwersstraat"), - new Val( 79, 608715542, 608715545, 608715542, "Brouwersstraat"), - new Val( 78, 608715544, 608715545, 608715544, "Brouwersstraat"), - new Val( 77, 284664272, 608715545, 284664272, "Brouwersstraat"), - new Val( 76, 284664272, 608715545, 147856945, "Tessenstraat - Fonteinstraat", - "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), - - new Val( 75, 123929547, 147856945, 123929547, "Kapucijnenvoer"), - new Val( 74, 123929547, 147856945, 3358673, "Biezenstraat", - "Kapucijnenvoer - Tessenstraat - Fonteinstraat (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537)"), - - new Val( 73, 578662071, 3358673, 578662071, "Sint-Jacobsplein"), - new Val( 72, 521211966, 3358673, 521211966, "Sint-Jacobsplein"), - new Val( 71, 3358671, 3358673, 3358671, "Sint-Jacobsplein"), - new Val( 70, 123929615, 3358673, 123929615, "Sint-Hubertusstraat"), - new Val( 69, 123929615, 3358673, 189453003, "Monseigneur Van Waeyenberghlaan", - "Sint-Hubertusstraat - Biezenstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;513)"), - - new Val( 68, 79289753, 189453003, 79289753, "Monseigneur Van Waeyenberghlaan"), - new Val( 67, 189453004, 189453003, 189453004, "Monseigneur Van Waeyenberghlaan"), - new Val( 66, 189453002, 189453003, 189453002, "Monseigneur Van Waeyenberghlaan"), - new Val( 65, 189453001, 189453003, 189453001, "Monseigneur Van Waeyenberghlaan"), - new Val( 64, 810592121, 189453003, 810592121, "Monseigneur Van Waeyenberghlaan"), - new Val( 63, 249333181, 189453003, 249333181, "Monseigneur Van Waeyenberghlaan"), - new Val( 62, 249333181, 189453003, 249333187, "Rotonde Het Teken", - "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395;513)"), - - new Val( 61, 249333187, 249333187, 813970230, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 60, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - new Val( 59, 41403540, 813970230, 41403538, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)"), - - new Val( 58, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 57, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 56, 159949154, 11369123, 159949154, null), - new Val( 55, 159949154, 11369123, 332258104, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 54, 78852604, 332258104, 78852604, null), - new Val( 53, 78852604, 332258104, 14508735, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 52, 14508735, 14508735, 109267438, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 51, 109267438, 109267438, 318878532, null, - "(3;333;334;335;370;371;373;374;380;513)"), - - new Val( 50, 318878532, 318878532, 100687528, null, - "(3;333;334;335;513)"), - - new Val( 49, 100687528, 100687528, 14508739, "Ring Zuid", - "(3;334;335)"), - - new Val( 48, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410)"), - - new Val( 47, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410)"), - - new Val( 46, 502328837, 502328838, 502328837, "Ring Zuid"), - new Val( 45, 8080023, 502328838, 8080023, "Ring Zuid"), - new Val( 44, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 43, 78568660, 502328838, 15945426, "Ring Noord", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 42, 502317795, 15945426, 502317795, "Ring Noord"), - new Val( 41, 810580948, 15945426, 810580948, "Ring Noord"), - new Val( 40, 502317796, 15945426, 502317796, "Ring Noord"), - new Val( 39, 112917238, 15945426, 112917238, "Ring Noord"), - new Val( 38, 608754690, 15945426, 608754690, "Ring Noord"), - new Val( 37, 377918625, 15945426, 377918625, "Ring Noord"), - - new Val( 36, 377918625, 15945426, 377918625, "Ring Noord", - "Ring Noord (3)") - ); - - testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LUBBEEK_KERK_VIA_PELLENBERG); + expectedValues = Arrays.asList( + new Val( 12, 377918658, 0, 377918658, null), + new Val( 13, 377918658, 78815527, 78815527, null), + new Val("perron 11 & 12 (395;600;651;652)", - // *********************************************************** - // Line 3 has the particularity that there are 2 variants - // The longer version has a spoon to serve another hospital - // This is testing the longer version completely - // From Lubbeek, over Pellenberg to Leuven Gasthuisberg - // *********************************************************** + 14, 377918658, 78815527, 23691157, "Diestsepoort"), + new Val( 15, 23691157, 116797180, 116797180, "Diestsepoort"), + new Val("Diestsepoort (4;5;6;7;8;9;179;334;335;337;380;600;616;651;652;658)", - expectedValues = Arrays.asList( - new Val( 221, 377918626, 377918626, 377918626, "Ring Noord"), - new Val( 220, 243915691, 377918626, 243915691, "Ring Noord"), - new Val( 219, 126304975, 377918626, 126304975, null), - new Val( 218, 326736776, 377918626, 326736776, null), - new Val( 217, 333580518, 377918626, 333580518, null), - new Val( 216, 608754690, 377918626, 608754690, "Ring Noord"), - new Val( 215, 112917238, 377918626, 112917238, "Ring Noord"), - new Val( 214, 502317797, 377918626, 502317797, "Ring Noord"), - new Val( 213, 112917239, 377918626, 112917239, "Ring Noord"), - new Val( 212, 112917239, 377918626, 3752557, "Rotonde Het Teken", - "Ring Noord (3)"), - - new Val( 211, 3752557, 3752557, 249333188, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410)"), - - new Val( 210, 249333188, 249333188, 249333187, "Rotonde Het Teken", - "Rotonde Het Teken (3;410)"), - - new Val( 209, 249333187, 249333187, 813970230, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 208, 41403540, 813970230, 41403540, "Rotonde Het Teken"), - new Val( 207, 41403540, 813970230, 41403538, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;513)"), - - new Val( 206, 79340950, 41403538, 79340950, "Ring Zuid"), - new Val( 205, 79340950, 41403538, 11369123, "Ring Zuid", - "Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 204, 159949154, 11369123, 159949154, null), - new Val( 203, 159949154, 11369123, 332258104, null, - "Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;513)"), - - new Val( 202, 78852604, 332258104, 78852604, null), - new Val( 201, 78852604, 332258104, 377918641, null, - "(3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)"), - - new Val( 200, 14508736, 377918641, 14508736, null), - new Val( 199, 14508736, 377918641, 109267436, "Ring Zuid", - "(3;317;395;410;601)"), - - new Val( 198, 109267436, 109267436, 14508739, "Ring Zuid", - "Ring Zuid (3;317;395;410)"), - - new Val( 197, 14508739, 14508739, 14508740, "Ring Zuid", - "Ring Zuid (3;317;334;335;395;410)"), - - new Val( 196, 14508740, 14508740, 502328838, "Ring Zuid", - "Ring Zuid (3;317;334;335;380;395;410)"), - - new Val( 195, 502328837, 502328838, 502328837, "Ring Zuid"), - new Val( 194, 8080023, 502328838, 8080023, "Ring Zuid"), - new Val( 193, 78568660, 502328838, 78568660, "Rotonde Het Teken"), - new Val( 192, 78568660, 502328838, 78873921, "Rotonde Het Teken", - "Rotonde Het Teken - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)"), - - new Val( 191, 78873921, 78873921, 3752557, "Rotonde Het Teken", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410)"), - - new Val( 190, 3752557, 3752557, 249333183, "Monseigneur Van Waeyenberghlaan", - "Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410)"), - - new Val( 189, 810592121, 249333183, 810592121, "Monseigneur Van Waeyenberghlaan"), - new Val( 188, 189453001, 249333183, 189453001, "Monseigneur Van Waeyenberghlaan"), - new Val( 187, 189453002, 249333183, 189453002, "Monseigneur Van Waeyenberghlaan"), - new Val( 186, 189453004, 249333183, 189453004, "Monseigneur Van Waeyenberghlaan"), - new Val( 185, 79289753, 249333183, 79289753, "Monseigneur Van Waeyenberghlaan"), - new Val( 184, 189453003, 249333183, 189453003, "Monseigneur Van Waeyenberghlaan"), - new Val( 183, 189453003, 249333183, 123929615, "Sint-Hubertusstraat", - "Monseigneur Van Waeyenberghlaan (3;317;333;334;335;370;371;373;374;380;395)"), - - new Val( 182, 3358671, 123929615, 3358671, "Sint-Jacobsplein"), - new Val( 181, 521211966, 123929615, 521211966, "Sint-Jacobsplein"), - new Val( 180, 578662071, 123929615, 578662071, "Sint-Jacobsplein"), - new Val( 179, 3358673, 123929615, 3358673, "Biezenstraat"), - new Val( 178, 3358673, 123929615, 123929547, "Kapucijnenvoer", - "Biezenstraat - Sint-Hubertusstraat (3;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395)"), - - new Val( 177, 147856945, 123929547, 147856945, "Tessenstraat - Fonteinstraat"), - new Val( 176, 147856945, 123929547, 284664272, "Brouwersstraat", - "Tessenstraat - Fonteinstraat - Kapucijnenvoer (3;7;8;9;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)"), - - new Val( 175, 608715544, 284664272, 608715544, "Brouwersstraat"), - new Val( 174, 608715542, 284664272, 608715542, "Brouwersstraat"), - new Val( 173, 608715543, 284664272, 608715543, "Brouwersstraat"), - new Val( 172, 608715545, 284664272, 608715545, "Brouwersstraat"), - new Val( 171, 608715545, 284664272, 284664268, "Brouwersstraat", - "Brouwersstraat (3;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)"), - - new Val( 170, 438252643, 284664268, 438252643, "Dirk Boutslaan"), - new Val( 169, 3992578, 284664268, 3992578, "Dirk Boutslaan"), - new Val( 168, 293149632, 284664268, 293149632, "Dirk Boutslaan"), - new Val( 167, 608715541, 284664268, 608715541, "Dirk Boutslaan"), - new Val( 166, 578662072, 284664268, 578662072, "Dirk Boutslaan"), - new Val( 165, 10269271, 284664268, 10269271, "Dirk Boutslaan"), - new Val( 164, 293288706, 284664268, 293288706, "Mathieu de Layensplein"), - new Val( 163, 80194313, 284664268, 80194313, "Mathieu de Layensplein"), - new Val( 162, 453538107, 284664268, 453538107, "Margarethaplein"), - new Val( 161, 608715546, 284664268, 608715546, "Margarethaplein"), - new Val( 160, 521211973, 284664268, 521211973, "Margarethaplein"), - new Val( 159, 3991635, 284664268, 3991635, "Margarethaplein"), - new Val( 158, 3991635, 284664268, 16771741, "Rector De Somerplein", - "Margarethaplein - Brouwersstraat (3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;586)"), - - new Val( 157, 521211976, 16771741, 521211976, "Rector De Somerplein"), - new Val( 156, 521211977, 16771741, 521211977, "Rector De Somerplein"), - new Val( 155, 174985125, 16771741, 174985125, "Rector De Somerplein"), - new Val( 154, 3991636, 16771741, 3991636, "Bondgenotenlaan"), - new Val( 153, 578662094, 16771741, 578662094, "Bondgenotenlaan"), - new Val( 152, 578662095, 16771741, 578662095, "Bondgenotenlaan"), - new Val( 151, 578662092, 16771741, 578662092, "Bondgenotenlaan"), - new Val( 150, 578662093, 16771741, 578662093, "Bondgenotenlaan"), - new Val( 149, 305434579, 16771741, 305434579, "Bondgenotenlaan"), - new Val( 148, 305434579, 16771741, 81522744, "Tiensevest", - "Bondgenotenlaan - Rector De Somerplein (2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586)"), - - new Val( 147, 89574079, 81522744, 89574079, "Tiensevest"), - new Val( 146, 89574079, 81522744, 79265237, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;333;334;335;351;352;358;370;371;373;374;380;395;520;524;525;537;539;586)"), - - new Val( 145, 79265237, 79265237, 79211473, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;315;316;317;351;352;358;395;520;524;525;537;539;586)"), - - new Val( 144, 79211473, 79211473, 79605527, null, - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;658)"), - - new Val( 143, 79605524, 79605527, 79605524, null), - new Val( 142, 377918661, 79605527, 377918661, null), - new Val( 141, 79596984, 79605527, 79596984, null), - new Val( 140, 377918662, 79605527, 377918662, null), - new Val( 139, 79596971, 79605527, 79596971, null), - new Val( 138, 79596971, 79605527, 377918635, null, - "perron 3 & 4 (3;4;5;6;7;8;9)"), - - new Val( 137, 377918635, 377918635, 79264888, null, - "(3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512)"), - - new Val( 136, 79264888, 79264888, 79264897, null, - "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;525)"), - - new Val( 135, 71754927, 79264897, 71754927, null), - new Val( 134, 71754927, 79264897, 79596965, null, - "(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525;601)"), - - new Val( 133, 79264890, 79596965, 79264890, null), - new Val( 132, 76867049, 79596965, 76867049, null), - new Val( 131, 76867049, 79596965, 451873774, "Diestsepoort", - "(2;3;4;5;6;7;8;9;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525)"), - - new Val( 130, 584356742, 451873774, 584356742, "Diestsepoort"), - new Val( 129, 584356742, 451873774, 451873773, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)"), - - new Val( 128, 584356751, 451873773, 584356751, "Diestsepoort"), - new Val( 127, 198559166, 451873773, 198559166, "Diestsepoort"), - new Val( 126, 584356745, 451873773, 584356745, "Diestsepoort"), - new Val( 125, 584356749, 451873773, 584356749, "Diestsepoort"), - new Val( 124, 663770966, 451873773, 663770966, "Diestsepoort"), - new Val( 123, 61556877, 451873773, 61556877, "Diestsepoort"), - new Val( 122, 61556877, 451873773, 8109264, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), - - new Val( 121, 125835524, 8109264, 125835524, "Diestsesteenweg"), - new Val( 120, 23707244, 8109264, 23707244, "Diestsesteenweg"), - new Val( 119, 23707244, 8109264, 23707243, "Diestsesteenweg", - "Diestsesteenweg - Diestsepoort (2;3;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), - - new Val( 118, 23707243, 23707243, 10230617, "Oude Diestsesteenweg", - "Diestsesteenweg (3;370;371;373;374;475;485;524;525)"), - - new Val( 117, 3992546, 10230617, 3992546, "Martelarenlaan"), - new Val( 116, 608715590, 10230617, 608715590, "Martelarenlaan"), - new Val( 115, 608715586, 10230617, 608715586, "Martelarenlaan"), - new Val( 114, 284832275, 10230617, 284832275, "Martelarenlaan"), - new Val( 113, 608715584, 10230617, 608715584, "Martelarenlaan"), - new Val( 112, 608715582, 10230617, 608715582, "Martelarenlaan"), - new Val( 111, 23707242, 10230617, 23707242, "Martelarenlaan"), - new Val( 110, 485802425, 10230617, 485802425, "Spoordijk"), - new Val( 109, 16377030, 10230617, 16377030, "Martelarenlaan"), - new Val( 108, 101619136, 10230617, 101619136, "Koning Albertlaan"), - new Val( 107, 622063636, 10230617, 622063636, "Koning Albertlaan"), - new Val( 106, 622063635, 10230617, 622063635, "Koning Albertlaan"), - new Val( 105, 101619135, 10230617, 101619135, "Koning Albertlaan"), - new Val( 104, 12195285, 10230617, 12195285, "Koning Albertlaan"), - new Val( 103, 25155107, 10230617, 25155107, "Willem Coosemansstraat"), - new Val( 102, 10657957, 10230617, 10657957, "Prins-Regentlaan"), - new Val( 101, 10672178, 10230617, 10672178, "Prins Regentplein"), - new Val( 100, 112917229, 10230617, 112917229, "Prins Regentplein"), - new Val( 99, 112917228, 10230617, 112917228, "Prins Regentplein"), - new Val( 98, 10672177, 10230617, 10672177, "Lijsterlaan"), - new Val( 97, 608754700, 10230617, 608754700, "Lijsterlaan"), - new Val( 96, 112917233, 10230617, 112917233, "Lijsterlaan"), - new Val( 95, 608754699, 10230617, 608754699, "Lijsterlaan"), - new Val( 94, 10672176, 10230617, 10672176, "Duivenstraat"), - new Val( 93, 112917234, 10230617, 112917234, "Duivenstraat"), - new Val( 92, 23436182, 10230617, 23436182, "Platte-Lostraat"), - new Val( 91, 10672174, 10230617, 10672174, "Gaston Eyskenslaan"), - new Val( 90, 608754692, 10230617, 608754692, "Koetsweg"), - new Val( 89, 608754691, 10230617, 608754691, "Koetsweg"), - new Val( 88, 10672135, 10230617, 10672135, "Koetsweg"), - new Val( 87, 10672031, 10230617, 10672031, "Heidebergstraat"), - new Val( 86, 586861164, 10230617, 586861164, "Heidebergstraat"), - new Val( 85, 192706265, 10230617, 192706265, "Heidebergstraat"), - new Val( 84, 318216944, 10230617, 318216944, "Heidebergstraat"), - new Val( 83, 192706264, 10230617, 192706264, "Heidebergstraat"), - new Val( 82, 112917248, 10230617, 112917248, "Heidebergstraat"), - new Val( 81, 79801760, 10230617, 79801760, "Heidebergstraat"), - new Val( 80, 61596758, 10230617, 61596758, "Heidebergstraat"), - new Val( 79, 10672083, 10230617, 10672083, "Heidebergstraat"), - new Val( 78, 10672080, 10230617, 10672080, "Heidebergstraat"), - new Val( 77, 633919766, 10230617, 633919766, "Lostraat"), - new Val( 76, 10672044, 10230617, 10672044, "Lostraat"), - new Val( 75, 124913579, 10230617, 124913579, "Lostraat"), - new Val( 74, 636491594, 10230617, 636491594, "Lostraat"), - new Val( 73, 636491595, 10230617, 636491595, "Lostraat"), - new Val( 72, 350992067, 10230617, 350992067, "Lostraat"), - new Val( 71, 351196789, 10230617, 351196789, "Lostraat"), - new Val( 70, 40189518, 10230617, 40189518, "Lostraat"), - new Val( 69, 40189518, 10230617, 112917224, "Ganzendries", - "Lostraat - Oude Diestsesteenweg (3)"), - - new Val( 68, 319264895, 112917224, 319264895, "Ganzendries"), - new Val( 67, 27682732, 112917224, 27682732, "Sint Barbaradreef"), - new Val( 66, 527248228, 112917224, 527248228, null), - new Val( 65, 27686451, 112917224, 27686451, null), - new Val( 64, 847554912, 112917224, 847554912, null), - new Val( 63, 847554912, 112917224, 27686453, null, - "Sint Barbaradreef - Ganzendries (3)"), - - new Val( 62, 110643012, 27686453, 110643012, null), - new Val( 61, 112917220, 27686453, 112917220, null), - new Val( 60, 70869366, 27686453, 70869366, null), - new Val( 59, 27682735, 27686453, 27682735, null), - new Val( 58, 319269351, 27686453, 319269351, "Sint Barbaradreef"), - new Val( 57, 112917225, 27686453, 112917225, "Sint Barbaradreef"), - new Val( 56, 112917225, 27686453, 847554912, null, - "Sint Barbaradreef (3)"), - - new Val( 55, 27686451, 847554912, 27686451, null), - new Val( 54, 527248228, 847554912, 527248228, null), - new Val( 53, 27682732, 847554912, 27682732, "Sint Barbaradreef"), - new Val( 52, 319264895, 847554912, 319264895, "Ganzendries"), - new Val( 51, 112917224, 847554912, 112917224, "Ganzendries"), - new Val( 50, 112917224, 847554912, 16377612, "Kapelstraat", - "Ganzendries - Sint Barbaradreef (3)"), - - new Val( 49, 16377722, 16377612, 16377722, "Kapelstraat"), - new Val( 48, 636950670, 16377612, 636950670, "Kapelstraat"), - new Val( 47, 319269331, 16377612, 319269331, "Kapelstraat"), - new Val( 46, 10658839, 16377612, 10658839, "Lubbeekstraat"), - new Val( 45, 232474772, 16377612, 232474772, "Lubbeekstraat"), - new Val( 44, 27688813, 16377612, 27688813, "Bollenberg"), - new Val( 43, 645048305, 16377612, 645048305, "Bollenberg"), - new Val( 42, 694551612, 16377612, 694551612, "Bollenberg"), - new Val( 41, 112917100, 16377612, 112917100, "Bollenberg"), - new Val( 40, 81197019, 16377612, 81197019, "Bollenberg"), - new Val( 39, 81197019, 16377612, 125835541, "Dorpskring", - "Bollenberg - Kapelstraat (3)"), - - new Val( 38, 125835541, 125835541, 81083332, "Dorpskring", - "Dorpskring (3;373;485)"), - - new Val( 37, 125835543, 81083332, 125835543, "Dorpskring"), - new Val( 36, 125835543, 81083332, 608754701, "Dorpskring", - "Dorpskring (3;373;485)"), - - new Val( 35, 608754701, 608754701, 608754701, "Dorpskring", - "Dorpskring (3;373;485)") - ); + 16, 23691157, 116797180, 451873774, "Diestsepoort"), + new Val( 17, 451873774, 584356742, 584356742, "Diestsepoort"), + new Val( 18, 451873774, 451873773, 451873773, "Diestsepoort"), + new Val( 19, 451873774, 584356751, 584356751, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + + 20, 451873774, 584356751, 198559166, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - testPtLine(expectedValues, PT_ROUTE_BUS_3_TO_LEUVEN_VIA_PELLENBERG); + 21, 198559166, 198559166, 584356745, "Diestsepoort"), + new Val( 22, 584356745, 584356749, 584356749, "Diestsepoort"), + new Val( 23, 584356745, 663770966, 663770966, "Diestsepoort"), + new Val( 24, 584356745, 61556877, 61556877, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + + 25, 584356745, 61556877, 8109264, "Diestsepoort"), + new Val( 26, 8109264, 4061640, 4061640, "Vuurkruisenlaan"), + new Val( 27, 8109264, 23691160, 23691160, "Vuurkruisenlaan"), + new Val("Diestsepoort - Vuurkruisenlaan (305;333;334;335;513;600;630;651;652;658)", + + 28, 8109264, 23691160, 61540068, "Joanna-Maria Artoisplein"), + new Val( 29, 61540068, 254801390, 254801390, "Joanna-Maria Artoisplein"), + new Val("Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)", + + 30, 61540068, 254801390, 61540098, "Joanna-Maria Artoisplein"), + new Val( 31, 61540098, 8131040, 8131040, "Lüdenscheidsingel"), + new Val( 32, 61540098, 44932919, 44932919, "Lüdenscheidsingel"), + new Val( 33, 61540098, 12891213, 12891213, "Lüdenscheidsingel"), + new Val("Joanna-Maria Artoisplein - Lüdenscheidsingel (178;305;318;410;600;651;652;658)", + + 34, 61540098, 12891213, 85048201, "Lüdenscheidsingel"), + new Val( 35, 85048201, 3877104, 3877104, null), + new Val( 36, 85048201, 125835586, 125835586, "Den Boschsingel"), + new Val( 37, 85048201, 146171867, 146171867, "Den Boschsingel"), + new Val("Lüdenscheidsingel - Den Boschsingel (318;410;600;651;658)", + + 38, 85048201, 146171867, 23837543, "Den Boschsingel"), + new Val( 39, 23837543, 192559625, 192559625, "Den Boschsingel"), + new Val( 40, 23837543, 3680457, 3680457, "Rennes-Singel"), + new Val( 41, 23837543, 8131123, 8131123, "Rennes-Singel"), + new Val( 42, 23837543, 225605633, 225605633, "Rennes-Singel"), + new Val("Den Boschsingel - Rennes-Singel (318;410;600)", + + 43, 23837543, 225605633, 78568454, "Rennes-Singel"), + new Val("Rennes-Singel (178;318;410;600)", + + 44, 78568454, 78568454, 270181177, "Herestraat"), + new Val("Herestraat (410;600)", + + 45, 270181177, 270181177, 813970228, "Herestraat"), + new Val( 46, 813970228, 813970226, 813970226, "Herestraat"), + new Val( 47, 813970228, 813970232, 813970232, "Herestraat"), + new Val( 48, 813970228, 13067134, 13067134, "Herestraat"), + new Val("Herestraat (410;600;601)", + + 49, 813970228, 13067134, 249333187, "Rotonde Het Teken"), + new Val("Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 50, 249333187, 249333187, 249333188, "Rotonde Het Teken (MgrVWB)"), + new Val("Rotonde Het Teken (MgrVWB) (3;410;600;601)", + + 51, 249333188, 249333188, 3752557, "Rotonde Het Teken (to Ring Noord)"), + new Val("Rotonde Het Teken (to Ring Noord) (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + + 52, 3752557, 3752557, 78873921, "Rotonde Het Teken (Ring Noord)"), + new Val("Rotonde Het Teken (Ring Noord) (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + + 53, 78873921, 78873921, 78568660, "Rotonde Het Teken (from Ring Noord)"), + new Val( 54, 78568660, 8080023, 8080023, "Ring Zuid"), + new Val( 55, 78568660, 502328837, 502328837, "Ring Zuid"), + new Val( 56, 78568660, 502328838, 502328838, "Ring Zuid"), + new Val("Rotonde Het Teken (from Ring Noord) - Ring Zuid (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", + + 57, 78568660, 502328838, 14508740, "Ring Zuid (1 - 2)"), + new Val("Ring Zuid (1 - 2) (3;317;334;335;380;395;410;600;601)", + + 58, 14508740, 14508740, 14508739, "Ring Zuid (2 - 3)"), + new Val("Ring Zuid (2 - 3) (3;317;334;335;395;410;600;601)", + + 59, 14508739, 14508739, 109267436, "Ring Zuid (3 - 4&5)"), + new Val("Ring Zuid (3 - 4&5) (3;317;395;410;600;601)", + + 60, 109267436, 109267436, 14506241, null), + new Val( 61, 14506241, 318878531, 318878531, null), + new Val("perron 4 (3;317;395;410;600)", + + 62, 14506241, 318878531, 14508735, null), + new Val("(3;317;333;334;335;370;371;373;374;380;395;410;513;600)", + + 63, 14508735, 14508735, 78852604, null), + new Val( 64, 78852604, 332258104, 332258104, null), + new Val("GHB (ingang) - GHB (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 65, 78852604, 332258104, 159949154, null), + new Val("(from GHB to Ring Zuid) (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 66, 159949154, 159949154, 11369123, "Ring Zuid (GHB)"), + new Val("Ring Zuid (GHB) (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 67, 11369123, 11369123, 79340950, "Ring Zuid"), + new Val( 68, 79340950, 41403538, 41403538, "Rotonde Het Teken"), + new Val("Ring Zuid - Rotonde Het Teken (3;317;333;334;335;370;371;373;374;380;395;410;513;600;601)", + + 69, 79340950, 41403538, 8079995, "Herestraat"), + new Val( 70, 8079995, 41403544, 41403544, "Herestraat"), + new Val( 71, 8079995, 813970227, 813970227, "Herestraat"), + new Val("Herestraat (410;600;601)", + + 72, 8079995, 813970227, 78568455, "Herestraat"), + new Val("Herestraat (600)", + + 73, 78568455, 78568455, 28982660, "Rennes-Singel"), + new Val( 74, 28982660, 813979473, 813979473, "Rennes-Singel"), + new Val( 75, 28982660, 192559626, 192559626, "Rennes-Singel"), + new Val( 76, 28982660, 813979469, 813979469, "Rennes-Singel"), + new Val( 77, 28982660, 192559627, 192559627, "Rennes-Singel"), + new Val("Rennes-Singel (178;318;600)", + + 78, 28982660, 192559627, 3677945, "Tervuursevest"), + new Val( 79, 3677945, 521193383, 521193383, "Tervuursevest"), + new Val( 80, 3677945, 521193382, 521193382, "Tervuursevest"), + new Val( 81, 3677945, 813979466, 813979466, "Tervuursevest"), + new Val( 82, 3677945, 80194318, 80194318, "Tervuursevest"), + new Val( 83, 3677945, 814322832, 814322832, "Tervuursevest"), + new Val( 84, 3677945, 15051052, 15051052, "Tervuursevest"), + new Val( 85, 3677945, 3677336, 3677336, "Tervuursevest"), + new Val( 86, 3677945, 608715519, 608715519, "Tervuursevest"), + new Val( 87, 3677945, 608715518, 608715518, "Tervuursevest"), + new Val("Tervuursevest (178;600)", + + 88, 3677945, 608715518, 16771609, "Tervuursevest"), + new Val( 89, 16771609, 260405216, 260405216, "Tervuursevest"), + new Val("Tervuursevest (7;8;9;178;527;600)", + + 90, 16771609, 260405216, 13246158, "Tervuursevest"), + new Val("Tervuursevest (7;8;9;178;520;524;525;527;537;586;600)", + + 91, 13246158, 13246158, 16771611, "Tervuursevest"), + new Val("Tervuursevest (178;520;524;525;537;586;600)", + + 92, 16771611, 16771611, 85044922, "Tervuursevest"), + new Val( 93, 85044922, 608715615, 608715615, "Tervuursevest"), + new Val( 94, 85044922, 608715614, 608715614, "Tervuursevest"), + new Val( 95, 85044922, 3677329, 3677329, "Tervuursevest"), + new Val( 96, 85044922, 90168774, 90168774, "Tervuursevest"), + new Val("Tervuursevest (178;179;520;524;525;537;586;600)", + + 97, 85044922, 90168774, 120086003, "Tervuursevest"), + new Val( 98, 120086003, 3677822, 3677822, "Erasme Ruelensvest"), + new Val("Tervuursevest - Erasme Ruelensvest (178;179;600)", + + 99, 120086003, 3677822, 608715579, "Erasme Ruelensvest"), + new Val( 100, 608715579, 608715575, 608715575, "Erasme Ruelensvest"), + new Val( 101, 608715579, 120086001, 120086001, "Erasme Ruelensvest"), + new Val( 102, 608715579, 3991775, 3991775, "Geldenaaksevest"), + new Val("Erasme Ruelensvest - Geldenaaksevest (18;178;179;337;600;616)", + + 103, 608715579, 3991775, 199381120, "Geldenaaksevest"), + new Val( 104, 199381120, 24905254, 24905254, "Geldenaaksevest"), + new Val( 105, 199381120, 491728135, 491728135, "Geldenaaksevest"), + new Val("Geldenaaksevest (18;178;179;337;600;616;630)", + + 106, 199381120, 491728135, 24905255, "Geldenaaksevest"), + new Val( 107, 24905255, 24905256, 24905256, "Geldenaaksevest"), + new Val( 108, 24905255, 863272996, 863272996, "Geldenaaksevest"), + new Val( 109, 24905255, 857806575, 857806575, "Geldenaaksevest"), + new Val( 110, 24905255, 857806576, 857806576, "Geldenaaksevest"), + new Val( 111, 24905255, 857806574, 857806574, "Geldenaaksevest"), + new Val( 112, 24905255, 8130905, 8130905, "Geldenaaksevest"), + new Val("Geldenaaksevest (178;179;337;600;630)", + + 113, 24905255, 8130905, 4003928, "Tiensepoort"), + new Val("Tiensepoort (18;178;179;337;600;616;630)", + + 114, 4003928, 4003928, 521193611, "Tiensevest"), + new Val( 115, 521193611, 586268892, 586268892, "Tiensevest"), + new Val( 116, 521193611, 863272997, 863272997, "Tiensevest"), + new Val( 117, 521193611, 521193609, 521193609, "Tiensevest"), + new Val("Tiensevest (7;8;9;178;179;337;380;600;630)", + + 118, 521193611, 521193609, 4003927, "Tiensevest"), + new Val("Tiensevest (7;8;9;18;178;179;337;380;600;616;630)", + + 119, 4003927, 4003927, 8154434, "Tiensevest"), + new Val( 120, 8154434, 15083398, 15083398, "Tiensevest"), + new Val( 121, 8154434, 185988816, 185988816, "Tiensevest"), + new Val("Tiensevest (7;8;9;18;179;337;380;600;616;630)", + + 122, 8154434, 185988816, 185988814, "Tiensevest"), + new Val( 123, 185988814, 19793223, 19793223, "Tiensevest"), + new Val("Tiensevest (1;4;5;6;7;8;9;18;179;337;380;600;616;630)", + + 124, 185988814, 19793223, 81522744, "Tiensevest"), + new Val( 125, 81522744, 89574079, 89574079, "Tiensevest"), + new Val("Tiensevest (1;2;3;4;5;6;7;8;9;18;179;284;285;315;316;317;333;334;335;337;351;352;358;370;371;373;374;380;395;513;520;524;525;527;537;539;600;616;630)", + + 126, 81522744, 89574079, 79265237, "Tiensevest"), + new Val( 127, 79265237, 84696751, 84696751, "Tiensevest"), + new Val("Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;527;600;616;630)", + + 128, 79265237, 84696751, 78815505, "Tiensevest"), + new Val("Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + + 129, 78815505, 78815505, 79193581, "Tiensevest"), + new Val("Tiensevest (2;3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + + 130, 79193581, 79193581, 79193580, "Tiensevest"), + new Val("Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630)", + + 131, 79193580, 79193580, 258936980, "Tiensevest"), + new Val("Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;370;371;373;374;380;513;520;524;525;600;616;630;658)", + + 132, 258936980, 258936980, 79193579, "Tiensevest"), + new Val("Tiensevest (3;4;5;6;7;8;9;18;179;333;334;335;337;380;513;600;601;616;630;658)", + + 133, 79193579, 79193579, 79596980, null), + new Val( 134, 79596980, 377918658, 377918658, null), + new Val("perron 11 & 12 (3;333;334;335;513;600;630)", + + 135, 79596980, 377918658, 79596987, null), + new Val("perron 11 & 12 (3;333;334;335;513;600;630)", + + 136, 79596987, 79596987, 79596982, null), + new Val( 137, 79596982, 79596974, 79596974, null), + new Val("perron 11 & 12 (3;333;334;335;433;600;630)", + + 138, 79596982, 79596974, 79596965, null), + new Val( 139, 79596965, 79264890, 79264890, null), + new Val( 140, 79596965, 76867049, 76867049, null), + new Val("(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + + 141, 79596965, 76867049, 451873774, "Diestsepoort"), + new Val( 142, 451873774, 584356742, 584356742, "Diestsepoort"), + new Val( 143, 451873774, 451873773, 451873773, "Diestsepoort"), + new Val( 144, 451873774, 584356751, 584356751, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + + 145, 451873774, 584356751, 198559166, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + + 146, 198559166, 198559166, 584356745, "Diestsepoort"), + new Val( 147, 584356745, 584356749, 584356749, "Diestsepoort"), + new Val( 148, 584356745, 663770966, 663770966, "Diestsepoort"), + new Val( 149, 584356745, 61556877, 61556877, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + + 150, 584356745, 61556877, 8109264, "Diestsepoort"), + new Val( 151, 8109264, 4061640, 4061640, "Vuurkruisenlaan"), + new Val( 152, 8109264, 23691160, 23691160, "Vuurkruisenlaan"), + new Val("Diestsepoort - Vuurkruisenlaan (305;333;334;335;513;600;630;651;652;658)", + + 153, 8109264, 23691160, 61540068, "Joanna-Maria Artoisplein"), + new Val( 154, 61540068, 254801390, 254801390, "Joanna-Maria Artoisplein"), + new Val("Joanna-Maria Artoisplein (178;305;318;333;334;335;410;513;600;630;651;652;658)", + + 155, 61540068, 254801390, 340265962, "Redersstraat"), + new Val("Redersstraat (333;334;335;513;600;630)", + + 156, 340265962, 340265962, 318825613, "Redersstraat"), + new Val( 157, 318825613, 340265961, 340265961, "Redersstraat"), + new Val("Redersstraat (600)", + + 158, 318825613, 340265961, 304241967, "Aarschotsesteenweg"), + new Val( 159, 304241967, 304241968, 304241968, "Havenkant"), + new Val("Aarschotsesteenweg - Havenkant (334;335;513;600;630)", + + 160, 304241967, 304241968, 29283599, "Havenkant"), + new Val( 161, 29283599, 510790348, 510790348, "Havenkant"), + new Val( 162, 29283599, 314635787, 314635787, "Havenkant"), + new Val( 163, 29283599, 843534478, 843534478, "Havenkant"), + new Val( 164, 29283599, 406205781, 406205781, "Havenkant"), + new Val( 165, 29283599, 270181176, 270181176, "Havenkant"), + new Val( 166, 29283599, 330300725, 330300725, "Havenkant"), + new Val( 167, 29283599, 3869822, 3869822, "Burchtstraat"), + new Val( 168, 29283599, 330300723, 330300723, "Achter de latten"), + new Val( 169, 29283599, 659297690, 659297690, "Wolvengang"), + new Val( 170, 29283599, 25928482, 25928482, "Wolvengang"), + new Val( 171, 29283599, 3869812, 3869812, "Engels Plein"), + new Val( 172, 29283599, 305316104, 305316104, "Engels Plein"), + new Val( 173, 29283599, 338057819, 338057819, "Engels Plein"), + new Val("Havenkant - Engels Plein (600)", + + 174, 29283599, 608715622, 0, "Engels Plein") + ); + + testPtLine(expectedValues, PT_ROUTE_BUS_600_TO_LEUVEN_VAARTKOM); // *********************************************************** // Line 310 has 3 variants @@ -1534,240 +765,246 @@ public void bus601_600_3_Test() { // Aarschot station, making a spoon loop in Holsbeek // *********************************************************** - expectedValues = Arrays.asList( - new Val( 213, 13856192, 13856192, 13856192, null), - new Val( 212, 100289896, 13856192, 100289896, "Statieplein"), - new Val( 211, 100289896, 13856192, 100289859, "Statieplein", - "Statieplein (310;334;335)"), - - new Val( 210, 100289892, 100289859, 100289892, "Statieplein"), - new Val( 209, 100289852, 100289859, 100289852, "Statieplein"), - new Val( 208, 125101590, 100289859, 125101590, "Statieplein"), - new Val( 207, 101376793, 100289859, 101376793, "Statiestraat"), - new Val( 206, 41405911, 100289859, 41405911, "Statiestraat"), - new Val( 205, 41405911, 100289859, 125101554, "Albertlaan", - "Statiestraat - Statieplein (305;306;310;334;335)"), - - new Val( 204, 125101554, 125101554, 13892080, "Albertlaan", - "Albertlaan (305;306;310;334;335;513)"), - - new Val( 203, 412810122, 13892080, 412810122, "Leuvensesteenweg"), - new Val( 202, 125101584, 13892080, 125101584, "Leuvensesteenweg"), - new Val( 201, 125101584, 13892080, 188863432, "Leuvensesteenweg", - "Leuvensesteenweg - Albertlaan (310;334;335;513)"), - - new Val( 200, 125101583, 188863432, 125101583, "Leuvensesteenweg"), - new Val( 199, 125101583, 188863432, 345152127, "Steenweg op Sint-Joris-Winge", - "Leuvensesteenweg (305;306;310;334;335;513)"), - - new Val( 198, 412810127, 345152127, 412810127, "Steenweg op Sint-Joris-Winge"), - new Val( 197, 345152132, 345152127, 345152132, "Steenweg op Sint-Joris-Winge"), - new Val( 196, 602060323, 345152127, 602060323, "Steenweg op Sint-Joris-Winge"), - new Val( 195, 181252214, 345152127, 181252214, "Steenweg op Sint-Joris-Winge"), - new Val( 194, 102853195, 345152127, 102853195, "Steenweg op Sint-Joris-Winge"), - new Val( 193, 345152123, 345152127, 345152123, "Steenweg op Sint-Joris-Winge"), - new Val( 192, 345088986, 345152127, 345088986, "Steenweg op Sint-Joris-Winge"), - new Val( 191, 112565995, 345152127, 112565995, "Steenweg op Sint-Joris-Winge"), - new Val( 190, 102853233, 345152127, 102853233, null), - new Val( 189, 345088979, 345152127, 345088979, "Steenweg op Sint-Joris-Winge"), - new Val( 188, 345088980, 345152127, 345088980, "Steenweg op Sint-Joris-Winge"), - new Val( 187, 13226856, 345152127, 13226856, "Steenweg op Sint-Joris-Winge"), - new Val( 186, 137111763, 345152127, 137111763, "Steenweg op Sint-Joris-Winge"), - new Val( 185, 521257383, 345152127, 521257383, "Steenweg op Sint-Joris-Winge"), - new Val( 184, 521257382, 345152127, 521257382, "Steenweg op Sint-Joris-Winge"), - new Val( 183, 26431904, 345152127, 26431904, "Nieuwrodesesteenweg"), - new Val( 182, 345078866, 345152127, 345078866, "Nieuwrodesesteenweg"), - new Val( 181, 345078870, 345152127, 345078870, "Steenweg op Sint-Joris-Winge"), - new Val( 180, 345078865, 345152127, 345078865, "Steenweg op Sint-Joris-Winge"), - new Val( 179, 136845549, 345152127, 136845549, "Nieuwrodesesteenweg"), - new Val( 178, 22870199, 345152127, 22870199, "Rijksweg"), - new Val( 177, 345078875, 345152127, 345078875, "Rijksweg"), - new Val( 176, 13856508, 345152127, 13856508, "Rijksweg Aarschot-Winge"), - new Val( 175, 13856508, 345152127, 345078877, "Rijksweg", - "Rijksweg Aarschot-Winge - Steenweg op Sint-Joris-Winge (305;306;310)"), - - new Val( 174, 345078878, 345078877, 345078878, "Rijksweg"), - new Val( 173, 38208830, 345078877, 38208830, "Rijksweg"), - new Val( 172, 38208831, 345078877, 38208831, "Rijksweg"), - new Val( 171, 609510456, 345078877, 609510456, "Rijksweg"), - new Val( 170, 609510455, 345078877, 609510455, "Rijksweg"), - new Val( 169, 151083447, 345078877, 151083447, "Sint-Lambertusstraat"), - new Val( 168, 137613438, 345078877, 137613438, "Sint-Lambertusstraat"), - new Val( 167, 187995152, 345078877, 187995152, "Dorp"), - new Val( 166, 10242649, 345078877, 10242649, "Dorp"), - new Val( 165, 137613417, 345078877, 137613417, "Appelweg"), - new Val( 164, 112565994, 345078877, 112565994, "Appelweg"), - new Val( 163, 10242646, 345078877, 10242646, "Rodestraat"), - new Val( 162, 615260297, 345078877, 615260297, "Rodestraat"), - new Val( 161, 137613436, 345078877, 137613436, "Rodestraat"), - new Val( 160, 318267938, 345078877, 318267938, "Rodestraat"), - new Val( 159, 318267937, 345078877, 318267937, "Rodestraat"), - new Val( 158, 117329495, 345078877, 117329495, "Rodestraat"), - new Val( 157, 182275361, 345078877, 182275361, "Rodestraat"), - new Val( 156, 182275362, 345078877, 182275362, "Rodestraat"), - new Val( 155, 118479385, 345078877, 118479385, "Rodestraat"), - new Val( 154, 13858504, 345078877, 13858504, "Rodestraat"), - new Val( 153, 137613435, 345078877, 137613435, "Rodestraat"), - new Val( 152, 23334102, 345078877, 23334102, "Gravenstraat"), - new Val( 151, 13858501, 345078877, 13858501, "Gravenstraat"), - new Val( 150, 38501970, 345078877, 38501970, "Gravenstraat"), - new Val( 149, 13858502, 345078877, 13858502, "Gravenstraat"), - new Val( 148, 13858500, 345078877, 13858500, "Gravenstraat"), - new Val( 147, 182275357, 345078877, 182275357, "Gravenstraat"), - new Val( 146, 540115503, 345078877, 540115503, "Gravenstraat"), - new Val( 145, 13858519, 345078877, 13858519, "Dutselstraat"), - new Val( 144, 185929630, 345078877, 185929630, "Dutselstraat"), - new Val( 143, 137613419, 345078877, 137613419, "Dutselstraat"), - new Val( 142, 185929632, 345078877, 185929632, "Dutselstraat"), - new Val( 141, 185929631, 345078877, 185929631, "Dutselstraat"), - new Val( 140, 310306260, 345078877, 310306260, "Dutselstraat"), - new Val( 139, 22724214, 345078877, 22724214, "Dutselstraat"), - new Val( 138, 310306259, 345078877, 310306259, "Dutselstraat"), - new Val( 137, 310306431, 345078877, 310306431, "Kortrijksebaan"), - new Val( 136, 38502235, 345078877, 38502235, "Kortrijksebaan"), - new Val( 135, 659289513, 345078877, 659289513, "Kortrijksebaan"), - new Val( 134, 441280731, 345078877, 441280731, "Kortrijksebaan"), - new Val( 133, 659289514, 345078877, 659289514, "Kortrijksebaan"), - new Val( 132, 19112638, 345078877, 19112638, "Kortrijksebaan"), - new Val( 131, 310435230, 345078877, 310435230, "Kortrijksebaan"), - new Val( 130, 23957648, 345078877, 23957648, "Kortrijksebaan"), - new Val( 129, 173566709, 345078877, 173566709, "Kortrijksebaan"), - new Val( 128, 13858520, 345078877, 13858520, "Kortrijksebaan"), - new Val( 127, 181347876, 345078877, 181347876, "Kortrijksebaan"), - new Val( 126, 19166177, 345078877, 19166177, "Kortrijksebaan"), - new Val( 125, 310435229, 345078877, 310435229, "Kortrijksebaan"), - new Val( 124, 450119553, 345078877, 450119553, "Kortrijksebaan"), - new Val( 123, 181347873, 345078877, 181347873, "Nobelberg"), - new Val( 122, 16302925, 345078877, 16302925, "Nobelberg"), - new Val( 121, 16302925, 345078877, 64487963, "Rotselaarsebaan", - "Nobelberg - Rijksweg (310)"), - - new Val( 120, 310435233, 64487963, 310435233, "Rotselaarsebaan"), - new Val( 119, 310435233, 64487963, 112566004, "Sint-Maurusstraat", - "Rotselaarsebaan (310)"), - - new Val( 118, 16302928, 112566004, 16302928, null), - new Val( 117, 25667798, 112566004, 25667798, "Rotselaarsebaan"), - new Val( 116, 25667798, 112566004, 310435233, "Rotselaarsebaan", - "Rotselaarsebaan - Sint-Maurusstraat (310)"), - - new Val( 115, 64487963, 310435233, 64487963, "Rotselaarsebaan"), - new Val( 114, 64487963, 310435233, 310435232, "Nobelberg", - "Rotselaarsebaan (310)"), - - new Val( 113, 19166179, 310435232, 19166179, "Nobelberg"), - new Val( 112, 492765776, 310435232, 492765776, "Nobelberg"), - new Val( 111, 310461931, 310435232, 310461931, "Nobelberg"), - new Val( 110, 37370702, 310435232, 37370702, "Nobelberg"), - new Val( 109, 16302927, 310435232, 16302927, "Leuvensebaan"), - new Val( 108, 16302926, 310435232, 16302926, "Leuvensebaan"), - new Val( 107, 440732697, 310435232, 440732697, "Leuvensebaan"), - new Val( 106, 311007037, 310435232, 311007037, "Leuvensebaan"), - new Val( 105, 311007042, 310435232, 311007042, "Leuvensebaan"), - new Val( 104, 311007035, 310435232, 311007035, "Leuvensebaan"), - new Val( 103, 311007040, 310435232, 311007040, "Leuvensebaan"), - new Val( 102, 192559618, 310435232, 192559618, "Leuvensebaan"), - new Val( 101, 311007036, 310435232, 311007036, "Leuvensebaan"), - new Val( 100, 311007033, 310435232, 311007033, "Leuvensebaan"), - new Val( 99, 311007041, 310435232, 311007041, "Leuvensebaan"), - new Val( 98, 311007034, 310435232, 311007034, "Leuvensebaan"), - new Val( 97, 311007039, 310435232, 311007039, "Leuvensebaan"), - new Val( 96, 311007038, 310435232, 311007038, "Leuvensebaan"), - new Val( 95, 10699037, 310435232, 10699037, "Leuvensebaan"), - new Val( 94, 14393833, 310435232, 14393833, "Leuvensebaan"), - new Val( 93, 18943297, 310435232, 18943297, "Wilselsesteenweg"), - new Val( 92, 192559637, 310435232, 192559637, "Wilselsesteenweg"), - new Val( 91, 114935420, 310435232, 114935420, "Wilselsesteenweg"), - new Val( 90, 243884410, 310435232, 243884410, "Wilselsesteenweg"), - new Val( 89, 243884410, 310435232, 98645243, "Wilselsesteenweg", - "Wilselsesteenweg - Nobelberg (310)"), - - new Val( 88, 98645223, 98645243, 98645223, "Wilselsesteenweg"), - new Val( 87, 38209648, 98645243, 38209648, "Wilselsesteenweg"), - new Val( 86, 125835556, 98645243, 125835556, "Kesseldallaan"), - new Val( 85, 112566013, 98645243, 112566013, "Kesseldallaan"), - new Val( 84, 112566013, 98645243, 112566017, "Kesseldallaan", - "Kesseldallaan - Wilselsesteenweg (2;310)"), - - new Val( 83, 112566021, 112566017, 112566021, "Kesseldallaan"), - new Val( 82, 440732696, 112566017, 440732696, "Kesseldallaan"), - new Val( 81, 112566010, 112566017, 112566010, "Kesseldallaan"), - new Val( 80, 440732694, 112566017, 440732694, "Kesseldallaan"), - new Val( 79, 440732695, 112566017, 440732695, "Kesseldallaan"), - new Val( 78, 112566011, 112566017, 112566011, "Kesseldallaan"), - new Val( 77, 112565986, 112566017, 112565986, "Kesseldallaan"), - new Val( 76, 242622340, 112566017, 242622340, "Kesseldallaan"), - new Val( 75, 242622340, 112566017, 33233154, "Kesseldallaan", - "Kesseldallaan (2;179;306;310;433)"), - - new Val( 74, 33233154, 33233154, 112566015, "Eénmeilaan", - "Kesseldallaan (2;179;306;310;433)"), - - new Val( 73, 80284458, 112566015, 80284458, "Eénmeilaan"), - new Val( 72, 38245753, 112566015, 38245753, "Eénmeilaan"), - new Val( 71, 38245752, 112566015, 38245752, "Eénmeilaan"), - new Val( 70, 138017385, 112566015, 138017385, "Eénmeilaan"), - new Val( 69, 125835546, 112566015, 125835546, "Eénmeilaan"), - new Val( 68, 180167956, 112566015, 180167956, "Eénmeilaan"), - new Val( 67, 608715591, 112566015, 608715591, "Eénmeilaan"), - new Val( 66, 608715592, 112566015, 608715592, "Eénmeilaan"), - new Val( 65, 22476094, 112566015, 22476094, "Eénmeilaan"), - new Val( 64, 138017384, 112566015, 138017384, "Eénmeilaan"), - new Val( 63, 138017382, 112566015, 138017382, "Eénmeilaan"), - new Val( 62, 22476095, 112566015, 22476095, "Eénmeilaan"), - new Val( 61, 138017381, 112566015, 138017381, "Eénmeilaan"), - new Val( 60, 125835547, 112566015, 125835547, "Eénmeilaan"), - new Val( 59, 125835547, 112566015, 79366165, "Baron August de Becker Remyplein", - "Eénmeilaan (179;306;310;433)"), - - new Val( 58, 79366165, 79366165, 79366167, "Baron August de Becker Remyplein", - "Baron August de Becker Remyplein (2;179;306;310;433;520)"), - - new Val( 57, 79366164, 79366167, 79366164, "Baron August de Becker Remyplein"), - new Val( 56, 35633068, 79366167, 35633068, "Baron August de Becker Remyplein"), - new Val( 55, 608715602, 79366167, 608715602, "Baron August de Becker Remyplein"), - new Val( 54, 608715601, 79366167, 608715601, "Baron August de Becker Remyplein"), - new Val( 53, 608715604, 79366167, 608715604, "Baron August de Becker Remyplein"), - new Val( 52, 608715603, 79366167, 608715603, "Baron August de Becker Remyplein"), - new Val( 51, 429571921, 79366167, 429571921, "Baron August de Becker Remyplein"), - new Val( 50, 125835568, 79366167, 125835568, "Leuvensestraat"), - new Val( 49, 125835568, 79366167, 23707244, "Diestsesteenweg", - "Leuvensestraat - Baron August de Becker Remyplein (2;179;306;310;433;520)"), - - new Val( 48, 12715116, 23707244, 12715116, "Diestsesteenweg"), - new Val( 47, 12715116, 23707244, 61556877, "Diestsepoort", - "Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)"), - - new Val( 46, 663770966, 61556877, 663770966, "Diestsepoort"), - new Val( 45, 584356749, 61556877, 584356749, "Diestsepoort"), - new Val( 44, 584356745, 61556877, 584356745, "Diestsepoort"), - new Val( 43, 584356745, 61556877, 198559166, "Diestsepoort", - "Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)"), - - new Val( 42, 584356751, 198559166, 584356751, "Diestsepoort"), - new Val( 41, 451873773, 198559166, 451873773, "Diestsepoort"), - new Val( 40, 584356742, 198559166, 584356742, "Diestsepoort"), - new Val( 39, 451873774, 198559166, 451873774, "Diestsepoort"), - new Val( 38, 451873774, 198559166, 76867049, null, - "Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)"), - - new Val( 37, 79264890, 76867049, 79264890, null), - new Val( 36, 79596965, 76867049, 79596965, null), - new Val( 35, 79596965, 76867049, 71754927, null, - "(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)"), - - new Val( 34, 71754927, 71754927, 79264897, null, - "(2;310;370;371;373;374;475;485;513;520;524;525)"), - - new Val( 33, 79596983, 79264897, 79596983, null), - new Val( 32, 79596983, 79264897, 377918665, null, - "(2;3;310)"), - - new Val( 31, 377918665, 377918665, 377918665, null, - "perron 7 & 8 (2;3;310)") - ); - - testPtLine(expectedValues, PT_ROUTE_BUS_310_FROM_LEUVEN_TO_AARSCHOT_STATION); + expectedValues = Arrays.asList( + new Val( 32, 377918665, 0, 377918665, null), + new Val( 33, 377918665, 79596983, 79596983, null), + new Val( 34, 377918665, 79264897, 79264897, null), + new Val("perron 7 & 8 (2;3;310)", + + 35, 377918665, 79264897, 71754927, null), + new Val("(2;3;310;370;371;373;374;475;485;513;520;524;525)", + + 36, 71754927, 71754927, 79596965, null), + new Val( 37, 79596965, 79264890, 79264890, null), + new Val( 38, 79596965, 76867049, 76867049, null), + new Val("(2;3;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630)", + + 39, 79596965, 76867049, 451873774, "Diestsepoort"), + new Val( 40, 451873774, 584356742, 584356742, "Diestsepoort"), + new Val( 41, 451873774, 451873773, 451873773, "Diestsepoort"), + new Val( 42, 451873774, 584356751, 584356751, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + + 43, 451873774, 584356751, 198559166, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", + + 44, 198559166, 198559166, 584356745, "Diestsepoort"), + new Val( 45, 584356745, 584356749, 584356749, "Diestsepoort"), + new Val( 46, 584356745, 663770966, 663770966, "Diestsepoort"), + new Val( 47, 584356745, 61556877, 61556877, "Diestsepoort"), + new Val("Diestsepoort (2;3;179;305;306;310;333;334;335;370;371;373;374;433;475;485;513;520;524;525;600;630;651;652;658)", + + 48, 584356745, 61556877, 12715116, "Diestsesteenweg"), + new Val( 49, 12715116, 23707244, 23707244, "Diestsesteenweg"), + new Val("Diestsesteenweg (2;3;179;306;310;370;371;373;374;433;475;485;520;524;525)", + + 50, 12715116, 23707244, 125835568, "Leuvensestraat"), + new Val( 51, 125835568, 429571921, 429571921, "Baron August de Becker Remyplein"), + new Val( 52, 125835568, 608715603, 608715603, "Baron August de Becker Remyplein"), + new Val( 53, 125835568, 608715604, 608715604, "Baron August de Becker Remyplein"), + new Val( 54, 125835568, 608715601, 608715601, "Baron August de Becker Remyplein"), + new Val( 55, 125835568, 608715602, 608715602, "Baron August de Becker Remyplein"), + new Val( 56, 125835568, 35633068, 35633068, "Baron August de Becker Remyplein"), + new Val( 57, 125835568, 79366164, 79366164, "Baron August de Becker Remyplein"), + new Val( 58, 125835568, 79366167, 79366167, "Baron August de Becker Remyplein"), + new Val("Leuvensestraat - Baron August de Becker Remyplein (2;179;306;310;433;520)", + + 59, 125835568, 79366167, 79366165, "Baron August de Becker Remyplein"), + new Val("Baron August de Becker Remyplein (2;179;306;310;433;520)", + + 60, 79366165, 79366165, 125835547, "Eénmeilaan"), + new Val( 61, 125835547, 138017381, 138017381, "Eénmeilaan"), + new Val( 62, 125835547, 22476095, 22476095, "Eénmeilaan"), + new Val( 63, 125835547, 138017382, 138017382, "Eénmeilaan"), + new Val( 64, 125835547, 138017384, 138017384, "Eénmeilaan"), + new Val( 65, 125835547, 22476094, 22476094, "Eénmeilaan"), + new Val( 66, 125835547, 608715592, 608715592, "Eénmeilaan"), + new Val( 67, 125835547, 608715591, 608715591, "Eénmeilaan"), + new Val( 68, 125835547, 180167956, 180167956, "Eénmeilaan"), + new Val( 69, 125835547, 125835546, 125835546, "Eénmeilaan"), + new Val( 70, 125835547, 138017385, 138017385, "Eénmeilaan"), + new Val( 71, 125835547, 38245752, 38245752, "Eénmeilaan"), + new Val( 72, 125835547, 38245753, 38245753, "Eénmeilaan"), + new Val( 73, 125835547, 80284458, 80284458, "Eénmeilaan"), + new Val( 74, 125835547, 112566015, 112566015, "Eénmeilaan"), + new Val("Eénmeilaan (179;306;310;433)", + + 75, 125835547, 112566015, 33233154, "Kesseldallaan"), + new Val("Kesseldallaan (2;179;306;310;433)", + + 76, 33233154, 33233154, 242622340, "Kesseldallaan"), + new Val( 77, 242622340, 112565986, 112565986, "Kesseldallaan"), + new Val( 78, 242622340, 112566011, 112566011, "Kesseldallaan"), + new Val( 79, 242622340, 440732695, 440732695, "Kesseldallaan"), + new Val( 80, 242622340, 440732694, 440732694, "Kesseldallaan"), + new Val( 81, 242622340, 112566010, 112566010, "Kesseldallaan"), + new Val( 82, 242622340, 440732696, 440732696, "Kesseldallaan"), + new Val( 83, 242622340, 112566021, 112566021, "Kesseldallaan"), + new Val( 84, 242622340, 112566017, 112566017, "Kesseldallaan"), + new Val("Kesseldallaan (2;179;306;310;433)", + + 85, 242622340, 112566017, 112566013, "Kesseldallaan"), + new Val( 86, 112566013, 125835556, 125835556, "Kesseldallaan"), + new Val( 87, 112566013, 38209648, 38209648, "Wilselsesteenweg"), + new Val( 88, 112566013, 98645223, 98645223, "Wilselsesteenweg"), + new Val("Kesseldallaan - Wilselsesteenweg (2;310)", + + 89, 112566013, 98645223, 98645243, "Wilselsesteenweg"), + new Val("Wilselsesteenweg (2;310)", + + 90, 98645243, 98645243, 243884410, "Wilselsesteenweg"), + new Val( 91, 243884410, 114935420, 114935420, "Wilselsesteenweg"), + new Val( 92, 243884410, 192559637, 192559637, "Wilselsesteenweg"), + new Val( 93, 243884410, 18943297, 18943297, "Wilselsesteenweg"), + new Val( 94, 243884410, 14393833, 14393833, "Leuvensebaan"), + new Val( 95, 243884410, 10699037, 10699037, "Leuvensebaan"), + new Val( 96, 243884410, 311007038, 311007038, "Leuvensebaan"), + new Val( 97, 243884410, 311007039, 311007039, "Leuvensebaan"), + new Val( 98, 243884410, 311007034, 311007034, "Leuvensebaan"), + new Val( 99, 243884410, 311007041, 311007041, "Leuvensebaan"), + new Val( 100, 243884410, 311007033, 311007033, "Leuvensebaan"), + new Val( 101, 243884410, 311007036, 311007036, "Leuvensebaan"), + new Val( 102, 243884410, 192559618, 192559618, "Leuvensebaan"), + new Val( 103, 243884410, 311007040, 311007040, "Leuvensebaan"), + new Val( 104, 243884410, 311007035, 311007035, "Leuvensebaan"), + new Val( 105, 243884410, 311007042, 311007042, "Leuvensebaan"), + new Val( 106, 243884410, 311007037, 311007037, "Leuvensebaan"), + new Val( 107, 243884410, 440732697, 440732697, "Leuvensebaan"), + new Val( 108, 243884410, 16302926, 16302926, "Leuvensebaan"), + new Val( 109, 243884410, 16302927, 16302927, "Leuvensebaan"), + new Val( 110, 243884410, 37370702, 37370702, "Nobelberg"), + new Val( 111, 243884410, 310461931, 310461931, "Nobelberg"), + new Val( 112, 243884410, 492765776, 492765776, "Nobelberg"), + new Val( 113, 243884410, 19166179, 19166179, "Nobelberg"), + new Val("Wilselsesteenweg - Nobelberg (310)", + + 114, 243884410, 19166179, 310435232, "Nobelberg"), + new Val("Nobelberg (310)", + + 115, 310435232, 310435232, 64487963, "Rotselaarsebaan"), + new Val("Rotselaarsebaan (310)", + + 116, 64487963, 64487963, 310435233, "Rotselaarsebaan"), + new Val( 117, 310435233, 25667798, 25667798, "Rotselaarsebaan"), + new Val( 118, 310435233, 16302928, 16302928, null), + new Val("Rotselaarsebaan (310)", + + 119, 310435233, 16302928, 112566004, "Sint-Maurusstraat"), + new Val("Sint-Maurusstraat (310)", + + 120, 112566004, 112566004, 310435233, "Rotselaarsebaan"), + new Val("Rotselaarsebaan (310)", + + 121, 310435233, 310435233, 64487963, "Rotselaarsebaan"), + new Val( 122, 64487963, 16302925, 16302925, "Nobelberg"), + new Val( 123, 64487963, 181347873, 181347873, "Nobelberg"), + new Val( 124, 64487963, 450119553, 450119553, "Kortrijksebaan"), + new Val( 125, 64487963, 310435229, 310435229, "Kortrijksebaan"), + new Val( 126, 64487963, 19166177, 19166177, "Kortrijksebaan"), + new Val( 127, 64487963, 181347876, 181347876, "Kortrijksebaan"), + new Val( 128, 64487963, 13858520, 13858520, "Kortrijksebaan"), + new Val( 129, 64487963, 173566709, 173566709, "Kortrijksebaan"), + new Val( 130, 64487963, 23957648, 23957648, "Kortrijksebaan"), + new Val( 131, 64487963, 310435230, 310435230, "Kortrijksebaan"), + new Val( 132, 64487963, 19112638, 19112638, "Kortrijksebaan"), + new Val( 133, 64487963, 659289514, 659289514, "Kortrijksebaan"), + new Val( 134, 64487963, 441280731, 441280731, "Kortrijksebaan"), + new Val( 135, 64487963, 659289513, 659289513, "Kortrijksebaan"), + new Val( 136, 64487963, 38502235, 38502235, "Kortrijksebaan"), + new Val( 137, 64487963, 310306431, 310306431, "Kortrijksebaan"), + new Val( 138, 64487963, 310306259, 310306259, "Dutselstraat"), + new Val( 139, 64487963, 22724214, 22724214, "Dutselstraat"), + new Val( 140, 64487963, 310306260, 310306260, "Dutselstraat"), + new Val( 141, 64487963, 185929631, 185929631, "Dutselstraat"), + new Val( 142, 64487963, 185929632, 185929632, "Dutselstraat"), + new Val( 143, 64487963, 137613419, 137613419, "Dutselstraat"), + new Val( 144, 64487963, 185929630, 185929630, "Dutselstraat"), + new Val( 145, 64487963, 13858519, 13858519, "Dutselstraat"), + new Val( 146, 64487963, 540115503, 540115503, "Gravenstraat"), + new Val( 147, 64487963, 182275357, 182275357, "Gravenstraat"), + new Val( 148, 64487963, 13858500, 13858500, "Gravenstraat"), + new Val( 149, 64487963, 13858502, 13858502, "Gravenstraat"), + new Val( 150, 64487963, 38501970, 38501970, "Gravenstraat"), + new Val( 151, 64487963, 13858501, 13858501, "Gravenstraat"), + new Val( 152, 64487963, 23334102, 23334102, "Gravenstraat"), + new Val( 153, 64487963, 137613435, 137613435, "Rodestraat"), + new Val( 154, 64487963, 13858504, 13858504, "Rodestraat"), + new Val( 155, 64487963, 118479385, 118479385, "Rodestraat"), + new Val( 156, 64487963, 182275362, 182275362, "Rodestraat"), + new Val( 157, 64487963, 182275361, 182275361, "Rodestraat"), + new Val( 158, 64487963, 117329495, 117329495, "Rodestraat"), + new Val( 159, 64487963, 318267937, 318267937, "Rodestraat"), + new Val( 160, 64487963, 318267938, 318267938, "Rodestraat"), + new Val( 161, 64487963, 137613436, 137613436, "Rodestraat"), + new Val( 162, 64487963, 615260297, 615260297, "Rodestraat"), + new Val( 163, 64487963, 10242646, 10242646, "Rodestraat"), + new Val( 164, 64487963, 112565994, 112565994, "Appelweg"), + new Val( 165, 64487963, 137613417, 137613417, "Appelweg"), + new Val( 166, 64487963, 10242649, 10242649, "Dorp"), + new Val( 167, 64487963, 187995152, 187995152, "Dorp"), + new Val( 168, 64487963, 137613438, 137613438, "Sint-Lambertusstraat"), + new Val( 169, 64487963, 151083447, 151083447, "Sint-Lambertusstraat"), + new Val( 170, 64487963, 609510455, 609510455, "Rijksweg"), + new Val( 171, 64487963, 609510456, 609510456, "Rijksweg"), + new Val( 172, 64487963, 38208831, 38208831, "Rijksweg"), + new Val( 173, 64487963, 38208830, 38208830, "Rijksweg"), + new Val( 174, 64487963, 345078878, 345078878, "Rijksweg"), + new Val( 175, 64487963, 345078877, 345078877, "Rijksweg"), + new Val("Rotselaarsebaan - Rijksweg (310)", + + 176, 64487963, 345078877, 13856508, "Rijksweg Aarschot-Winge"), + new Val( 177, 13856508, 345078875, 345078875, "Rijksweg"), + new Val( 178, 13856508, 22870199, 22870199, "Rijksweg"), + new Val( 179, 13856508, 136845549, 136845549, "Nieuwrodesesteenweg"), + new Val( 180, 13856508, 345078865, 345078865, "Steenweg op Sint-Joris-Winge"), + new Val( 181, 13856508, 345078870, 345078870, "Steenweg op Sint-Joris-Winge"), + new Val( 182, 13856508, 345078866, 345078866, "Nieuwrodesesteenweg"), + new Val( 183, 13856508, 26431904, 26431904, "Nieuwrodesesteenweg"), + new Val( 184, 13856508, 521257382, 521257382, "Steenweg op Sint-Joris-Winge"), + new Val( 185, 13856508, 521257383, 521257383, "Steenweg op Sint-Joris-Winge"), + new Val( 186, 13856508, 137111763, 137111763, "Steenweg op Sint-Joris-Winge"), + new Val( 187, 13856508, 13226856, 13226856, "Steenweg op Sint-Joris-Winge"), + new Val( 188, 13856508, 345088980, 345088980, "Steenweg op Sint-Joris-Winge"), + new Val( 189, 13856508, 345088979, 345088979, "Steenweg op Sint-Joris-Winge"), + new Val( 190, 13856508, 102853233, 102853233, null), + new Val( 191, 13856508, 112565995, 112565995, "Steenweg op Sint-Joris-Winge"), + new Val( 192, 13856508, 345088986, 345088986, "Steenweg op Sint-Joris-Winge"), + new Val( 193, 13856508, 345152123, 345152123, "Steenweg op Sint-Joris-Winge"), + new Val( 194, 13856508, 102853195, 102853195, "Steenweg op Sint-Joris-Winge"), + new Val( 195, 13856508, 181252214, 181252214, "Steenweg op Sint-Joris-Winge"), + new Val( 196, 13856508, 602060323, 602060323, "Steenweg op Sint-Joris-Winge"), + new Val( 197, 13856508, 345152132, 345152132, "Steenweg op Sint-Joris-Winge"), + new Val( 198, 13856508, 412810127, 412810127, "Steenweg op Sint-Joris-Winge"), + new Val( 199, 13856508, 345152127, 345152127, "Steenweg op Sint-Joris-Winge"), + new Val("Rijksweg Aarschot-Winge - Steenweg op Sint-Joris-Winge (305;306;310)", + + 200, 13856508, 345152127, 125101583, "Leuvensesteenweg"), + new Val( 201, 125101583, 188863432, 188863432, "Leuvensesteenweg"), + new Val("Leuvensesteenweg (305;306;310;334;335;513)", + + 202, 125101583, 188863432, 125101584, "Leuvensesteenweg"), + new Val( 203, 125101584, 412810122, 412810122, "Leuvensesteenweg"), + new Val( 204, 125101584, 13892080, 13892080, "Albertlaan"), + new Val("Leuvensesteenweg - Albertlaan (310;334;335;513)", + + 205, 125101584, 13892080, 125101554, "Albertlaan"), + new Val("Albertlaan (305;306;310;334;335;513)", + + 206, 125101554, 125101554, 41405911, "Statiestraat"), + new Val( 207, 41405911, 101376793, 101376793, "Statiestraat"), + new Val( 208, 41405911, 125101590, 125101590, "Statieplein"), + new Val( 209, 41405911, 100289852, 100289852, "Statieplein"), + new Val( 210, 41405911, 100289892, 100289892, "Statieplein"), + new Val( 211, 41405911, 100289859, 100289859, "Statieplein"), + new Val("Statiestraat - Statieplein (305;306;310;334;335)", + + 212, 41405911, 100289859, 100289896, "Statieplein"), + new Val("Statieplein (310;334;335)", + + 213, 100289896, 13856192, 0, "Statieplein") + ); + + testPtLine(expectedValues, PT_ROUTE_BUS_310_TO_AARSCHOT_STATION); // *********************************************************** // Line 433 is an express bus @@ -1776,226 +1013,231 @@ public void bus601_600_3_Test() { // Line 333 has the same issue, but 433 is a bit shorter // *********************************************************** - expectedValues = Arrays.asList( - new Val( 167, 78579065, 78579065, 78579065, null), - new Val( 166, 377814547, 78579065, 377814547, null), - new Val( 165, 377814547, 78579065, 79596986, null, - "perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)"), - - new Val( 164, 79596986, 79596986, 79211473, "Tiensevest", - "(305;306;310;318;358;410;433;475;485;658)"), - - new Val( 163, 79211473, 79211473, 79211472, "Tiensevest", - "Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;658)"), - - new Val( 162, 79211472, 79211472, 79175435, "Tiensevest", - "Tiensevest (1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;658)"), - - new Val( 161, 79175435, 79175435, 80458208, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;651;652;658)"), - - new Val( 160, 80458208, 80458208, 19793164, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;651;652;658)"), - - new Val( 159, 19793164, 19793164, 4884707, "Tiensevest", - "Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;651;652;658)"), - - new Val( 158, 116797179, 4884707, 116797179, "Diestsepoort"), - new Val( 157, 116797180, 4884707, 116797180, "Diestsepoort"), - new Val( 156, 116797180, 4884707, 451873774, "Diestsepoort", - "Diestsepoort - Tiensevest (306;310;433)"), - - new Val( 155, 584356742, 451873774, 584356742, "Diestsepoort"), - new Val( 154, 584356742, 451873774, 451873773, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)"), - - new Val( 153, 584356751, 451873773, 584356751, "Diestsepoort"), - new Val( 152, 198559166, 451873773, 198559166, "Diestsepoort"), - new Val( 151, 584356745, 451873773, 584356745, "Diestsepoort"), - new Val( 150, 584356749, 451873773, 584356749, "Diestsepoort"), - new Val( 149, 663770966, 451873773, 663770966, "Diestsepoort"), - new Val( 148, 61556877, 451873773, 61556877, "Diestsepoort"), - new Val( 147, 61556877, 451873773, 8109264, "Diestsepoort", - "Diestsepoort (2;3;178;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), - - new Val( 146, 125835524, 8109264, 125835524, "Diestsesteenweg"), - new Val( 145, 23707244, 8109264, 23707244, "Diestsesteenweg"), - new Val( 144, 23707244, 8109264, 125835568, "Leuvensestraat", - "Diestsesteenweg - Diestsepoort (2;3;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)"), - - new Val( 143, 429571921, 125835568, 429571921, "Baron August de Becker Remyplein"), - new Val( 142, 608715603, 125835568, 608715603, "Baron August de Becker Remyplein"), - new Val( 141, 608715604, 125835568, 608715604, "Baron August de Becker Remyplein"), - new Val( 140, 608715601, 125835568, 608715601, "Baron August de Becker Remyplein"), - new Val( 139, 608715602, 125835568, 608715602, "Baron August de Becker Remyplein"), - new Val( 138, 35633068, 125835568, 35633068, "Baron August de Becker Remyplein"), - new Val( 137, 125835500, 125835568, 125835500, "Baron August de Becker Remyplein"), - new Val( 136, 125835500, 125835568, 125835547, "Eénmeilaan", - "Baron August de Becker Remyplein - Leuvensestraat (2;179;306;310;333;433;512;520)"), - - new Val( 135, 138017386, 125835547, 138017386, "Eénmeilaan"), - new Val( 134, 138017384, 125835547, 138017384, "Eénmeilaan"), - new Val( 133, 22476094, 125835547, 22476094, "Eénmeilaan"), - new Val( 132, 608715592, 125835547, 608715592, "Eénmeilaan"), - new Val( 131, 608715591, 125835547, 608715591, "Eénmeilaan"), - new Val( 130, 138017383, 125835547, 138017383, "Eénmeilaan"), - new Val( 129, 138017385, 125835547, 138017385, "Eénmeilaan"), - new Val( 128, 38245752, 125835547, 38245752, "Eénmeilaan"), - new Val( 127, 38245753, 125835547, 38245753, "Eénmeilaan"), - new Val( 126, 80284458, 125835547, 80284458, "Eénmeilaan"), - new Val( 125, 112566018, 125835547, 112566018, "Eénmeilaan"), - new Val( 124, 112566018, 125835547, 242622344, "Kesseldallaan", - "Eénmeilaan (179;306;310;333;433;512)"), - - new Val( 123, 125835557, 242622344, 125835557, "Kesseldallaan"), - new Val( 122, 112566011, 242622344, 112566011, "Kesseldallaan"), - new Val( 121, 440732695, 242622344, 440732695, "Kesseldallaan"), - new Val( 120, 440732694, 242622344, 440732694, "Kesseldallaan"), - new Val( 119, 112566010, 242622344, 112566010, "Kesseldallaan"), - new Val( 118, 440732696, 242622344, 440732696, "Kesseldallaan"), - new Val( 117, 13823565, 242622344, 13823565, "Kesseldallaan"), - new Val( 116, 112565989, 242622344, 112565989, "Kesseldallaan"), - new Val( 115, 112565989, 242622344, 192559635, "Duchesnelaan", - "Kesseldallaan (2;179;306;310;333;433;512)"), - - new Val( 114, 149117671, 192559635, 149117671, "Duchesnelaan"), - new Val( 113, 17540907, 192559635, 17540907, "Vuntcomplex"), - new Val( 112, 17540932, 192559635, 17540932, "Vuntcomplex"), - new Val( 111, 315666514, 192559635, 315666514, "Vuntcomplex"), - new Val( 110, 315666514, 192559635, 315666515, "Vuntcomplex", - "Vuntcomplex - Duchesnelaan (179;306;333;433;512)"), - - new Val( 109, 315666515, 315666515, 345381449, "Vuntcomplex", - "Vuntcomplex (179;306;333;433;512)"), - - new Val( 108, 225497053, 345381449, 225497053, "Vuntcomplex"), - new Val( 107, 225497053, 345381449, 345381452, "Vuntcomplex", - "Vuntcomplex (179;306;333;433;512)"), - - new Val( 106, 345381453, 345381452, 345381453, "Vuntcomplex"), - new Val( 105, 4004855, 345381452, 4004855, "Vuntcomplex"), - new Val( 104, 4004855, 345381452, 13882237, "Aarschotsesteenweg", - "Vuntcomplex (333;433;512)"), - - new Val( 103, 351000218, 13882237, 351000218, "Aarschotsesteenweg"), - new Val( 102, 440732691, 13882237, 440732691, "Aarschotsesteenweg"), - new Val( 101, 345381437, 13882237, 345381437, "Aarschotsesteenweg"), - new Val( 100, 377918607, 13882237, 377918607, "Aarschotsesteenweg"), - new Val( 99, 377918608, 13882237, 377918608, "Aarschotsesteenweg"), - new Val( 98, 37713149, 13882237, 37713149, "Aarschotsesteenweg"), - new Val( 97, 631979428, 13882237, 631979428, "Aarschotsesteenweg"), - new Val( 96, 863731643, 13882237, 863731643, "Aarschotsesteenweg"), - new Val( 95, 345381435, 13882237, 345381435, "Aarschotsesteenweg"), - new Val( 94, 79299306, 13882237, 79299306, "Aarschotsesteenweg"), - new Val( 93, 79299306, 13882237, 345381434, "Aarschotsesteenweg", - "Aarschotsesteenweg (333;334;335;433;512;513;630)"), - - new Val( 92, 38159440, 345381434, 38159440, "Aarschotsesteenweg"), - new Val( 91, 780600572, 345381434, 780600572, "Aarschotsesteenweg"), - new Val( 90, 780600573, 345381434, 780600573, "Aarschotsesteenweg"), - new Val( 89, 38159437, 345381434, 38159437, "Aarschotsesteenweg"), - new Val( 88, 16201617, 345381434, 16201617, "Aarschotsesteenweg"), - new Val( 87, 663909831, 345381434, 663909831, "Aarschotsesteenweg"), - new Val( 86, 440732693, 345381434, 440732693, "Aarschotsesteenweg"), - new Val( 85, 439397679, 345381434, 439397679, "Aarschotsesteenweg"), - new Val( 84, 441677446, 345381434, 441677446, "Aarschotsesteenweg"), - new Val( 83, 14099896, 345381434, 14099896, "Aarschotsesteenweg"), - new Val( 82, 14099966, 345381434, 14099966, "Aarschotsesteenweg"), - new Val( 81, 16201055, 345381434, 16201055, "Aarschotsesteenweg"), - new Val( 80, 16201055, 345381434, 23781189, "Stationsstraat", - "Aarschotsesteenweg (333;334;335;433;512;513)"), - - new Val( 79, 663909838, 23781189, 663909838, "Stationsstraat"), - new Val( 78, 98825487, 23781189, 98825487, "Stationsstraat"), - new Val( 77, 23024091, 23781189, 23024091, "Stationsstraat"), - new Val( 76, 23024090, 23781189, 23024090, "Stationsstraat"), - new Val( 75, 15220439, 23781189, 15220439, "Stationsstraat"), - new Val( 74, 15220439, 23781189, 13899067, "Provinciebaan", - "Stationsstraat (333;335;433;513)"), - - new Val( 73, 116535756, 13899067, 116535756, "Provinciebaan"), - new Val( 72, 116535766, 13899067, 116535766, "Provinciebaan"), - new Val( 71, 521082436, 13899067, 521082436, "Provinciebaan"), - new Val( 70, 100083559, 13899067, 100083559, "Provinciebaan"), - new Val( 69, 25706275, 13899067, 25706275, "Provinciebaan"), - new Val( 68, 25706276, 13899067, 25706276, "Provinciebaan"), - new Val( 67, 37712785, 13899067, 37712785, "Provinciebaan"), - new Val( 66, 116535777, 13899067, 116535777, "Provinciebaan"), - new Val( 65, 100086271, 13899067, 100086271, "Provinciebaan"), - new Val( 64, 100086271, 13899067, 24041208, "Provinciebaan"), - new Val( 63, 100086271, 13899067, 292670112, "Nieuwebaan"), - new Val( 62, 100086271, 13899067, 292670110, "Nieuwebaan"), - new Val( 61, 100086271, 13899067, 292670113, "Nieuwebaan", - "Provinciebaan (333;433;512;513)"), - - new Val( 60, 292670115, 292670113, 292670115, "Nieuwebaan"), - new Val( 59, 292670109, 292670113, 292670109, "Nieuwebaan"), - new Val( 58, 98918943, 292670113, 98918943, "Nieuwebaan"), - new Val( 57, 292820652, 292670113, 292820652, "Nieuwebaan"), - new Val( 56, 13858894, 292670113, 13858894, "Hoekje"), - new Val( 55, 24037032, 292670113, 24037032, "Hoekje"), - new Val( 54, 26591703, 292670113, 26591703, "Werchterplein"), - new Val( 53, 21355673, 292670113, 21355673, "Sint-Jansstraat"), - new Val( 52, 116911351, 292670113, 116911351, "Sint-Jansstraat"), - new Val( 51, 205303321, 292670113, 205303321, "Sint-Jansstraat"), - new Val( 50, 205303322, 292670113, 205303322, "Sint-Jansstraat"), - new Val( 49, 205303320, 292670113, 205303320, "Sint-Jansstraat"), - new Val( 48, 49577807, 292670113, 49577807, "Sint-Jansstraat"), - new Val( 47, 116704290, 292670113, 116704290, "Tremelobaan"), - new Val( 46, 32823731, 292670113, 32823731, "Tremelobaan"), - new Val( 45, 349648271, 292670113, 349648271, "Tremelobaan"), - new Val( 44, 25706363, 292670113, 25706363, "Tremelobaan"), - new Val( 43, 349648272, 292670113, 349648272, "Tremelobaan"), - new Val( 42, 349648273, 292670113, 349648273, "Tremelobaan"), - new Val( 41, 349648270, 292670113, 349648270, "Tremelobaan"), - new Val( 40, 25706405, 292670113, 25706405, "Tremelobaan"), - new Val( 39, 126264637, 292670113, 126264637, "Tremelobaan"), - new Val( 38, 22080651, 292670113, 22080651, "Tremelobaan"), - new Val( 37, 22080665, 292670113, 22080665, "Werchtersebaan"), - new Val( 36, 116911317, 292670113, 116911317, "Werchtersebaan"), - new Val( 35, 116911322, 292670113, 116911322, "Werchtersebaan"), - new Val( 34, 116911310, 292670113, 116911310, "Werchtersebaan"), - new Val( 33, 116911314, 292670113, 116911314, "Werchtersebaan"), - new Val( 32, 106526409, 292670113, 106526409, "Werchtersebaan"), - new Val( 31, 106526391, 292670113, 106526391, "Werchtersebaan"), - new Val( 30, 106526331, 292670113, 106526331, null), - new Val( 29, 79057173, 292670113, 79057173, null), - new Val( 28, 106526457, 292670113, 106526457, null), - new Val( 27, 25706520, 292670113, 25706520, "Schrieksebaan"), - new Val( 26, 244077928, 292670113, 244077928, "Schrieksebaan"), - new Val( 25, 79057162, 292670113, 79057162, "Schrieksebaan"), - new Val( 24, 348402887, 292670113, 348402887, "Schrieksebaan"), - new Val( 23, 116911330, 292670113, 116911330, "Schrieksebaan"), - new Val( 22, 20402695, 292670113, 20402695, "Astridstraat"), - new Val( 21, 26614159, 292670113, 26614159, null), - new Val( 20, 255018560, 292670113, 255018560, null), - new Val( 19, 845727172, 292670113, 845727172, null), - new Val( 18, 255018553, 292670113, 255018553, null), - new Val( 17, 520502050, 292670113, 520502050, null), - - new Val( 16, 520502050, 292670113, 520502050, null, - "Astridstraat - Nieuwebaan (333;433)") - ); - - testPtLine(expectedValues, PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); - -// printListOfExpectedValues(PT_ROUTE_BUS_433_FROM_TREMELO_TO_LEUVEN); + expectedValues = Arrays.asList( + new Val( 17, 520502050, 0, 520502050, null), + new Val( 18, 520502050, 255018553, 255018553, null), + new Val( 19, 520502050, 845727172, 845727172, null), + new Val( 20, 520502050, 255018560, 255018560, null), + new Val( 21, 520502050, 26614159, 26614159, null), + new Val( 22, 520502050, 20402695, 20402695, "Astridstraat"), + new Val( 23, 520502050, 116911330, 116911330, "Schrieksebaan"), + new Val( 24, 520502050, 348402887, 348402887, "Schrieksebaan"), + new Val( 25, 520502050, 79057162, 79057162, "Schrieksebaan"), + new Val( 26, 520502050, 244077928, 244077928, "Schrieksebaan"), + new Val( 27, 520502050, 25706520, 25706520, "Schrieksebaan"), + new Val( 28, 520502050, 106526457, 106526457, null), + new Val( 29, 520502050, 79057173, 79057173, null), + new Val( 30, 520502050, 106526331, 106526331, null), + new Val( 31, 520502050, 106526391, 106526391, "Werchtersebaan"), + new Val( 32, 520502050, 106526409, 106526409, "Werchtersebaan"), + new Val( 33, 520502050, 116911314, 116911314, "Werchtersebaan"), + new Val( 34, 520502050, 116911310, 116911310, "Werchtersebaan"), + new Val( 35, 520502050, 116911322, 116911322, "Werchtersebaan"), + new Val( 36, 520502050, 116911317, 116911317, "Werchtersebaan"), + new Val( 37, 520502050, 22080665, 22080665, "Werchtersebaan"), + new Val( 38, 520502050, 22080651, 22080651, "Tremelobaan"), + new Val( 39, 520502050, 126264637, 126264637, "Tremelobaan"), + new Val( 40, 520502050, 25706405, 25706405, "Tremelobaan"), + new Val( 41, 520502050, 349648270, 349648270, "Tremelobaan"), + new Val( 42, 520502050, 349648273, 349648273, "Tremelobaan"), + new Val( 43, 520502050, 349648272, 349648272, "Tremelobaan"), + new Val( 44, 520502050, 25706363, 25706363, "Tremelobaan"), + new Val( 45, 520502050, 349648271, 349648271, "Tremelobaan"), + new Val( 46, 520502050, 32823731, 32823731, "Tremelobaan"), + new Val( 47, 520502050, 116704290, 116704290, "Tremelobaan"), + new Val( 48, 520502050, 49577807, 49577807, "Sint-Jansstraat"), + new Val( 49, 520502050, 205303320, 205303320, "Sint-Jansstraat"), + new Val( 50, 520502050, 205303322, 205303322, "Sint-Jansstraat"), + new Val( 51, 520502050, 205303321, 205303321, "Sint-Jansstraat"), + new Val( 52, 520502050, 116911351, 116911351, "Sint-Jansstraat"), + new Val( 53, 520502050, 21355673, 21355673, "Sint-Jansstraat"), + new Val( 54, 520502050, 26591703, 26591703, "Werchterplein"), + new Val( 55, 520502050, 24037032, 24037032, "Hoekje"), + new Val( 56, 520502050, 13858894, 13858894, "Hoekje"), + new Val( 57, 520502050, 292820652, 292820652, "Nieuwebaan"), + new Val( 58, 520502050, 98918943, 98918943, "Nieuwebaan"), + new Val( 59, 520502050, 292670109, 292670109, "Nieuwebaan"), + new Val( 60, 520502050, 292670115, 292670115, "Nieuwebaan"), + new Val( 61, 520502050, 292670113, 292670113, "Nieuwebaan"), + new Val( 62, 520502050, 292670113, 292670110, "Nieuwebaan"), + new Val( 63, 520502050, 292670113, 292670112, "Nieuwebaan"), + new Val( 64, 520502050, 292670113, 24041208, "Provinciebaan"), + new Val("Astridstraat - Nieuwebaan (333;433)", + + 65, 520502050, 292670113, 100086271, "Provinciebaan"), + new Val( 66, 100086271, 116535777, 116535777, "Provinciebaan"), + new Val( 67, 100086271, 37712785, 37712785, "Provinciebaan"), + new Val( 68, 100086271, 25706276, 25706276, "Provinciebaan"), + new Val( 69, 100086271, 25706275, 25706275, "Provinciebaan"), + new Val( 70, 100086271, 100083559, 100083559, "Provinciebaan"), + new Val( 71, 100086271, 521082436, 521082436, "Provinciebaan"), + new Val( 72, 100086271, 116535766, 116535766, "Provinciebaan"), + new Val( 73, 100086271, 116535756, 116535756, "Provinciebaan"), + new Val( 74, 100086271, 13899067, 13899067, "Provinciebaan"), + new Val("Provinciebaan (333;433;512;513)", + + 75, 100086271, 13899067, 15220439, "Stationsstraat"), + new Val( 76, 15220439, 23024090, 23024090, "Stationsstraat"), + new Val( 77, 15220439, 23024091, 23024091, "Stationsstraat"), + new Val( 78, 15220439, 98825487, 98825487, "Stationsstraat"), + new Val( 79, 15220439, 663909838, 663909838, "Stationsstraat"), + new Val( 80, 15220439, 23781189, 23781189, "Stationsstraat"), + new Val("Stationsstraat (333;335;433;513)", + + 81, 15220439, 23781189, 16201055, "Aarschotsesteenweg"), + new Val( 82, 16201055, 14099966, 14099966, "Aarschotsesteenweg"), + new Val( 83, 16201055, 14099896, 14099896, "Aarschotsesteenweg"), + new Val( 84, 16201055, 441677446, 441677446, "Aarschotsesteenweg"), + new Val( 85, 16201055, 439397679, 439397679, "Aarschotsesteenweg"), + new Val( 86, 16201055, 440732693, 440732693, "Aarschotsesteenweg"), + new Val( 87, 16201055, 663909831, 663909831, "Aarschotsesteenweg"), + new Val( 88, 16201055, 16201617, 16201617, "Aarschotsesteenweg"), + new Val( 89, 16201055, 38159437, 38159437, "Aarschotsesteenweg"), + new Val( 90, 16201055, 780600573, 780600573, "Aarschotsesteenweg"), + new Val( 91, 16201055, 780600572, 780600572, "Aarschotsesteenweg"), + new Val( 92, 16201055, 38159440, 38159440, "Aarschotsesteenweg"), + new Val( 93, 16201055, 345381434, 345381434, "Aarschotsesteenweg"), + new Val("Aarschotsesteenweg (333;334;335;433;512;513)", + + 94, 16201055, 345381434, 79299306, "Aarschotsesteenweg"), + new Val( 95, 79299306, 345381435, 345381435, "Aarschotsesteenweg"), + new Val( 96, 79299306, 863731643, 863731643, "Aarschotsesteenweg"), + new Val( 97, 79299306, 631979428, 631979428, "Aarschotsesteenweg"), + new Val( 98, 79299306, 37713149, 37713149, "Aarschotsesteenweg"), + new Val( 99, 79299306, 377918608, 377918608, "Aarschotsesteenweg"), + new Val( 100, 79299306, 377918607, 377918607, "Aarschotsesteenweg"), + new Val( 101, 79299306, 345381437, 345381437, "Aarschotsesteenweg"), + new Val( 102, 79299306, 440732691, 440732691, "Aarschotsesteenweg"), + new Val( 103, 79299306, 351000218, 351000218, "Aarschotsesteenweg"), + new Val( 104, 79299306, 13882237, 13882237, "Aarschotsesteenweg"), + new Val("Aarschotsesteenweg (333;334;335;433;512;513;630)", + + 105, 79299306, 13882237, 4004855, "Vuntcomplex"), + new Val( 106, 4004855, 345381453, 345381453, "Vuntcomplex"), + new Val( 107, 4004855, 345381452, 345381452, "Vuntcomplex"), + new Val("Vuntcomplex (333;433;512)", + + 108, 4004855, 345381452, 225497053, "Vuntcomplex"), + new Val( 109, 225497053, 345381449, 345381449, "Vuntcomplex"), + new Val("Vuntcomplex (179;306;333;433;512)", + + 110, 225497053, 345381449, 315666515, "Vuntcomplex"), + new Val("Vuntcomplex (179;306;333;433;512)", + + 111, 315666515, 315666515, 315666514, "Vuntcomplex"), + new Val( 112, 315666514, 17540932, 17540932, "Vuntcomplex"), + new Val( 113, 315666514, 17540907, 17540907, "Vuntcomplex"), + new Val( 114, 315666514, 149117671, 149117671, "Duchesnelaan"), + new Val( 115, 315666514, 192559635, 192559635, "Duchesnelaan"), + new Val("Vuntcomplex - Duchesnelaan (179;306;333;433;512)", + + 116, 315666514, 192559635, 112565989, "Kesseldallaan"), + new Val( 117, 112565989, 13823565, 13823565, "Kesseldallaan"), + new Val( 118, 112565989, 440732696, 440732696, "Kesseldallaan"), + new Val( 119, 112565989, 112566010, 112566010, "Kesseldallaan"), + new Val( 120, 112565989, 440732694, 440732694, "Kesseldallaan"), + new Val( 121, 112565989, 440732695, 440732695, "Kesseldallaan"), + new Val( 122, 112565989, 112566011, 112566011, "Kesseldallaan"), + new Val( 123, 112565989, 125835557, 125835557, "Kesseldallaan"), + new Val( 124, 112565989, 242622344, 242622344, "Kesseldallaan"), + new Val("Kesseldallaan (2;179;306;310;333;433;512)", + + 125, 112565989, 242622344, 112566018, "Eénmeilaan"), + new Val( 126, 112566018, 80284458, 80284458, "Eénmeilaan"), + new Val( 127, 112566018, 38245753, 38245753, "Eénmeilaan"), + new Val( 128, 112566018, 38245752, 38245752, "Eénmeilaan"), + new Val( 129, 112566018, 138017385, 138017385, "Eénmeilaan"), + new Val( 130, 112566018, 138017383, 138017383, "Eénmeilaan"), + new Val( 131, 112566018, 608715591, 608715591, "Eénmeilaan"), + new Val( 132, 112566018, 608715592, 608715592, "Eénmeilaan"), + new Val( 133, 112566018, 22476094, 22476094, "Eénmeilaan"), + new Val( 134, 112566018, 138017384, 138017384, "Eénmeilaan"), + new Val( 135, 112566018, 138017386, 138017386, "Eénmeilaan"), + new Val( 136, 112566018, 125835547, 125835547, "Eénmeilaan"), + new Val("Eénmeilaan (179;306;310;333;433;512)", + + 137, 112566018, 125835547, 125835500, "Baron August de Becker Remyplein"), + new Val( 138, 125835500, 35633068, 35633068, "Baron August de Becker Remyplein"), + new Val( 139, 125835500, 608715602, 608715602, "Baron August de Becker Remyplein"), + new Val( 140, 125835500, 608715601, 608715601, "Baron August de Becker Remyplein"), + new Val( 141, 125835500, 608715604, 608715604, "Baron August de Becker Remyplein"), + new Val( 142, 125835500, 608715603, 608715603, "Baron August de Becker Remyplein"), + new Val( 143, 125835500, 429571921, 429571921, "Baron August de Becker Remyplein"), + new Val( 144, 125835500, 125835568, 125835568, "Leuvensestraat"), + new Val("Baron August de Becker Remyplein - Leuvensestraat (2;179;306;310;333;433;512;520)", + + 145, 125835500, 125835568, 23707244, "Diestsesteenweg"), + new Val( 146, 23707244, 125835524, 125835524, "Diestsesteenweg"), + new Val( 147, 23707244, 8109264, 8109264, "Diestsepoort"), + new Val("Diestsesteenweg - Diestsepoort (2;3;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)", + + 148, 23707244, 8109264, 61556877, "Diestsepoort"), + new Val( 149, 61556877, 663770966, 663770966, "Diestsepoort"), + new Val( 150, 61556877, 584356749, 584356749, "Diestsepoort"), + new Val( 151, 61556877, 584356745, 584356745, "Diestsepoort"), + new Val( 152, 61556877, 198559166, 198559166, "Diestsepoort"), + new Val( 153, 61556877, 584356751, 584356751, "Diestsepoort"), + new Val( 154, 61556877, 451873773, 451873773, "Diestsepoort"), + new Val("Diestsepoort (2;3;178;179;306;310;333;370;371;373;374;433;475;485;512;520;524;525)", + + 155, 61556877, 451873773, 584356742, "Diestsepoort"), + new Val( 156, 584356742, 451873774, 451873774, "Diestsepoort"), + new Val("Diestsepoort (2;3;178;179;306;310;318;333;337;370;371;373;374;410;433;475;485;512;520;524;525)", + + 157, 584356742, 451873774, 116797180, "Diestsepoort"), + new Val("Diestsepoort (306;310;318;410;433;475;485)", + + 158, 116797180, 116797180, 116797179, "Diestsepoort"), + new Val("Diestsepoort (306;310;318;410;433)", + + 159, 116797179, 116797179, 4884707, "Tiensevest"), + new Val("Tiensevest (284;285;306;310;315;316;317;395;433;475;485)", + + 160, 4884707, 4884707, 19793164, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;334;335;358;395;410;433;475;485;513;601;651;652;658)", + + 161, 19793164, 19793164, 80458208, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;358;395;410;433;475;485;601;651;652;658)", + + 162, 80458208, 80458208, 79175435, "Tiensevest"), + new Val("Tiensevest (284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;524;537;601;651;652;658)", + + 163, 79175435, 79175435, 79211472, "Tiensevest"), + new Val("Tiensevest (1;2;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)", + + 164, 79211472, 79211472, 79211473, "Tiensevest"), + new Val("Tiensevest (1;2;3;4;5;6;7;8;9;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;520;524;525;537;539;586;601;658)", + + 165, 79211473, 79211473, 79596986, null), + new Val("(305;306;310;318;358;410;433;475;485;601;658)", + + 166, 79596986, 79596986, 377814547, null), + new Val("perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", + + 167, 377814547, 78579065, 0, null) + ); + + testPtLine(expectedValues, PT_ROUTE_BUS_433_TO_LEUVEN_STATION); + + generateListOfExpectedValues(PT_ROUTE_BUS_358); } public void testPtLine(List expectedValues, Relation busRouteRelation) { - + ArrayList segmentRelationsList = new ArrayList<>(); + ArrayList indicesToRemoveList = new ArrayList<>(); assertNotNull(busRouteRelation); Relation clonedRelation = new Relation(busRouteRelation); - RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation); + RouteSegmentToExtract segment = new RouteSegmentToExtract(busRouteRelation); segment.setActiveDataSet(DATASET_BUSES_BEFORE_SPLITTING); assertEquals(clonedRelation.get("ref"), segment.getLineIdentifiersSignature()); assertEquals(clonedRelation.get("colour"), segment.getColoursSignature()); - assertNull(segment.extractToRelation(Collections.emptyList(), false)); + assertNull(segment.extractToRelation(Collections.emptyList(), + false, false)); assertEquals("", segment.getWayIdsSignature()); assertEquals(Collections.emptyList(), segment.getWayMembers()); @@ -2006,59 +1248,57 @@ public void testPtLine(List expectedValues, Relation busRouteRelation) { for (Val v: expectedValues) { segment = previousSegment.addPTWayMember(v.index); if (segment != null) { - extractAndAssertValues(v.index, previousSegment, segment, clonedRelation, - v.iDOfFirstWay, v.iDOfLastWay, v.iDOfNextWay, v.nameOfNextWay, v.note); + Relation extractedRelation = previousSegment.extractToRelation(Arrays.asList("type", "route"), + false, false); + segmentRelationsList.add(new RelationMember("", extractedRelation)); + final String note = extractedRelation.get("note"); + System.out.println(v.index + " " + note); + assertEquals(String.format("%d first way not correct %s%s\n%s%s\n", v.index, rc, v.iDOfFirstWay, rc, extractedRelation.firstMember().getWay().getId()), v.iDOfFirstWay, extractedRelation.firstMember().getWay().getId()); + assertEquals(String.format("%d last way not correct %s%s\n%s%s\n", v.index, rc, v.iDOfLastWay, rc, extractedRelation.lastMember().getWay().getId()), v.iDOfLastWay, extractedRelation.lastMember().getWay().getId()); + assertEquals(String.format("\nnote differs on segment\n%s%s,way%s", rc, v.iDOfFirstWay, v.iDOfLastWay), v.note, previousSegment.getNote()); + assertEquals(String.format("\nnote differs on relation\n%s%s,way%s", rc, v.iDOfFirstWay, v.iDOfLastWay), v.note, note); + + // newSegment should have the last way that was added to this segment + if (v.iDOfNextWay != 0) { + assertNotNull(String.format("No new segment was created for way\n%s%s at position %d", rc, v.iDOfNextWay, v.index), segment); + final long wayId = segment.getWayMembers().get(0).getWay().getId(); + assertEquals(String.format("%d name of last added way not correct %s%s\n ", v.index, rc, wayId), v.nameOfNextWay, segment.getWayMembers().get(0).getWay().get("name")); + assertEquals(String.format("%d id of first way not correct %s%s\n", v.index, rc, wayId), v.iDOfNextWay, wayId); + } previousSegment = segment; - UndoRedoHandler.getInstance().add(new ChangeCommand(busRouteRelation, clonedRelation)); - System.out.printf("% 3d ", busRouteRelation.getMembersCount()); - UndoRedoHandler.getInstance().undo(); } + if (v.index < clonedRelation.getMembersCount()) { + indicesToRemoveList.add(0, v.index); + } + } + + for (Integer integer : indicesToRemoveList) { + clonedRelation.removeMember(integer); } + segmentRelationsList.forEach(clonedRelation::addMember); UndoRedoHandler.getInstance().add(new ChangeCommand(busRouteRelation, clonedRelation)); System.out.printf("%s\n", busRouteRelation.getMembersCount()); System.out.print("\n\n"); } - public void extractAndAssertValues(int index, RouteSegmentToExtract createdSegment, RouteSegmentToExtract newSegment, - Relation superRouteRelation, int firstWayId, int lastWayId, int firstWayIdForNewSegment, - String nameOfNewWay, String expectedNote) { - Relation extractedRelation = createdSegment.extractToRelation(Arrays.asList("type", "route"), true); - final String note = extractedRelation.get("note"); - System.out.println(index + " " + note); - assertEquals(String.format("%d first way not correct %s%s\n%s%s\n", index, rc, firstWayId, rc, extractedRelation.firstMember().getWay().getId()), firstWayId, extractedRelation.firstMember().getWay().getId()); - assertEquals(String.format("%d last way not correct %s%s\n%s%s\n", index, rc, lastWayId, rc, extractedRelation.lastMember().getWay().getId()), lastWayId, extractedRelation.lastMember().getWay().getId()); - assertEquals(String.format("\nnote differs\n%s%s,way%s", rc, firstWayId, lastWayId), expectedNote, createdSegment.getNote()); - assertEquals(expectedNote, note); - -// assertEquals(String.format("%d relation id not correct\n", index), extractedRelation.getId(), superRouteRelation.getMember(index+1).getMember().getId()); - // newSegment should have the last way that was added to this segment - if (firstWayIdForNewSegment != 0) { - assertNotNull(String.format("No new segment was created for way\n%s%s at position %d", rc, firstWayIdForNewSegment, index), newSegment); - final long wayId = newSegment.getWayMembers().get(0).getWay().getId(); - assertEquals(String.format("%d name of last added way not correct %s%s\n ", index, rc, wayId), nameOfNewWay, newSegment.getWayMembers().get(0).getWay().get("name")); - assertEquals(String.format("%d id of first way not correct %s%s\n", index, rc, wayId), firstWayIdForNewSegment, wayId); - } - } - /** * This prints a list of known values to be used in unit tests * * @param relation route relation */ @SuppressWarnings("unused") - public void printListOfExpectedValues(Relation relation) { + public void generateListOfExpectedValues(Relation relation) { List members = relation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(relation); - List wayMembers = segment.getWayMembers(); + List wayMembers = null; String listVal = ""; String className = ""; - Way way = null; + Way way; String wayName = null; String note = null; - int lastIndex = 0; System.out.printf(" %sexpectedValues = Arrays.asList(\n", listVal); - for (int i = members.size() - 1; i >= 0; i--) { + for (int i = 0; i < members.size() - 1; i++) { RelationMember member = members.get(i); if (member.isWay() && RouteUtils.isPTWay(member)) { way = member.getWay(); @@ -2067,37 +1307,46 @@ public void printListOfExpectedValues(Relation relation) { RouteSegmentToExtract ns = segment.addPTWayMember(i); wayMembers = segment.getWayMembers(); if (ns != null) { - System.out.printf(" new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\"),\n\n", + System.out.printf(" new Val(\"%s\",\n\n % 4d,% 10d,% 10d,% 10d, %s),\n", + note, i, wayMembers.get(0).getMember().getId(), wayMembers.get(wayMembers.size() - 1).getMember().getId(), (way != null && way.getId() != 0) ? way.getId() : 0, - wayName, - note + wayName ); segment = ns; } else { - System.out.printf(" new Val(% 3d,% 10d,% 10d,% 10d, %s),\n", + System.out.printf(" new Val(% 4d,% 10d,% 10d,% 10d, %s),\n", i, - wayMembers.get(0).getMember().getId(), - wayMembers.get(wayMembers.size() - 1).getMember().getId(), + (wayMembers.size() > 0 ) ? wayMembers.get(0).getMember().getId() : 0, + (wayMembers.size() > 1 ) ? wayMembers.get(wayMembers.size() - 1).getMember().getId() : 0, (way != null && way.getId() != 0) ? way.getId() : 0, wayName ); } - } else { - lastIndex = i; - break; } } - System.out.printf("\n new Val(% 3d,% 10d,% 10d,% 10d, %s,\n \"%s\")\n );\n\n", - lastIndex, - (wayMembers != null && wayMembers.size() > 0) ? wayMembers.get(0).getMember().getId() : 0, - (wayMembers != null && wayMembers.size() > 1) ? wayMembers.get(wayMembers.size() - 1).getMember().getId() : 0, - (way != null && way.getId() != 0) ? way.getId() : 0, - wayName, - note + System.out.printf(" new Val(\"%s\",\n\n % 4d,% 10d,% 10d,% 10d, %s)\n );\n\n", + note, + members.size() - 1, + (wayMembers != null && wayMembers.size() > 0 ) ? wayMembers.get(0).getMember().getId() : 0, + members.get(members.size() - 1).getMember().getId(), + 0, + wayName ); - System.out.printf(" testPtLine(expectedValues, %d);\n", relation.getId()); + StringBuilder lineName = new StringBuilder(relation.get("route")); + if (relation.hasKey("ref")) lineName.append("_").append(relation.get("ref")); + if (relation.hasKey("to")) lineName.append("_TO_").append(relation.get("to")); + if (relation.hasKey("via")) { + String via = relation.get("via"); + if (!via.contains("-")) lineName.append("_VIA_").append(via); + } + + System.out.printf(" testPtLine(expectedValues, PT_ROUTE_%s);\n", lineName.toString() + .toUpperCase(Locale.ROOT) + .replaceAll("\\sPERRON\\s\\d+", "") + .replaceAll("\\s+", " ") + .replaceAll(" ", "_")); } } From ac95d6d09a9374b7d0618b737c3cc1222fc4a996 Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Wed, 4 Nov 2020 21:52:16 +0100 Subject: [PATCH 51/52] In ExtractRelationMembersToNewRelationAction I made an attempt to get rid of the Index out of Bounds exception. The attempt failed. Fixed some bugs in RouteSegmentToExtract that came from reversing the order in which members are evaluated Tried to add functionality to the test code generator to copy to the clipboard. Unfortunately it doesn't work on Linux or on OpenJDK. I had to change the OSM file. Some data that is important for the decision where to split was missing from it. --- ...actRelationMembersToNewRelationAction.java | 35 +- .../data/RouteSegmentToExtract.java | 15 +- test/data/buses_before_splitting.osm | 16627 +++++++++++++--- .../data/RouteSegmentToExtractTest.java | 487 +- 4 files changed, 14228 insertions(+), 2936 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index d793a517..fe81cc34 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -106,7 +106,12 @@ public void actionPerformed(ActionEvent actionEvent) { ) == JOptionPane.OK_OPTION ) { if (cbFindAllSegmentsAutomatically.isSelected()) { - splitInSegments(originalRelation, cbConvertToSuperroute.isSelected()); + final Relation clonedRelation = new Relation(originalRelation); + splitInSegments(clonedRelation, cbConvertToSuperroute.isSelected()); + commands.add(new ChangeCommand(originalRelation, clonedRelation)); + UndoRedoHandler.getInstance().add( + new SequenceCommand(I18n.tr("Replace ways with segment relations"), commands)); + } else { Relation clonedRelation = new Relation(originalRelation); RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation, @@ -142,24 +147,16 @@ public void actionPerformed(ActionEvent actionEvent) { extraEditor.setAlwaysOnTop(true); } } - /* - This consistently causes an IndexOutOfBounds exception AND - I don't know why. - */ - try { - editor.reloadDataFromRelation(); - } catch (Exception e) { - e.printStackTrace(); - } + editor.reloadDataFromRelation(); } } - public void splitInSegments(Relation originalRelation, Boolean convertToSuperroute) { + public void splitInSegments(Relation relation, Boolean convertToSuperroute) { ArrayList segmentRelationsList = new ArrayList<>(); ArrayList indicesToRemoveList = new ArrayList<>(); - final List members = originalRelation.getMembers(); - RouteSegmentToExtract segment = new RouteSegmentToExtract(originalRelation); - segment.setActiveDataSet(originalRelation.getDataSet()); + final List members = relation.getMembers(); + RouteSegmentToExtract segment = new RouteSegmentToExtract(relation); +// segment.setActiveDataSet(relation.getDataSet()); RouteSegmentToExtract newSegment; for (int i = 0; i < members.size(); i++) { newSegment = segment.addPTWayMember(i); @@ -171,19 +168,17 @@ public void splitInSegments(Relation originalRelation, Boolean convertToSuperrou } segment = newSegment; } - if (i < originalRelation.getMembersCount() && RouteUtils.isPTWay(originalRelation.getMembers().get(i))) { + if (i < relation.getMembersCount() && RouteUtils.isPTWay(relation.getMembers().get(i))) { indicesToRemoveList.add(0, i); } } - final Relation clonedRelation = new Relation(originalRelation); if (convertToSuperroute) { - clonedRelation.put("type", "superroute"); + relation.put("type", "superroute"); } for (Integer integer : indicesToRemoveList) { - clonedRelation.removeMember(integer); + relation.removeMember(integer); } - segmentRelationsList.forEach(clonedRelation::addMember); - UndoRedoHandler.getInstance().add(new ChangeCommand(originalRelation, clonedRelation)); + segmentRelationsList.forEach(relation::addMember); } /** This method modifies clonedRelation in place if substituteWaysWithRelation is true * and if ways are extracted into a new relation diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java index 370dfdb6..b7a2687c 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtract.java @@ -213,7 +213,6 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { .filter(r -> !r.hasKey("name") && RouteUtils.isPTRoute(r) && r.hasKey("note") -// && r.get("note").matches(".*\\([\\d;]+\\)") ) .collect(Collectors.toList()); List parentRouteRelations = @@ -247,8 +246,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { } for (Relation parentRoute : itinerariesInSameDirection) { final Optional commonNode1 = WayUtils.findFirstCommonNode(ws.previousWay, ws.currentWay); - final Optional commonNode2 = WayUtils.findFirstCommonNode(ws.currentWay, ws.nextWay); - if (!parentRoute.equals(relation) && (ws.currentWay == getLastWay(parentRoute) + if (!parentRoute.equals(relation) && (ws.previousWay == getLastWay(parentRoute) || getMembershipCountOfWayInSameDirection(ws.currentWay, parentRoute) > 1 || getMembershipCountOfWayInSameDirection(ws.previousWay, parentRoute) > 1 && (commonNode1.map(it -> it.getParentWays().size() > 2).orElse(false)))) { @@ -262,7 +260,7 @@ public RouteSegmentToExtract addPTWayMember(Integer index) { if (!startNewSegment && !relation.equals(parentRoute) && Objects.equals(relation.get("ref"), parentRoute.get("ref"))) { - if (commonNode2 + if (commonNode1 .map(it -> it.getParentWays().stream() .filter(w -> (getItineraryWays(parentRoute).contains(w))) @@ -671,17 +669,16 @@ public Relation extractToRelation(List tagsToTransfer, Boolean removeWay updateTags(); if (extractedRelation.getId() <= 0 && !extractedRelationAlreadyExists) { getExtractRelationCommand().executeCommand(); - addPtSegment(); + addToPtSegmentRelationsMap(); } if (substituteWaysWithRelation) { // replace removed members with the extracted relation relation.addMember(limitIntegerTo(index, relation.getMembersCount()), new RelationMember("", extractedRelation)); } - } else { - return null; + return extractedRelation; } - return extractedRelation; + return null; } public Command getExtractRelationCommand() { @@ -700,7 +697,7 @@ public void updateTags() { // extractedRelation.put("route_ref", getLineIdentifiersSignature()); } - private void addPtSegment() { + private void addToPtSegmentRelationsMap() { if (extractedRelation != null) { ptSegments.put(getWayIdsSignature(), extractedRelation); } diff --git a/test/data/buses_before_splitting.osm b/test/data/buses_before_splitting.osm index ac0ef068..b1aefa3e 100644 --- a/test/data/buses_before_splitting.osm +++ b/test/data/buses_before_splitting.osm @@ -149,6 +149,7 @@ + @@ -159,6 +160,7 @@ + @@ -608,8 +610,10 @@ + + @@ -829,6 +833,9 @@ + + + @@ -1403,6 +1410,7 @@ + @@ -1886,6 +1894,8 @@ + + @@ -3791,6 +3801,10 @@ + + + + @@ -6491,6 +6505,7 @@ + @@ -6501,6 +6516,9 @@ + + + @@ -8734,8 +8752,10 @@ + + @@ -10983,6 +11003,7 @@ + @@ -11672,8 +11693,15 @@ + + + + + + + @@ -11693,6 +11721,7 @@ + @@ -12679,6 +12708,7 @@ + @@ -15621,6 +15651,9 @@ + + + @@ -16717,6 +16750,9 @@ + + + @@ -16748,6 +16784,11 @@ + + + + + @@ -17678,6 +17719,9 @@ + + + @@ -18714,6 +18758,10 @@ + + + + @@ -18764,9 +18812,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -18876,6 +18951,9 @@ + + + @@ -21336,6 +21414,13 @@ + + + + + + + @@ -23088,6 +23173,18 @@ + + + + + + + + + + + + @@ -23593,6 +23690,19 @@ + + + + + + + + + + + + + @@ -26035,6 +26145,19 @@ + + + + + + + + + + + + + @@ -26098,6 +26221,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -28699,6 +28847,14 @@ + + + + + + + + @@ -29905,6 +30061,13 @@ + + + + + + + @@ -30489,6 +30652,24 @@ + + + + + + + + + + + + + + + + + + @@ -32683,6 +32864,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34129,6 +34335,23 @@ + + + + + + + + + + + + + + + + + @@ -34616,18 +34839,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39993,6 +40288,21 @@ + + + + + + + + + + + + + + + @@ -41543,6 +41853,12 @@ + + + + + + @@ -44063,6 +44379,12 @@ + + + + + + @@ -44212,16 +44534,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46569,6 +46922,19 @@ + + + + + + + + + + + + + @@ -72170,10 +72536,15 @@ + + + + + @@ -72874,10 +73245,15 @@ + + + + + @@ -83638,6 +84014,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84104,6 +84766,1127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84716,490 +86499,1748 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87389,31 +90430,538 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87666,25 +91214,29 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + @@ -87693,177 +91245,200 @@ - + - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87871,6 +91446,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -88074,1096 +91783,1725 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + @@ -91813,76 +96151,1845 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + @@ -92995,7 +99102,491 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -93011,26 +99602,22 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -93146,116 +99733,93 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -93271,89 +99835,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -93384,13 +99925,123 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -93466,685 +100117,3751 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -96293,6 +106010,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -96308,6 +106271,736 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -104170,6 +114863,548 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -104210,6 +115445,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -104403,4 +115659,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java index 1047fdd1..d0f918d7 100644 --- a/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/pt_assistant/data/RouteSegmentToExtractTest.java @@ -7,6 +7,9 @@ import static org.junit.Assert.assertTrue; import static org.openstreetmap.josm.io.OsmReader.parseDataSet; +import java.awt.datatransfer.StringSelection; +import java.awt.Toolkit; + import java.io.FileInputStream; import java.util.ArrayList; import java.util.Arrays; @@ -188,10 +191,10 @@ public void f74_F75_Test() { @Test public void bus601_600_3_Test() { - List expectedValues; + List expectedValues; - expectedValues = Arrays.asList( - new Val( 14, 338057820, 338057820, 338057820, "Engels Plein"), + expectedValues = Arrays.asList( + new Val( 14, 338057820, 0, 338057820, "Engels Plein"), new Val( 15, 338057820, 3869812, 3869812, "Engels Plein"), new Val( 16, 338057820, 25928482, 25928482, "Wolvengang"), new Val( 17, 338057820, 659297690, 659297690, "Wolvengang"), @@ -209,7 +212,7 @@ public void bus601_600_3_Test() { 27, 338057820, 510790349, 3992548, "Zoutstraat"), new Val("Zoutstraat (334;335;513;601;630)", - 28, 3992548, 3992548, 254800931, "Joanna-Maria Artoisplein"), + 28, 3992548, 3992548, 254800931, "Joanna-Maria Artoisplein"), new Val("Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", 29, 254800931, 254800931, 8133608, "Diestsevest"), @@ -238,28 +241,28 @@ public void bus601_600_3_Test() { 39, 377918638, 377918638, 71754927, null), new Val( 40, 71754927, 79264897, 79264897, null), - new Val("(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;524;525;601)", + new Val("(2;3;4;5;6;7;8;9;18;178;179;306;333;334;335;337;370;371;373;374;380;512;520;524;525;601)", 41, 71754927, 79264897, 79264888, null), - new Val("(2;3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;520;525;601)", + new Val("(2;3;4;5;6;7;8;9;18;178;179;306;333;334;335;337;370;371;373;374;380;512;520;525;601)", 42, 79264888, 79264888, 377918635, null), - new Val("(3;4;5;6;7;8;9;18;178;179;333;334;335;337;370;371;373;374;380;512;601)", + new Val("(3;4;5;6;7;8;9;18;178;179;306;333;334;335;337;370;371;373;374;380;512;601)", 43, 377918635, 377918635, 79264899, null), - new Val("(4;5;6;18;178;179;333;334;335;337;370;371;373;374;380;512;601;630)", + new Val("(4;5;6;18;178;179;306;333;334;335;337;370;371;373;374;380;512;601;630)", 44, 79264899, 79264899, 78815533, null), new Val( 45, 78815533, 459446600, 459446600, "Martelarenplein"), new Val( 46, 78815533, 459446598, 459446598, "Martelarenplein"), new Val( 47, 78815533, 76856823, 76856823, "Martelarenplein"), - new Val("Martelarenplein (4;5;6;7;8;9;18;178;179;337;380;527;601;630)", + new Val("Martelarenplein (4;5;6;7;8;9;18;178;179;306;337;380;527;601;630)", 48, 78815533, 76856823, 185988814, "Tiensevest"), - new Val("Tiensevest (1;4;5;6;7;8;9;18;178;179;337;380;527;601;630)", + new Val("Tiensevest (1;4;5;6;7;8;9;18;178;179;306;337;380;527;601;630)", 49, 185988814, 185988814, 8590231, "Tiensevest"), - new Val("Tiensevest (7;8;9;18;178;179;337;380;527;601;630)", + new Val("Tiensevest (7;8;9;18;178;179;306;337;380;527;601;630)", 50, 8590231, 8590231, 12712557, "Tiensevest"), new Val( 51, 12712557, 8131717, 8131717, "Tiensevest"), @@ -269,7 +272,7 @@ public void bus601_600_3_Test() { new Val( 55, 12712557, 863272995, 863272995, "Tiensevest"), new Val( 56, 12712557, 863272991, 863272991, "Tiensevest"), new Val( 57, 12712557, 16775171, 16775171, "Tiensepoort"), - new Val("Tiensevest - Tiensepoort (7;8;9;18;178;179;337;380;527;601;616;630)", + new Val("Tiensevest - Tiensepoort (7;8;9;18;178;179;306;337;380;527;601;616;630)", 58, 12712557, 16775171, 8130906, "Geldenaaksevest"), new Val( 59, 8130906, 586268893, 586268893, "Geldenaaksevest"), @@ -277,20 +280,20 @@ public void bus601_600_3_Test() { new Val( 61, 8130906, 521193607, 521193607, "Geldenaaksevest"), new Val( 62, 8130906, 10296368, 10296368, "Geldenaaksevest"), new Val( 63, 8130906, 79299303, 79299303, "Geldenaaksevest"), - new Val("Geldenaaksevest (18;178;179;337;601;616;630)", - - 64, 8130906, 79299303, 608715606, "Geldenaaksevest"), - new Val( 65, 608715606, 608715605, 608715605, "Geldenaaksevest"), - new Val( 66, 608715606, 24905257, 24905257, "Geldenaaksevest"), - new Val( 67, 608715606, 3677823, 3677823, "Naamsevest"), - new Val( 68, 608715606, 655251292, 655251292, "Naamsevest"), - new Val( 69, 608715606, 661733369, 661733369, "Naamsevest"), - new Val( 70, 608715606, 131571763, 131571763, "Naamsevest"), - new Val( 71, 608715606, 655251293, 655251293, "Naamsevest"), - new Val( 72, 608715606, 86164005, 86164005, "Naamsevest"), - new Val("Geldenaaksevest - Naamsevest (18;178;179;337;601;616)", - - 73, 608715606, 86164005, 3677330, "Tervuursevest"), + new Val( 64, 8130906, 608715606, 608715606, "Geldenaaksevest"), + new Val( 65, 8130906, 608715605, 608715605, "Geldenaaksevest"), + new Val("Geldenaaksevest (18;178;179;306;337;601;616;630)", + + 66, 8130906, 608715605, 24905257, "Geldenaaksevest"), + new Val( 67, 24905257, 3677823, 3677823, "Naamsevest"), + new Val( 68, 24905257, 655251292, 655251292, "Naamsevest"), + new Val( 69, 24905257, 661733369, 661733369, "Naamsevest"), + new Val( 70, 24905257, 131571763, 131571763, "Naamsevest"), + new Val( 71, 24905257, 655251293, 655251293, "Naamsevest"), + new Val( 72, 24905257, 86164005, 86164005, "Naamsevest"), + new Val("Geldenaaksevest - Naamsevest (18;178;179;306;337;601;616)", + + 73, 24905257, 86164005, 3677330, "Tervuursevest"), new Val( 74, 3677330, 608715562, 608715562, "Tervuursevest"), new Val( 75, 3677330, 608715561, 608715561, "Tervuursevest"), new Val( 76, 3677330, 23237287, 23237287, "Tervuursevest"), @@ -301,10 +304,10 @@ public void bus601_600_3_Test() { new Val( 81, 3677330, 461159367, 461159367, "Tervuursevest"), new Val( 82, 3677330, 344507822, 344507822, "Tervuursevest"), new Val( 83, 3677330, 461159362, 461159362, "Tervuursevest"), - new Val("Tervuursevest (178;179;520;524;525;537;601)", + new Val("Tervuursevest (178;179;306;520;524;525;537;601)", 84, 3677330, 461159362, 461159345, "Tervuursevest"), - new Val("Tervuursevest (178;179;601)", + new Val("Tervuursevest (178;179;306;601)", 85, 461159345, 461159345, 88361317, "Tervuursevest"), new Val( 86, 88361317, 429706866, 429706866, "Tervuursevest"), @@ -320,15 +323,13 @@ public void bus601_600_3_Test() { new Val("Tervuursevest (601)", 96, 88361317, 99583853, 429706864, "Rennes-Singel"), - new Val("Tervuursevest - Rennes-Singel (601)", - - 97, 88361317, 429706864, 8131120, "Rennes-Singel"), - new Val( 98, 8131120, 813979472, 813979472, "Rennes-Singel"), - new Val( 99, 8131120, 79289746, 79289746, "Rennes-Singel"), - new Val( 100, 8131120, 813979470, 813979470, "Rennes-Singel"), - new Val( 101, 8131120, 161166589, 161166589, "Rennes-Singel"), - new Val( 102, 8131120, 192559628, 192559628, "Rennes-Singel"), - new Val( 103, 8131120, 249333186, 249333186, "Rennes-Singel"), + new Val( 97, 429706864, 8131120, 8131120, "Rennes-Singel"), + new Val( 98, 429706864, 813979472, 813979472, "Rennes-Singel"), + new Val( 99, 429706864, 79289746, 79289746, "Rennes-Singel"), + new Val( 100, 429706864, 813979470, 813979470, "Rennes-Singel"), + new Val( 101, 429706864, 161166589, 161166589, "Rennes-Singel"), + new Val( 102, 429706864, 192559628, 192559628, "Rennes-Singel"), + new Val( 103, 429706864, 249333186, 249333186, "Rennes-Singel"), new Val("Rennes-Singel (318;601)", 104, 429706864, 249333186, 249333184, "Herestraat"), @@ -351,7 +352,7 @@ public void bus601_600_3_Test() { 113, 249333188, 249333188, 3752557, "Rotonde Het Teken (to Ring Noord)"), new Val("Rotonde Het Teken (to Ring Noord) (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", - 114, 3752557, 3752557, 78873921, "Rotonde Het Teken (Ring Noord)"), // todo where Campus 3 loops + 114, 3752557, 3752557, 78873921, "Rotonde Het Teken (Ring Noord)"), new Val("Rotonde Het Teken (Ring Noord) (3;317;333;334;335;370;371;373;374;380;395;410;600;601)", 115, 78873921, 78873921, 78568660, "Rotonde Het Teken (from Ring Noord)"), @@ -370,7 +371,7 @@ public void bus601_600_3_Test() { new Val("Ring Zuid (3 - 4&5) (3;317;395;410;600;601)", 122, 109267436, 109267436, 14508736, null), - new Val( 123, 14508736, 377918641, 377918641, "perron 5"), + new Val( 123, 14508736, 377918641, 377918641, null), new Val("perron 5 (3;317;395;410;601)", 124, 14508736, 377918641, 78852604, null), @@ -405,32 +406,26 @@ public void bus601_600_3_Test() { new Val("Rennes-Singel - Den Boschsingel (318;410;601)", 141, 249333185, 225605630, 23837544, "Den Boschsingel"), - new Val("Rennes-Singel - Den Boschsingel (318;410;601)", - - 142, 249333185, 23837544, 146171871, "Den Boschsingel"), - new Val( 143, 146171871, 3877105, 3877105, null), - new Val( 144, 146171871, 8131125, 8131125, null), - new Val( 145, 146171871, 3993387, 3993387, "Lüdenscheidsingel"), + new Val( 142, 23837544, 146171871, 146171871, "Den Boschsingel"), + new Val( 143, 23837544, 3877105, 3877105, null), + new Val( 144, 23837544, 8131125, 8131125, null), + new Val( 145, 23837544, 3993387, 3993387, "Lüdenscheidsingel"), new Val("Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)", 146, 23837544, 3993387, 109267417, "Lüdenscheidsingel"), - new Val("Den Boschsingel - Lüdenscheidsingel (318;358;410;601;651;658)", - - 147, 146171871, 109267417, 3993388, "Lüdenscheidsingel"), - new Val( 148, 3993388, 44932921, 44932921, "Lüdenscheidsingel"), - new Val( 149, 3993388, 254800932, 254800932, "Lüdenscheidsingel"), - new Val("Lüdenscheidsingel (178;305;318;358;410;601;651;652;658)", - - 150, 3993388, 254800932, 23691158, "Joanna-Maria Artoisplein"), + new Val( 147, 109267417, 3993388, 3993388, "Lüdenscheidsingel"), + new Val( 148, 109267417, 44932921, 44932921, "Lüdenscheidsingel"), + new Val( 149, 109267417, 254800932, 254800932, "Lüdenscheidsingel"), + new Val( 150, 109267417, 23691158, 23691158, "Joanna-Maria Artoisplein"), new Val("Lüdenscheidsingel - Joanna-Maria Artoisplein (178;305;318;358;410;601;651;652;658)", 151, 109267417, 23691158, 254800931, "Joanna-Maria Artoisplein"), new Val("Joanna-Maria Artoisplein (178;305;318;334;335;358;410;513;601;630;651;652;658)", 152, 254800931, 254800931, 8133608, "Diestsevest"), - new Val( 153, 254800931, 4003924, 4003924, "Diestsevest"), - new Val( 154, 254800931, 81457878, 81457878, "Diestsevest"), - new Val( 155, 254800931, 6184898, 6184898, "Diestsevest"), + new Val( 153, 8133608, 4003924, 4003924, "Diestsevest"), + new Val( 154, 8133608, 81457878, 81457878, "Diestsevest"), + new Val( 155, 8133608, 6184898, 6184898, "Diestsevest"), new Val("Diestsevest (305;318;334;335;358;410;513;601;630;651;652;658)", 156, 8133608, 6184898, 19793164, "Tiensevest"), @@ -454,7 +449,7 @@ public void bus601_600_3_Test() { 162, 79596986, 79596986, 377814547, null), new Val("perron 1 & 2 (1;284;285;305;306;310;315;316;317;318;351;352;358;395;410;433;475;485;537;539;601;658)", - 163, 377814547, 78579065, 0, null) + 163, 377814547, 78579065, 0, null) ); testPtLine(expectedValues, PT_ROUTE_BUS_601_TO_LEUVEN_STATION); @@ -476,12 +471,10 @@ public void bus601_600_3_Test() { new Val( 17, 451873774, 584356742, 584356742, "Diestsepoort"), new Val( 18, 451873774, 451873773, 451873773, "Diestsepoort"), new Val( 19, 451873774, 584356751, 584356751, "Diestsepoort"), + new Val( 20, 451873774, 584356751, 198559166, "Diestsepoort"), new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - 20, 451873774, 584356751, 198559166, "Diestsepoort"), - new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - - 21, 198559166, 198559166, 584356745, "Diestsepoort"), + 21, 451873774, 198559166, 584356745, "Diestsepoort"), new Val( 22, 584356745, 584356749, 584356749, "Diestsepoort"), new Val( 23, 584356745, 663770966, 663770966, "Diestsepoort"), new Val( 24, 584356745, 61556877, 61556877, "Diestsepoort"), @@ -512,13 +505,13 @@ public void bus601_600_3_Test() { new Val( 39, 23837543, 192559625, 192559625, "Den Boschsingel"), new Val( 40, 23837543, 3680457, 3680457, "Rennes-Singel"), new Val( 41, 23837543, 8131123, 8131123, "Rennes-Singel"), - new Val( 42, 23837543, 225605633, 225605633, "Rennes-Singel"), new Val("Den Boschsingel - Rennes-Singel (318;410;600)", - 43, 23837543, 225605633, 78568454, "Rennes-Singel"), + 42, 23837543, 8131123, 225605633, "Rennes-Singel"), + new Val( 43, 225605633, 78568454, 78568454, "Rennes-Singel"), new Val("Rennes-Singel (178;318;410;600)", - 44, 78568454, 78568454, 270181177, "Herestraat"), + 44, 225605633, 78568454, 270181177, "Herestraat"), new Val("Herestraat (410;600)", 45, 270181177, 270181177, 813970228, "Herestraat"), @@ -632,35 +625,29 @@ public void bus601_600_3_Test() { 103, 608715579, 3991775, 199381120, "Geldenaaksevest"), new Val( 104, 199381120, 24905254, 24905254, "Geldenaaksevest"), new Val( 105, 199381120, 491728135, 491728135, "Geldenaaksevest"), - new Val("Geldenaaksevest (18;178;179;337;600;616;630)", - - 106, 199381120, 491728135, 24905255, "Geldenaaksevest"), - new Val( 107, 24905255, 24905256, 24905256, "Geldenaaksevest"), - new Val( 108, 24905255, 863272996, 863272996, "Geldenaaksevest"), - new Val( 109, 24905255, 857806575, 857806575, "Geldenaaksevest"), - new Val( 110, 24905255, 857806576, 857806576, "Geldenaaksevest"), - new Val( 111, 24905255, 857806574, 857806574, "Geldenaaksevest"), - new Val( 112, 24905255, 8130905, 8130905, "Geldenaaksevest"), - new Val("Geldenaaksevest (178;179;337;600;630)", - - 113, 24905255, 8130905, 4003928, "Tiensepoort"), - new Val("Tiensepoort (18;178;179;337;600;616;630)", - - 114, 4003928, 4003928, 521193611, "Tiensevest"), + new Val( 106, 199381120, 24905255, 24905255, "Geldenaaksevest"), + new Val( 107, 199381120, 24905256, 24905256, "Geldenaaksevest"), + new Val( 108, 199381120, 863272996, 863272996, "Geldenaaksevest"), + new Val( 109, 199381120, 857806575, 857806575, "Geldenaaksevest"), + new Val( 110, 199381120, 857806576, 857806576, "Geldenaaksevest"), + new Val( 111, 199381120, 857806574, 857806574, "Geldenaaksevest"), + new Val( 112, 199381120, 8130905, 8130905, "Geldenaaksevest"), + new Val( 113, 199381120, 4003928, 4003928, "Tiensepoort"), + new Val("Geldenaaksevest - Tiensepoort (18;178;179;337;600;616;630)", + + 114, 199381120, 4003928, 521193611, "Tiensevest"), new Val( 115, 521193611, 586268892, 586268892, "Tiensevest"), new Val( 116, 521193611, 863272997, 863272997, "Tiensevest"), new Val( 117, 521193611, 521193609, 521193609, "Tiensevest"), - new Val("Tiensevest (7;8;9;178;179;337;380;600;630)", - - 118, 521193611, 521193609, 4003927, "Tiensevest"), + new Val( 118, 521193611, 4003927, 4003927, "Tiensevest"), + new Val( 119, 521193611, 8154434, 8154434, "Tiensevest"), new Val("Tiensevest (7;8;9;18;178;179;337;380;600;616;630)", - 119, 4003927, 4003927, 8154434, "Tiensevest"), - new Val( 120, 8154434, 15083398, 15083398, "Tiensevest"), - new Val( 121, 8154434, 185988816, 185988816, "Tiensevest"), + 120, 521193611, 8154434, 15083398, "Tiensevest"), + new Val( 121, 15083398, 185988816, 185988816, "Tiensevest"), new Val("Tiensevest (7;8;9;18;179;337;380;600;616;630)", - 122, 8154434, 185988816, 185988814, "Tiensevest"), + 122, 15083398, 185988816, 185988814, "Tiensevest"), new Val( 123, 185988814, 19793223, 19793223, "Tiensevest"), new Val("Tiensevest (1;4;5;6;7;8;9;18;179;337;380;600;616;630)", @@ -694,8 +681,8 @@ public void bus601_600_3_Test() { 135, 79596980, 377918658, 79596987, null), new Val("perron 11 & 12 (3;333;334;335;513;600;630)", - 136, 79596987, 79596987, 79596982, null), - new Val( 137, 79596982, 79596974, 79596974, null), + 136, 79596980, 79596987, 79596982, null), + new Val( 137, 79596980, 79596974, 79596974, null), new Val("perron 11 & 12 (3;333;334;335;433;600;630)", 138, 79596982, 79596974, 79596965, null), @@ -707,12 +694,10 @@ public void bus601_600_3_Test() { new Val( 142, 451873774, 584356742, 584356742, "Diestsepoort"), new Val( 143, 451873774, 451873773, 451873773, "Diestsepoort"), new Val( 144, 451873774, 584356751, 584356751, "Diestsepoort"), + new Val( 145, 451873774, 584356751, 198559166, "Diestsepoort"), new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - 145, 451873774, 584356751, 198559166, "Diestsepoort"), - new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - - 146, 198559166, 198559166, 584356745, "Diestsepoort"), + 146, 451873774, 198559166, 584356745, "Diestsepoort"), new Val( 147, 584356745, 584356749, 584356749, "Diestsepoort"), new Val( 148, 584356745, 663770966, 663770966, "Diestsepoort"), new Val( 149, 584356745, 61556877, 61556877, "Diestsepoort"), @@ -783,12 +768,10 @@ public void bus601_600_3_Test() { new Val( 40, 451873774, 584356742, 584356742, "Diestsepoort"), new Val( 41, 451873774, 451873773, 451873773, "Diestsepoort"), new Val( 42, 451873774, 584356751, 584356751, "Diestsepoort"), + new Val( 43, 451873774, 198559166, 198559166, "Diestsepoort"), new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - 43, 451873774, 584356751, 198559166, "Diestsepoort"), - new Val("Diestsepoort (2;3;179;310;333;334;335;337;370;371;373;374;433;475;485;513;520;524;525;600;616;630;651;652;658)", - - 44, 198559166, 198559166, 584356745, "Diestsepoort"), + 44, 451873774, 198559166, 584356745, "Diestsepoort"), new Val( 45, 584356745, 584356749, 584356749, "Diestsepoort"), new Val( 46, 584356745, 663770966, 663770966, "Diestsepoort"), new Val( 47, 584356745, 61556877, 61556877, "Diestsepoort"), @@ -847,12 +830,10 @@ public void bus601_600_3_Test() { new Val( 86, 112566013, 125835556, 125835556, "Kesseldallaan"), new Val( 87, 112566013, 38209648, 38209648, "Wilselsesteenweg"), new Val( 88, 112566013, 98645223, 98645223, "Wilselsesteenweg"), + new Val( 89, 112566013, 98645243, 98645243, "Wilselsesteenweg"), new Val("Kesseldallaan - Wilselsesteenweg (2;310)", - 89, 112566013, 98645223, 98645243, "Wilselsesteenweg"), - new Val("Wilselsesteenweg (2;310)", - - 90, 98645243, 98645243, 243884410, "Wilselsesteenweg"), + 90, 112566013, 98645243, 243884410, "Wilselsesteenweg"), new Val( 91, 243884410, 114935420, 114935420, "Wilselsesteenweg"), new Val( 92, 243884410, 192559637, 192559637, "Wilselsesteenweg"), new Val( 93, 243884410, 18943297, 18943297, "Wilselsesteenweg"), @@ -876,83 +857,79 @@ public void bus601_600_3_Test() { new Val( 111, 243884410, 310461931, 310461931, "Nobelberg"), new Val( 112, 243884410, 492765776, 492765776, "Nobelberg"), new Val( 113, 243884410, 19166179, 19166179, "Nobelberg"), + new Val( 114, 243884410, 310435232, 310435232, "Nobelberg"), new Val("Wilselsesteenweg - Nobelberg (310)", - 114, 243884410, 19166179, 310435232, "Nobelberg"), - new Val("Nobelberg (310)", - - 115, 310435232, 310435232, 64487963, "Rotselaarsebaan"), - new Val("Rotselaarsebaan (310)", - - 116, 64487963, 64487963, 310435233, "Rotselaarsebaan"), - new Val( 117, 310435233, 25667798, 25667798, "Rotselaarsebaan"), - new Val( 118, 310435233, 16302928, 16302928, null), + 115, 243884410, 310435232, 64487963, "Rotselaarsebaan"), + new Val( 116, 64487963, 310435233, 310435233, "Rotselaarsebaan"), new Val("Rotselaarsebaan (310)", - 119, 310435233, 16302928, 112566004, "Sint-Maurusstraat"), - new Val("Sint-Maurusstraat (310)", + 117, 64487963, 310435233, 25667798, "Rotselaarsebaan"), + new Val( 118, 25667798, 16302928, 16302928, null), + new Val( 119, 25667798, 112566004, 112566004, "Sint-Maurusstraat"), + new Val("Rotselaarsebaan - Sint-Maurusstraat (310)", - 120, 112566004, 112566004, 310435233, "Rotselaarsebaan"), + 120, 25667798, 112566004, 310435233, "Rotselaarsebaan"), + new Val( 121, 310435233, 64487963, 64487963, "Rotselaarsebaan"), new Val("Rotselaarsebaan (310)", - 121, 310435233, 310435233, 64487963, "Rotselaarsebaan"), - new Val( 122, 64487963, 16302925, 16302925, "Nobelberg"), - new Val( 123, 64487963, 181347873, 181347873, "Nobelberg"), - new Val( 124, 64487963, 450119553, 450119553, "Kortrijksebaan"), - new Val( 125, 64487963, 310435229, 310435229, "Kortrijksebaan"), - new Val( 126, 64487963, 19166177, 19166177, "Kortrijksebaan"), - new Val( 127, 64487963, 181347876, 181347876, "Kortrijksebaan"), - new Val( 128, 64487963, 13858520, 13858520, "Kortrijksebaan"), - new Val( 129, 64487963, 173566709, 173566709, "Kortrijksebaan"), - new Val( 130, 64487963, 23957648, 23957648, "Kortrijksebaan"), - new Val( 131, 64487963, 310435230, 310435230, "Kortrijksebaan"), - new Val( 132, 64487963, 19112638, 19112638, "Kortrijksebaan"), - new Val( 133, 64487963, 659289514, 659289514, "Kortrijksebaan"), - new Val( 134, 64487963, 441280731, 441280731, "Kortrijksebaan"), - new Val( 135, 64487963, 659289513, 659289513, "Kortrijksebaan"), - new Val( 136, 64487963, 38502235, 38502235, "Kortrijksebaan"), - new Val( 137, 64487963, 310306431, 310306431, "Kortrijksebaan"), - new Val( 138, 64487963, 310306259, 310306259, "Dutselstraat"), - new Val( 139, 64487963, 22724214, 22724214, "Dutselstraat"), - new Val( 140, 64487963, 310306260, 310306260, "Dutselstraat"), - new Val( 141, 64487963, 185929631, 185929631, "Dutselstraat"), - new Val( 142, 64487963, 185929632, 185929632, "Dutselstraat"), - new Val( 143, 64487963, 137613419, 137613419, "Dutselstraat"), - new Val( 144, 64487963, 185929630, 185929630, "Dutselstraat"), - new Val( 145, 64487963, 13858519, 13858519, "Dutselstraat"), - new Val( 146, 64487963, 540115503, 540115503, "Gravenstraat"), - new Val( 147, 64487963, 182275357, 182275357, "Gravenstraat"), - new Val( 148, 64487963, 13858500, 13858500, "Gravenstraat"), - new Val( 149, 64487963, 13858502, 13858502, "Gravenstraat"), - new Val( 150, 64487963, 38501970, 38501970, "Gravenstraat"), - new Val( 151, 64487963, 13858501, 13858501, "Gravenstraat"), - new Val( 152, 64487963, 23334102, 23334102, "Gravenstraat"), - new Val( 153, 64487963, 137613435, 137613435, "Rodestraat"), - new Val( 154, 64487963, 13858504, 13858504, "Rodestraat"), - new Val( 155, 64487963, 118479385, 118479385, "Rodestraat"), - new Val( 156, 64487963, 182275362, 182275362, "Rodestraat"), - new Val( 157, 64487963, 182275361, 182275361, "Rodestraat"), - new Val( 158, 64487963, 117329495, 117329495, "Rodestraat"), - new Val( 159, 64487963, 318267937, 318267937, "Rodestraat"), - new Val( 160, 64487963, 318267938, 318267938, "Rodestraat"), - new Val( 161, 64487963, 137613436, 137613436, "Rodestraat"), - new Val( 162, 64487963, 615260297, 615260297, "Rodestraat"), - new Val( 163, 64487963, 10242646, 10242646, "Rodestraat"), - new Val( 164, 64487963, 112565994, 112565994, "Appelweg"), - new Val( 165, 64487963, 137613417, 137613417, "Appelweg"), - new Val( 166, 64487963, 10242649, 10242649, "Dorp"), - new Val( 167, 64487963, 187995152, 187995152, "Dorp"), - new Val( 168, 64487963, 137613438, 137613438, "Sint-Lambertusstraat"), - new Val( 169, 64487963, 151083447, 151083447, "Sint-Lambertusstraat"), - new Val( 170, 64487963, 609510455, 609510455, "Rijksweg"), - new Val( 171, 64487963, 609510456, 609510456, "Rijksweg"), - new Val( 172, 64487963, 38208831, 38208831, "Rijksweg"), - new Val( 173, 64487963, 38208830, 38208830, "Rijksweg"), - new Val( 174, 64487963, 345078878, 345078878, "Rijksweg"), - new Val( 175, 64487963, 345078877, 345078877, "Rijksweg"), - new Val("Rotselaarsebaan - Rijksweg (310)", - - 176, 64487963, 345078877, 13856508, "Rijksweg Aarschot-Winge"), + 122, 310435233, 64487963, 16302925, "Nobelberg"), + new Val( 123, 16302925, 181347873, 181347873, "Nobelberg"), + new Val( 124, 16302925, 450119553, 450119553, "Kortrijksebaan"), + new Val( 125, 16302925, 310435229, 310435229, "Kortrijksebaan"), + new Val( 126, 16302925, 19166177, 19166177, "Kortrijksebaan"), + new Val( 127, 16302925, 181347876, 181347876, "Kortrijksebaan"), + new Val( 128, 16302925, 13858520, 13858520, "Kortrijksebaan"), + new Val( 129, 16302925, 173566709, 173566709, "Kortrijksebaan"), + new Val( 130, 16302925, 23957648, 23957648, "Kortrijksebaan"), + new Val( 131, 16302925, 310435230, 310435230, "Kortrijksebaan"), + new Val( 132, 16302925, 19112638, 19112638, "Kortrijksebaan"), + new Val( 133, 16302925, 659289514, 659289514, "Kortrijksebaan"), + new Val( 134, 16302925, 441280731, 441280731, "Kortrijksebaan"), + new Val( 135, 16302925, 659289513, 659289513, "Kortrijksebaan"), + new Val( 136, 16302925, 38502235, 38502235, "Kortrijksebaan"), + new Val( 137, 16302925, 310306431, 310306431, "Kortrijksebaan"), + new Val( 138, 16302925, 310306259, 310306259, "Dutselstraat"), + new Val( 139, 16302925, 22724214, 22724214, "Dutselstraat"), + new Val( 140, 16302925, 310306260, 310306260, "Dutselstraat"), + new Val( 141, 16302925, 185929631, 185929631, "Dutselstraat"), + new Val( 142, 16302925, 185929632, 185929632, "Dutselstraat"), + new Val( 143, 16302925, 137613419, 137613419, "Dutselstraat"), + new Val( 144, 16302925, 185929630, 185929630, "Dutselstraat"), + new Val( 145, 16302925, 13858519, 13858519, "Dutselstraat"), + new Val( 146, 16302925, 540115503, 540115503, "Gravenstraat"), + new Val( 147, 16302925, 182275357, 182275357, "Gravenstraat"), + new Val( 148, 16302925, 13858500, 13858500, "Gravenstraat"), + new Val( 149, 16302925, 13858502, 13858502, "Gravenstraat"), + new Val( 150, 16302925, 38501970, 38501970, "Gravenstraat"), + new Val( 151, 16302925, 13858501, 13858501, "Gravenstraat"), + new Val( 152, 16302925, 23334102, 23334102, "Gravenstraat"), + new Val( 153, 16302925, 137613435, 137613435, "Rodestraat"), + new Val( 154, 16302925, 13858504, 13858504, "Rodestraat"), + new Val( 155, 16302925, 118479385, 118479385, "Rodestraat"), + new Val( 156, 16302925, 182275362, 182275362, "Rodestraat"), + new Val( 157, 16302925, 182275361, 182275361, "Rodestraat"), + new Val( 158, 16302925, 117329495, 117329495, "Rodestraat"), + new Val( 159, 16302925, 318267937, 318267937, "Rodestraat"), + new Val( 160, 16302925, 318267938, 318267938, "Rodestraat"), + new Val( 161, 16302925, 137613436, 137613436, "Rodestraat"), + new Val( 162, 16302925, 615260297, 615260297, "Rodestraat"), + new Val( 163, 16302925, 10242646, 10242646, "Rodestraat"), + new Val( 164, 16302925, 112565994, 112565994, "Appelweg"), + new Val( 165, 16302925, 137613417, 137613417, "Appelweg"), + new Val( 166, 16302925, 10242649, 10242649, "Dorp"), + new Val( 167, 16302925, 187995152, 187995152, "Dorp"), + new Val( 168, 16302925, 137613438, 137613438, "Sint-Lambertusstraat"), + new Val( 169, 16302925, 151083447, 151083447, "Sint-Lambertusstraat"), + new Val( 170, 16302925, 609510455, 609510455, "Rijksweg"), + new Val( 171, 16302925, 609510456, 609510456, "Rijksweg"), + new Val( 172, 16302925, 38208831, 38208831, "Rijksweg"), + new Val( 173, 16302925, 38208830, 38208830, "Rijksweg"), + new Val( 174, 16302925, 345078878, 345078878, "Rijksweg"), + new Val( 175, 16302925, 345078877, 345078877, "Rijksweg"), + new Val("Nobelberg - Rijksweg (310)", + + 176, 16302925, 345078877, 13856508, "Rijksweg Aarschot-Winge"), new Val( 177, 13856508, 345078875, 345078875, "Rijksweg"), new Val( 178, 13856508, 22870199, 22870199, "Rijksweg"), new Val( 179, 13856508, 136845549, 136845549, "Nieuwrodesesteenweg"), @@ -980,26 +957,32 @@ public void bus601_600_3_Test() { 200, 13856508, 345152127, 125101583, "Leuvensesteenweg"), new Val( 201, 125101583, 188863432, 188863432, "Leuvensesteenweg"), - new Val("Leuvensesteenweg (305;306;310;334;335;513)", + new Val("Leuvensesteenweg (37;305;306;310;334;335;513)", 202, 125101583, 188863432, 125101584, "Leuvensesteenweg"), new Val( 203, 125101584, 412810122, 412810122, "Leuvensesteenweg"), new Val( 204, 125101584, 13892080, 13892080, "Albertlaan"), - new Val("Leuvensesteenweg - Albertlaan (310;334;335;513)", + new Val("Leuvensesteenweg - Albertlaan (37;310;334;335;513)", 205, 125101584, 13892080, 125101554, "Albertlaan"), - new Val("Albertlaan (305;306;310;334;335;513)", + new Val("Albertlaan (37;220;305;306;310;334;335;513)", 206, 125101554, 125101554, 41405911, "Statiestraat"), new Val( 207, 41405911, 101376793, 101376793, "Statiestraat"), new Val( 208, 41405911, 125101590, 125101590, "Statieplein"), - new Val( 209, 41405911, 100289852, 100289852, "Statieplein"), - new Val( 210, 41405911, 100289892, 100289892, "Statieplein"), - new Val( 211, 41405911, 100289859, 100289859, "Statieplein"), - new Val("Statiestraat - Statieplein (305;306;310;334;335)", + new Val("Statiestraat - Statieplein (35;36;37;160;161;220;221;305;306;310;334;335;390;392;491;492;530;532;590)", - 212, 41405911, 100289859, 100289896, "Statieplein"), - new Val("Statieplein (310;334;335)", + 209, 41405911, 125101590, 100289852, "Statieplein"), + new Val("Statieplein (35;36;37;160;161;305;306;310;334;335;390;392;491;492;530;532;590)", + + 210, 100289852, 100289852, 100289892, "Statieplein"), + new Val("Statieplein (35;36;37;305;306;310;334;335;390;392;491;492;530;532;590)", + + 211, 100289892, 100289892, 100289859, "Statieplein"), + new Val("Statieplein (35;36;37;305;306;310;334;335;390;392;491;492;590)", + + 212, 100289859, 100289859, 100289896, "Statieplein"), + new Val("Statieplein (35;36;37;310;334;335;390;392;590)", 213, 100289896, 13856192, 0, "Statieplein") ); @@ -1020,51 +1003,63 @@ public void bus601_600_3_Test() { new Val( 20, 520502050, 255018560, 255018560, null), new Val( 21, 520502050, 26614159, 26614159, null), new Val( 22, 520502050, 20402695, 20402695, "Astridstraat"), - new Val( 23, 520502050, 116911330, 116911330, "Schrieksebaan"), - new Val( 24, 520502050, 348402887, 348402887, "Schrieksebaan"), - new Val( 25, 520502050, 79057162, 79057162, "Schrieksebaan"), - new Val( 26, 520502050, 244077928, 244077928, "Schrieksebaan"), - new Val( 27, 520502050, 25706520, 25706520, "Schrieksebaan"), - new Val( 28, 520502050, 106526457, 106526457, null), - new Val( 29, 520502050, 79057173, 79057173, null), - new Val( 30, 520502050, 106526331, 106526331, null), - new Val( 31, 520502050, 106526391, 106526391, "Werchtersebaan"), - new Val( 32, 520502050, 106526409, 106526409, "Werchtersebaan"), - new Val( 33, 520502050, 116911314, 116911314, "Werchtersebaan"), - new Val( 34, 520502050, 116911310, 116911310, "Werchtersebaan"), - new Val( 35, 520502050, 116911322, 116911322, "Werchtersebaan"), - new Val( 36, 520502050, 116911317, 116911317, "Werchtersebaan"), - new Val( 37, 520502050, 22080665, 22080665, "Werchtersebaan"), - new Val( 38, 520502050, 22080651, 22080651, "Tremelobaan"), - new Val( 39, 520502050, 126264637, 126264637, "Tremelobaan"), - new Val( 40, 520502050, 25706405, 25706405, "Tremelobaan"), - new Val( 41, 520502050, 349648270, 349648270, "Tremelobaan"), - new Val( 42, 520502050, 349648273, 349648273, "Tremelobaan"), - new Val( 43, 520502050, 349648272, 349648272, "Tremelobaan"), - new Val( 44, 520502050, 25706363, 25706363, "Tremelobaan"), - new Val( 45, 520502050, 349648271, 349648271, "Tremelobaan"), - new Val( 46, 520502050, 32823731, 32823731, "Tremelobaan"), - new Val( 47, 520502050, 116704290, 116704290, "Tremelobaan"), - new Val( 48, 520502050, 49577807, 49577807, "Sint-Jansstraat"), - new Val( 49, 520502050, 205303320, 205303320, "Sint-Jansstraat"), - new Val( 50, 520502050, 205303322, 205303322, "Sint-Jansstraat"), - new Val( 51, 520502050, 205303321, 205303321, "Sint-Jansstraat"), - new Val( 52, 520502050, 116911351, 116911351, "Sint-Jansstraat"), - new Val( 53, 520502050, 21355673, 21355673, "Sint-Jansstraat"), - new Val( 54, 520502050, 26591703, 26591703, "Werchterplein"), - new Val( 55, 520502050, 24037032, 24037032, "Hoekje"), - new Val( 56, 520502050, 13858894, 13858894, "Hoekje"), - new Val( 57, 520502050, 292820652, 292820652, "Nieuwebaan"), - new Val( 58, 520502050, 98918943, 98918943, "Nieuwebaan"), - new Val( 59, 520502050, 292670109, 292670109, "Nieuwebaan"), - new Val( 60, 520502050, 292670115, 292670115, "Nieuwebaan"), - new Val( 61, 520502050, 292670113, 292670113, "Nieuwebaan"), - new Val( 62, 520502050, 292670113, 292670110, "Nieuwebaan"), - new Val( 63, 520502050, 292670113, 292670112, "Nieuwebaan"), - new Val( 64, 520502050, 292670113, 24041208, "Provinciebaan"), - new Val("Astridstraat - Nieuwebaan (333;433)", - - 65, 520502050, 292670113, 100086271, "Provinciebaan"), + new Val("Astridstraat (333;433;520;527;530)", + + 23, 520502050, 20402695, 116911330, "Schrieksebaan"), + new Val( 24, 116911330, 348402887, 348402887, "Schrieksebaan"), + new Val( 25, 116911330, 79057162, 79057162, "Schrieksebaan"), + new Val("Schrieksebaan (333;433;520;527;530)", + + 26, 116911330, 79057162, 244077928, "Schrieksebaan"), + new Val("Schrieksebaan (333;433;520;527;530;532)", + + 27, 244077928, 244077928, 25706520, "Schrieksebaan"), + new Val( 28, 25706520, 106526457, 106526457, null), + new Val( 29, 25706520, 79057173, 79057173, null), + new Val("Schrieksebaan (333;433;520;527;532)", + + 30, 25706520, 79057173, 106526331, null), + new Val("(333;433;520;527;530;532)", + + 31, 106526331, 106526331, 106526391, "Werchtersebaan"), + new Val( 32, 106526391, 106526409, 106526409, "Werchtersebaan"), + new Val( 33, 106526391, 116911314, 116911314, "Werchtersebaan"), + new Val( 34, 106526391, 116911310, 116911310, "Werchtersebaan"), + new Val( 35, 106526391, 116911322, 116911322, "Werchtersebaan"), + new Val( 36, 106526391, 116911317, 116911317, "Werchtersebaan"), + new Val( 37, 106526391, 22080665, 22080665, "Werchtersebaan"), + new Val( 38, 106526391, 22080651, 22080651, "Tremelobaan"), + new Val( 39, 106526391, 126264637, 126264637, "Tremelobaan"), + new Val( 40, 106526391, 25706405, 25706405, "Tremelobaan"), + new Val( 41, 106526391, 349648270, 349648270, "Tremelobaan"), + new Val( 42, 106526391, 349648273, 349648273, "Tremelobaan"), + new Val( 43, 106526391, 349648272, 349648272, "Tremelobaan"), + new Val( 44, 106526391, 25706363, 25706363, "Tremelobaan"), + new Val( 45, 106526391, 349648271, 349648271, "Tremelobaan"), + new Val("Werchtersebaan - Tremelobaan (333;433;532)", + + 46, 106526391, 349648271, 32823731, "Tremelobaan"), + new Val( 47, 32823731, 116704290, 116704290, "Tremelobaan"), + new Val( 48, 32823731, 49577807, 49577807, "Sint-Jansstraat"), + new Val( 49, 32823731, 205303320, 205303320, "Sint-Jansstraat"), + new Val( 50, 32823731, 205303322, 205303322, "Sint-Jansstraat"), + new Val( 51, 32823731, 205303321, 205303321, "Sint-Jansstraat"), + new Val( 52, 32823731, 116911351, 116911351, "Sint-Jansstraat"), + new Val( 53, 32823731, 21355673, 21355673, "Sint-Jansstraat"), + new Val( 54, 32823731, 26591703, 26591703, "Werchterplein"), + new Val( 55, 32823731, 24037032, 24037032, "Hoekje"), + new Val( 56, 32823731, 13858894, 13858894, "Hoekje"), + new Val( 57, 32823731, 292820652, 292820652, "Nieuwebaan"), + new Val( 58, 32823731, 98918943, 98918943, "Nieuwebaan"), + new Val( 59, 32823731, 292670109, 292670109, "Nieuwebaan"), + new Val( 60, 32823731, 292670115, 292670115, "Nieuwebaan"), + new Val( 61, 32823731, 292670113, 292670113, "Nieuwebaan"), + new Val( 62, 32823731, 292670113, 292670110, "Nieuwebaan"), + new Val( 63, 32823731, 292670113, 292670112, "Nieuwebaan"), + new Val( 64, 32823731, 292670113, 24041208, "Provinciebaan"), + new Val("Tremelobaan - Nieuwebaan (333;433)", + + 65, 32823731, 292670113, 100086271, "Provinciebaan"), new Val( 66, 100086271, 116535777, 116535777, "Provinciebaan"), new Val( 67, 100086271, 37712785, 37712785, "Provinciebaan"), new Val( 68, 100086271, 25706276, 25706276, "Provinciebaan"), @@ -1219,7 +1214,7 @@ public void bus601_600_3_Test() { testPtLine(expectedValues, PT_ROUTE_BUS_433_TO_LEUVEN_STATION); - generateListOfExpectedValues(PT_ROUTE_BUS_358); +// generateListOfExpectedValues(PT_ROUTE_BUS_310_TO_AARSCHOT_STATION); } @@ -1291,13 +1286,14 @@ public void testPtLine(List expectedValues, Relation busRouteRelation) { public void generateListOfExpectedValues(Relation relation) { List members = relation.getMembers(); RouteSegmentToExtract segment = new RouteSegmentToExtract(relation); - List wayMembers = null; + List wayMembers; String listVal = ""; String className = ""; Way way; String wayName = null; - String note = null; - System.out.printf(" %sexpectedValues = Arrays.asList(\n", listVal); + String note; + StringBuilder output = new StringBuilder(); + output.append(String.format(" %sexpectedValues = Arrays.asList(\n", listVal)); for (int i = 0; i < members.size() - 1; i++) { RelationMember member = members.get(i); if (member.isWay() && RouteUtils.isPTWay(member)) { @@ -1307,34 +1303,36 @@ public void generateListOfExpectedValues(Relation relation) { RouteSegmentToExtract ns = segment.addPTWayMember(i); wayMembers = segment.getWayMembers(); if (ns != null) { - System.out.printf(" new Val(\"%s\",\n\n % 4d,% 10d,% 10d,% 10d, %s),\n", + output.append(String.format(" new Val(\"%s\",\n\n % 4d,% 10d,% 10d,% 10d, %s),\n", note, i, wayMembers.get(0).getMember().getId(), wayMembers.get(wayMembers.size() - 1).getMember().getId(), (way != null && way.getId() != 0) ? way.getId() : 0, wayName - ); + )); segment = ns; } else { - System.out.printf(" new Val(% 4d,% 10d,% 10d,% 10d, %s),\n", + output.append(String.format(" new Val(% 4d,% 10d,% 10d,% 10d, %s),\n", i, - (wayMembers.size() > 0 ) ? wayMembers.get(0).getMember().getId() : 0, - (wayMembers.size() > 1 ) ? wayMembers.get(wayMembers.size() - 1).getMember().getId() : 0, + (wayMembers.size() > 0) ? wayMembers.get(0).getMember().getId() : 0, + (wayMembers.size() > 1) ? wayMembers.get(wayMembers.size() - 1).getMember().getId() : 0, (way != null && way.getId() != 0) ? way.getId() : 0, wayName - ); + )); } } } - System.out.printf(" new Val(\"%s\",\n\n % 4d,% 10d,% 10d,% 10d, %s)\n );\n\n", - note, + List lastSegmentMembers = segment.getWayMembers(); + output.append(String.format(" new Val(\"%s\",\n\n % 4d,% 10d,% 10d,% 10d, %s)\n );\n\n", + segment.getNote(), members.size() - 1, - (wayMembers != null && wayMembers.size() > 0 ) ? wayMembers.get(0).getMember().getId() : 0, + lastSegmentMembers.get(0).getMember().getId(), members.get(members.size() - 1).getMember().getId(), 0, wayName - ); + )); + StringBuilder lineName = new StringBuilder(relation.get("route")); if (relation.hasKey("ref")) lineName.append("_").append(relation.get("ref")); if (relation.hasKey("to")) lineName.append("_TO_").append(relation.get("to")); @@ -1343,10 +1341,15 @@ public void generateListOfExpectedValues(Relation relation) { if (!via.contains("-")) lineName.append("_VIA_").append(via); } - System.out.printf(" testPtLine(expectedValues, PT_ROUTE_%s);\n", lineName.toString() + output.append(String.format(" testPtLine(expectedValues, PT_ROUTE_%s);\n", lineName.toString() .toUpperCase(Locale.ROOT) - .replaceAll("\\sPERRON\\s\\d+", "") - .replaceAll("\\s+", " ") - .replaceAll(" ", "_")); + .replaceAll("\\sPERRON\\s\\d+", "") + .replaceAll("\\s+", " ") + .replaceAll(" ", "_"))); + + Toolkit.getDefaultToolkit().getSystemClipboard() + .setContents(new StringSelection(output.toString()), null); + + System.out.print(output); } } From 0355688ddca06d5069819cebb2b948fc25940dec Mon Sep 17 00:00:00 2001 From: PolyglotOpenstreetmap Date: Fri, 6 Nov 2020 15:41:51 +0100 Subject: [PATCH 52/52] It seems like I succeeded in suppressing the IndexOutOfBounds exception, so the user is not affected by it. It's still there though, but I can't figure out what the root cause of it is. I see this one a lot less: java.lang.IllegalArgumentException: Width and height must be >= 0 But it still happens occasionally. --- ...actRelationMembersToNewRelationAction.java | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java index fe81cc34..2ee27d8b 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/actions/ExtractRelationMembersToNewRelationAction.java @@ -1,5 +1,6 @@ package org.openstreetmap.josm.plugins.pt_assistant.actions; +import static java.lang.Thread.sleep; import static java.util.Collections.emptyList; import java.awt.event.ActionEvent; @@ -19,14 +20,19 @@ import org.openstreetmap.josm.command.Command; import org.openstreetmap.josm.command.SequenceCommand; import org.openstreetmap.josm.data.UndoRedoHandler; +import org.openstreetmap.josm.data.osm.OsmPrimitiveType; import org.openstreetmap.josm.data.osm.Relation; import org.openstreetmap.josm.data.osm.RelationMember; +import org.openstreetmap.josm.gui.MainApplication; import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel; +import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager; import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; import org.openstreetmap.josm.gui.dialogs.relation.actions.AbstractRelationEditorAction; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorActionAccess; import org.openstreetmap.josm.gui.dialogs.relation.actions.IRelationEditorUpdateOn; +import org.openstreetmap.josm.gui.layer.LayerManager; +import org.openstreetmap.josm.gui.layer.OsmDataLayer; import org.openstreetmap.josm.plugins.pt_assistant.data.RouteSegmentToExtract; import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; import org.openstreetmap.josm.tools.I18n; @@ -106,12 +112,49 @@ public void actionPerformed(ActionEvent actionEvent) { ) == JOptionPane.OK_OPTION ) { if (cbFindAllSegmentsAutomatically.isSelected()) { + // To avoid an IndexOutOfBoundsError, let's close this relation editor... + OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer(); + RelationEditor ed = RelationDialogManager.getRelationDialogManager().getEditorForRelation(layer, originalRelation); + if (ed != null) { + ed.dispose(); + } final Relation clonedRelation = new Relation(originalRelation); splitInSegments(clonedRelation, cbConvertToSuperroute.isSelected()); commands.add(new ChangeCommand(originalRelation, clonedRelation)); UndoRedoHandler.getInstance().add( new SequenceCommand(I18n.tr("Replace ways with segment relations"), commands)); + // After changing the relation, let's open a fresh editor + // oddly it shows the old state of the relation + // even though I made a detour over the relation's id + RelationEditor newEditor = RelationEditor.getEditor( + getEditor().getLayer(), + (Relation) originalRelation.getDataSet().getPrimitiveById(originalRelation.getId(), OsmPrimitiveType.RELATION), + emptyList()); + newEditor.setVisible(true); + newEditor.setAlwaysOnTop(true); + + // alas, when reloading there is still the pesky IndexOudOfBounds + // Closing the relation editor interactively + // and reopening it, DOES show the new state + // this is driving me crazy. Why is it a problem that the length + // of the memberList becomes shorter? + try { + newEditor.reloadDataFromRelation(); + } catch (IndexOutOfBoundsException e) { + System.out.print(e); + // no idea what to do here + // the exception was caught, the relation editor + // shows the new situation, sometimes instantaneously, sometimes after a few seconds + + // I don't see this one as often anymore: + // java.lang.IllegalArgumentException: Width and height must be >= 0 + + // But it does still happen. + + // This also shows (almost all the time): + // WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage. + } } else { Relation clonedRelation = new Relation(originalRelation); RouteSegmentToExtract segment = new RouteSegmentToExtract(clonedRelation, @@ -146,8 +189,8 @@ public void actionPerformed(ActionEvent actionEvent) { extraEditor.setVisible(true); extraEditor.setAlwaysOnTop(true); } + editor.reloadDataFromRelation(); } - editor.reloadDataFromRelation(); } }