Schroedinger's Ways

Posted by EdLoach on 8 November 2012 in English (English)

I've recently started learning Git(hub) with a view to helping with Potlatch2 tags. My first commit (which is now live) was to add access=destination to roads.

Due to conversations on the #osm irc channel I thought I'd look into trac ticket 4378 regarding creating ways with only one node.

I trawled through the code and worked out what was happening when you deleted the last but one node in a way, which seemed to be the easiest way to create such ways, and came up with what seemed a simple change but after some more testing I reverted this change as although I think it improves things it isn't a cure and I want to do some more work on it (aside: the problem from the above is that after deleting the second last node it deletes the way, but you need to undo twice to restore that second last node - after the first undo there is a single node way in existence that can be saved).

So I started considering when a way is a way. The easy answer is that it has to have 2 nodes, so if you select one node of a two node way and delete it then the way should be deleted before the node (which would fix the undo issue I mention above). But if you are deleting the nodes while drawing a way you can get to the stage where the second last node is deleted but you are still in draw mode, so whether the way should be deleted or not depends on whether you delete the last node or add another. So in draw mode you don't want to delete the way unless the last node is deleted (you'd lose the id, so the history of any changes, and all the tags/relation memberships).

It is this indeterminate state of whether the way exists depending whether you add a node, exit draw mode, or remove the last node that I decided to call a Schroedinger's Way.

And I think the exiting draw mode when you have a 1 node Schroedinger's Way is going to be the hardest bit to address, as you want to delete the way but not have the undo issue I mention above, but the second last node is already deleted.

Perhaps someone who has developed Potlatch 2 longer than I (as in most of the people who have ever developed Potlatch 2) will have some ideas about how to address this.

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

  • Image

    ![Alt text](URL)

Login to leave a comment