[OSM-dev] revert stuff
Richard Fairhurst
richard at systemeD.net
Sun Nov 25 13:18:03 GMT 2007
Yay, Steve, you're my hero!
Steve Coast actually looked at the code and then wrote:
> If I create a two-node way from node 1 to 2
> Then I move node 2
> then I revert the way
> Then the revert code creates a new node, 3, where the old node 2 was,
> and links the way 1->3
>
> Ignoring the potlatch thing of updating all the nodes on a way when
> something changes -
>
> Shouldn't the behaviour be to update node 2 back to the original
> position?
I rewrote that bit about five times trying to decide the best way of
handling it!
Current behaviour (for revert, not undelete) is:
- if the node from the old way is currently visible=1, then create a
new node (because we don't want to mess up anything currently in use)
- otherwise move it back
The behaviour should really be:
- if the node from the old way is currently visible=1 _and_ used in
other ways, then create a new node
- otherwise move it back
Does that make sense?
(I made a comment to that effect in lines 705-707 but hadn't got
round to implementing it yet. :) )
cheers
Richard
P.S. For anyone else who wants to look, the code is at
http://trac.openstreetmap.org/browser/sites/rails_port/app/
controllers/amf_controller.rb#L316
and
http://trac.openstreetmap.org/browser/sites/rails_port/app/
controllers/amf_controller.rb#L661
More information about the dev
mailing list