Modify

Opened 8 years ago

Last modified 8 years ago

#3512 new enhancement

Allow undeleting ways

Reported by: bilbo Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

In potlatch you can undelete ways - there is command to show all ways that are deleted on server and you can select one of them and undelete it.

I think this functionality could be added to JOSM as well.

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Gubaer

In JOSM too. Select a way and download the selection. If the way is deleted you get a conflict. Resolve the conflict and decide to undelete. Undeleting is already implemented. Because a "real" undelete on the server isn't possible it creates a clone of the last version before the way was deleted.

It doesn't restore the network of dependencies from relations to the last undeleted version of the way, though. This will be more complicated but we will probably have to work on this if we want to be able to revert changesets from JOSM.

comment:2 Changed 8 years ago by bilbo

But in Potlatch you can press "U" (or "R", I don't remember which one of these) and you see all ways in current view (with current bbox) that were ever deleted (even if it was some time ago and you don't know ID of the deleted way). From this you can resurrect them (which will basically create a new way that looks exactly like the old one :)

comment:3 Changed 8 years ago by Gubaer

Hmm, I'm not aware of any API call which would allow for quering deleted ways in a bounding box. AFAIK, Potlach uses it's own API which is not the same as API 0.6.

comment:4 Changed 8 years ago by xeen

Tom Hughes wrote this on the mailing list: (as a reply of "Deep History" App)

{{{BTW do not code anything new that uses amf_controller - anything which
is can currently do that the XML API can't will have to be added to the

XML API for Potlatch 2 anyway as AMF controller will be going away at

that point.

Tom}}}

Looks like we're going to get something like this in the future. I had a look at amf_controller and it looks like the following code provides this feature:

  # Find deleted ways in current bounding box (similar to whichways, but ways
  # with a deleted node only - not POIs or relations).

  def whichways_deleted(xmin, ymin, xmax, ymax) #:doc:
    amf_handle_error_with_timeout("'whichways_deleted'",nil,nil) do
      enlarge = [(xmax-xmin)/8,0.01].min
      xmin -= enlarge; ymin -= enlarge
      xmax += enlarge; ymax += enlarge

      # check boundary is sane and area within defined
      # see /config/application.yml
      check_boundaries(xmin, ymin, xmax, ymax)

      nodes_in_area = Node.find_by_area(ymin, xmin, ymax, xmax, :conditions => ["current_ways.visible = ?", false], :include => :ways_via_history)
      way_ids = nodes_in_area.collect { |node| node.ways_via_history_ids }.flatten.uniq

      [0,'',way_ids]
    end
  end

Haven't looked at the exact implementation, I'd rather wait for Potlatch 2 and have the API do the work. If I understand correctly it requests the history for each node which would be a ton of HTTP Requests to implement offline. But maybe I'm wrong.

comment:5 Changed 8 years ago by Gubaer

Yes, I saw it too on the list. That's the Potlatch API I was referring to.

I'm hesitant to use it from JOSM, for the reasons mentioned of the list: lack of documentation, lack of transparency.

If I understand correctly it requests the history for each node which would be a ton of
HTTP Requests to implement offline. But maybe I'm wrong.

I'm not really fluent in Ruby but I'd say it creates a list of way ids on the server side and replies them back to Potlatch. JOSM could read this list and submit an API Multi-Get from the server. Deleted ways can be retrieved with Multi-Get too, a normal GET would throw a 404 Not Found.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to bilbo
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.