Opened 4 years ago
Last modified 4 years ago
#19294 new enhancement
add a button to the relation editor to make it easier to create superroute relations
Reported by: | Polyglot | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | relation editor, copy relation, superroute | Cc: |
Description
I would like to have a button like the copy relation button, with the following differences:
- The copied relation contains all the ways that were selected in the origin relation.
- Those selected ways are removed from the origin route relation.
- In any superroute relations that contain these ways in the same order, those ways are substituted with the newly created route relation.
Attachments (6)
Change History (16)
by , 4 years ago
Attachment: | F79 as route relation, blue is existing parts, magenta is GPX.png added |
---|
by , 4 years ago
Attachment: | F79CON~1.PNG added |
---|
F79 converted to 2 superroute relations, one for planned trajectory, one for alternative that is cyclable today. Also created 2 route relations. An empty one of proposed parts. One with ways in it that will need to become several route relations
by , 4 years ago
Attachment: | F79 first step, create route relation for existing part in Melveren shared by both superroute relations.png added |
---|
F79 first step, create route relation for existing part in Melveren shared by both superroute relations
by , 4 years ago
Attachment: | F79 Select relation, after creation it will be highlighted in blue in the relations list.PNG added |
---|
F79 select new route relation, after creation it will be highlighted in blue in the relations list
by , 4 years ago
Attachment: | Now select the new relation's members.PNG added |
---|
Now select the new relation's members
by , 4 years ago
Attachment: | F79 and remove them in all 3 relations.PNG added |
---|
F79 and remove them in all 3 relations
comment:1 by , 4 years ago
I tried to clarify what I'm trying to achieve. After this action, I would create a route relation containing a proposed highway=cycleway to go in the top superroute and another route relation with an alternative that can be followed today and in the next 10 years before the planned cycleway is actually realised. Little by little parts are realised, and slowly both superroutes will converge, but this may take a few months to 15 years depending on budget and feasibility. For some parts people will need to give up some private property. That in itself takes time.
I hope it is clearer now why I'd like to see a button implemented to make this action easier.
Jo
comment:2 by , 4 years ago
Keywords: | relation editor copy relation superroute added |
---|
comment:3 by , 4 years ago
The name of this action could be something like "Move selected members to new relation (also from similar relations)"?
This action might better be implemented in a relation/route specific plugin since it is tied to a very specific workflow?
comment:4 by , 4 years ago
Convert section to route relation and substitute its way members in superroute relations?
I'll discuss with Michael and Florian this evening if it makes sense to add it to the PT_Assistant plugin (and whether it is something to distract the GSoC student with, or whether it's something I better try to implement myself). My personal preference would be to add it to core though. But it can always be moved over when it works properly, I guess.
follow-up: 6 comment:5 by , 4 years ago
I'm implementing this myself (with extensive help from Florian):
https://github.com/JOSM/pt_assistant/tree/extract_relation
Unfortunately there is still a bug in it. Sometimes the relation editor can not reload the relation in line 52:
editorAccess.getEditor().reloadDataFromRelation();
Details are here:
https://github.com/JOSM/pt_assistant/pull/26
I have no idea what is going wrong. I'm changing the cloned relation and then committing the changes using the UndoRedoHandler. Does the relation editor need to be notified about a change in the relation it's displaying?
Jo
comment:6 by , 4 years ago
Replying to Polyglot:
Unfortunately there is still a bug in it. Sometimes the relation editor can not reload the relation in line 52:
editorAccess.getEditor().reloadDataFromRelation();
Next time, please, add the exception you are talking about. Thanks
It looks similar to #19055, maybe it is within core.
comment:8 by , 4 years ago
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-07-30 12:44:04 +0200 (Thu, 30 Jul 2020) Build-Date:2020-07-31 01:30:49 Revision:16812 Relative:URL: ^/trunk Identification: JOSM/1.5 (16812 en) Linux Mint 19.3 Tricia Memory Usage: 121 MB / 3988 MB (46 MB allocated, but free) Java version: 1.8.0_252-b09, Eclipse OpenJ9, Eclipse OpenJ9 VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1600x900 (scaling 1.0x1.0) Maximum Screen Size: 1600x900 Best cursor sizes: 16x16 -> 16x16, 32x32 -> 32x32 fonts-noto: fonts-noto:- VM arguments: [-Xoptionsfile=<java.home>/lib/amd64/compressedrefs/options.default, -Xlockword:mode=default,noLockword=java/lang/String,noLockword=java/util/MapEntry,noLockword=java/util/HashMap$Entry,noLockword=org/apache/harmony/luni/util/ModifiedMap$Entry,noLockword=java/util/Hashtable$Entry,noLockword=java/lang/invoke/MethodType,noLockword=java/lang/invoke/MethodHandle,noLockword=java/lang/invoke/CollectHandle,noLockword=java/lang/invoke/ConstructorHandle,noLockword=java/lang/invoke/ConvertHandle,noLockword=java/lang/invoke/ArgumentConversionHandle,noLockword=java/lang/invoke/AsTypeHandle,noLockword=java/lang/invoke/ExplicitCastHandle,noLockword=java/lang/invoke/FilterReturnHandle,noLockword=java/lang/invoke/DirectHandle,noLockword=java/lang/invoke/ReceiverBoundHandle,noLockword=java/lang/invoke/DynamicInvokerHandle,noLockword=java/lang/invoke/FieldHandle,noLockword=java/lang/invoke/FieldGetterHandle,noLockword=java/lang/invoke/FieldSetterHandle,noLockword=java/lang/invoke/StaticFieldGetterHandle,noLockword=java/lang/invoke/StaticFieldSetterHandle,noLockword=java/lang/invoke/IndirectHandle,noLockword=java/lang/invoke/InterfaceHandle,noLockword=java/lang/invoke/VirtualHandle,noLockword=java/lang/invoke/PrimitiveHandle,noLockword=java/lang/invoke/InvokeExactHandle,noLockword=java/lang/invoke/InvokeGenericHandle,noLockword=java/lang/invoke/VarargsCollectorHandle,noLockword=java/lang/invoke/ThunkTuple, -Dcom.ibm.oti.vm.bootstrap.library.path=<java.home>/lib/amd64/compressedrefs:<java.home>/lib/amd64, -Dsun.boot.library.path=<java.home>/lib/amd64/compressedrefs:<java.home>/lib/amd64, -Djava.library.path=<java.home>/lib/amd64/compressedrefs:<java.home>/lib/amd64:/usr/lib64:/usr/lib, -Djava.home=<java.home>, -Djava.ext.dirs=<java.home>/lib/ext, -Duser.dir=${HOME}/IdeaProjects/pt_assistant, -Djava.class.path=., -Djosm.cache=<josm.cache>, -Djosm.pref=<josm.pref>, -Djosm.userdata=<josm.userdata>, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant, -Djava.class.path=${HOME}/IdeaProjects/pt_assistant/build/classes/java/main:${HOME}/IdeaProjects/pt_assistant/build/resources/main:${HOME}/.gradle/caches/modules-2/files-2.1/org.openstreetmap.josm/josm/16812/df5c7a03888302a7ffcb6f713f5408d5b48ba0e7/josm-16812.jar, -Dsun.java.command=org.openstreetmap.josm.gui.MainApplication --load-preferences=file:${HOME}/IdeaProjects/pt_assistant/build/josm-custom-config/requiredPlugins.xml, -Dsun.java.launcher=SUN_STANDARD, -Dsun.java.launcher.pid=20538] Program arguments: [--load-preferences=file:${HOME}/IdeaProjects/pt_assistant/build/josm-custom-config/requiredPlugins.xml] Dataset consistency test: No problems found Plugins: + pt_assistant (2.1.10-118-ge3ff059-dirty) Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 Last errors/warnings: - E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 7, Size: 7 === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-0 (28) of main java.lang.IndexOutOfBoundsException: Index: 7, Size: 7 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel$$Lambda$795/000000009447A1F0.apply(Unknown Source) at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:257) at java.util.Spliterators$IntArraySpliterator.forEachRemaining(Spliterators.java:1032) at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getSelectedMembers(MemberTableModel.java:515) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.hasIncompleteSelectedMembers(MemberTableModel.java:415) 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 javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:296) at javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:198) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.populate(MemberTableModel.java:227) at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:324) at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:317) at org.openstreetmap.josm.plugins.pt_assistant.actions.ExtractRelationMembersToNewRelationAction.actionPerformed(ExtractRelationMembersToNewRelationAction.java:52) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.Component.processMouseEvent(Component.java:6539) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(AccessController.java:704) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(AccessController.java:704) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
I had added this to the Github thread I referred to.
follow-up: 10 comment:9 by , 4 years ago
This is a fresh one:
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-07-30 12:44:04 +0200 (Thu, 30 Jul 2020) Build-Date:2020-07-31 01:30:49 Revision:16812 Relative:URL: ^/trunk Identification: JOSM/1.5 (16812 en) Linux Mint 19.3 Tricia Memory Usage: 131 MB / 3988 MB (10 MB allocated, but free) Java version: 1.8.0_252-b09, Eclipse OpenJ9, Eclipse OpenJ9 VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1600x900 (scaling 1.0x1.0) Maximum Screen Size: 1600x900 Best cursor sizes: 16x16 -> 16x16, 32x32 -> 32x32 fonts-noto: fonts-noto:- VM arguments: [-Xoptionsfile=<java.home>/lib/amd64/compressedrefs/options.default, -Xlockword:mode=default,noLockword=java/lang/String,noLockword=java/util/MapEntry,noLockword=java/util/HashMap$Entry,noLockword=org/apache/harmony/luni/util/ModifiedMap$Entry,noLockword=java/util/Hashtable$Entry,noLockword=java/lang/invoke/MethodType,noLockword=java/lang/invoke/MethodHandle,noLockword=java/lang/invoke/CollectHandle,noLockword=java/lang/invoke/ConstructorHandle,noLockword=java/lang/invoke/ConvertHandle,noLockword=java/lang/invoke/ArgumentConversionHandle,noLockword=java/lang/invoke/AsTypeHandle,noLockword=java/lang/invoke/ExplicitCastHandle,noLockword=java/lang/invoke/FilterReturnHandle,noLockword=java/lang/invoke/DirectHandle,noLockword=java/lang/invoke/ReceiverBoundHandle,noLockword=java/lang/invoke/DynamicInvokerHandle,noLockword=java/lang/invoke/FieldHandle,noLockword=java/lang/invoke/FieldGetterHandle,noLockword=java/lang/invoke/FieldSetterHandle,noLockword=java/lang/invoke/StaticFieldGetterHandle,noLockword=java/lang/invoke/StaticFieldSetterHandle,noLockword=java/lang/invoke/IndirectHandle,noLockword=java/lang/invoke/InterfaceHandle,noLockword=java/lang/invoke/VirtualHandle,noLockword=java/lang/invoke/PrimitiveHandle,noLockword=java/lang/invoke/InvokeExactHandle,noLockword=java/lang/invoke/InvokeGenericHandle,noLockword=java/lang/invoke/VarargsCollectorHandle,noLockword=java/lang/invoke/ThunkTuple, -Dcom.ibm.oti.vm.bootstrap.library.path=<java.home>/lib/amd64/compressedrefs:<java.home>/lib/amd64, -Dsun.boot.library.path=<java.home>/lib/amd64/compressedrefs:<java.home>/lib/amd64, -Djava.library.path=<java.home>/lib/amd64/compressedrefs:<java.home>/lib/amd64:/usr/lib64:/usr/lib, -Djava.home=<java.home>, -Djava.ext.dirs=<java.home>/lib/ext, -Duser.dir=${HOME}/IdeaProjects/pt_assistant, -Djava.class.path=., -Djosm.cache=<josm.cache>, -Djosm.pref=<josm.pref>, -Djosm.userdata=<josm.userdata>, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant, -Djava.class.path=${HOME}/IdeaProjects/pt_assistant/build/classes/java/main:${HOME}/IdeaProjects/pt_assistant/build/resources/main:${HOME}/.gradle/caches/modules-2/files-2.1/org.openstreetmap.josm/josm/16812/df5c7a03888302a7ffcb6f713f5408d5b48ba0e7/josm-16812.jar, -Dsun.java.command=org.openstreetmap.josm.gui.MainApplication --load-preferences=file:${HOME}/IdeaProjects/pt_assistant/build/josm-custom-config/requiredPlugins.xml, -Dsun.java.launcher=SUN_STANDARD, -Dsun.java.launcher.pid=6035] Program arguments: [--load-preferences=file:${HOME}/IdeaProjects/pt_assistant/build/josm-custom-config/requiredPlugins.xml] Dataset consistency test: No problems found Plugins: + pt_assistant (2.1.10-120-g4d1af91-dirty) Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 Last errors/warnings: - E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 8, Size: 8 - E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 8, Size: 8 - E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 92, Size: 92 === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-0 (28) of main java.lang.IndexOutOfBoundsException: Index: 92, Size: 92 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel$$Lambda$713/000000005438D140.apply(Unknown Source) at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:257) at java.util.Spliterators$IntArraySpliterator.forEachRemaining(Spliterators.java:1032) at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getSelectedMembers(MemberTableModel.java:515) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.hasIncompleteSelectedMembers(MemberTableModel.java:415) 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 javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:296) at javax.swing.table.AbstractTableModel.fireTableDataChanged(AbstractTableModel.java:198) at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.populate(MemberTableModel.java:227) at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.populateModels(GenericRelationEditor.java:324) at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.reloadDataFromRelation(GenericRelationEditor.java:317) at org.openstreetmap.josm.plugins.pt_assistant.actions.ExtractRelationMembersToNewRelationAction.actionPerformed(ExtractRelationMembersToNewRelationAction.java:59) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.Component.processMouseEvent(Component.java:6539) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(AccessController.java:704) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(AccessController.java:704) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
F79 as route relation, blue is existing parts, magenta is GPX.png