[josm-dev] Jumbo Patch

Dave Hansen dave at sr71.net
Sun Dec 16 22:05:06 GMT 2007


On Sun, 2007-12-16 at 22:14 +0100, Gabriel Ebner wrote:
> Wouldn't it make more sense to have an AddNodeToWayCommand, a
> RemoveNodeFromWayCommand, and a ReplaceNodeInWayCommand, taking indices
> instead of nodes?  This would get us rid of the highly complex Way.replace
> logic, and we'd be able to properly support duplicate nodes, while making it
> possible to better guard against erroneous requests.

I don't think indexes work, though.  If we have a way:

        W----X----Y----Z
        
        RemoveNodeFromCommand('X');
        RemoveNodeFromCommand('Y');
        
        W----Z
        
On the other hand, if we work by indexes:
        
        W(0)----X(1)----Y(2)----Z(3)
        
        RemoveNodeFromCommand(1);
        RemoveNodeFromCommand(2);
        
After first command executes

        W(0)----Y(1)----Z(2)

After second command:

        W(0)----Y(1)

-- Dave





More information about the josm-dev mailing list