Modify

Opened 8 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#19199 closed enhancement (fixed)

[PATCH] There should be some way to determine how many nodes are superflous in a way

Reported by: taylor.smock Owned by: team
Priority: normal Milestone: 20.06
Component: Core Version:
Keywords: template_report Cc:

Description

This can be used to tell the user roughly how many nodes will be removed (although, since it uses the same algorithm as the actual node removal, it should be the same).

The primary reason I want it is so that I can easily tell how many nodes will be removed, if the user simplifies the way, although this patch isn't necessary for my needs (I can just directly call the commands with specified parameters).

I do think it will be a useful UI component, regardless (as seen in the patch).

Attachments (3)

19199.patch (5.5 KB) - added by taylor.smock 8 weeks ago.
19199.1.patch (7.1 KB) - added by taylor.smock 8 weeks ago.
This was an attempt to allow the mapview display how the maximum error (threshold) actually affected the way. This does not work, since the EDT is blocked.
19199.gpx_to_osm.patch (1.6 KB) - added by taylor.smock 4 weeks ago.
Send ways that will be simplified due to converting from GPX to OSM data

Download all attachments as: .zip

Change History (10)

Changed 8 weeks ago by taylor.smock

Attachment: 19199.patch added

Changed 8 weeks ago by taylor.smock

Attachment: 19199.1.patch added

This was an attempt to allow the mapview display how the maximum error (threshold) actually affected the way. This does not work, since the EDT is blocked.

comment:1 Changed 5 weeks ago by taylor.smock

Is there any interest for this patch?

comment:2 Changed 4 weeks ago by simon04

Resolution: fixed
Status: newclosed

In 16566/josm:

fix #19199 - SimplifyWayAction: display how many nodes are going to be removed (patch by taylor.smock, modified)

comment:3 Changed 4 weeks ago by simon04

Milestone: 20.06

comment:4 Changed 4 weeks ago by GerdP

Nice! I miss two points:
1) some kind of percentage would be nice, e.g. "about 1,232 nodes (30%) to remove"
2) Shouldn't convert gpx to data use the same code and thus show the same dialog?

comment:5 in reply to:  4 Changed 4 weeks ago by taylor.smock

Replying to GerdP:

Nice! I miss two points:
1) some kind of percentage would be nice, e.g. "about 1,232 nodes (30%) to remove"

I think I did look at adding a percentage. I don't remember why I didn't (possibly due to line length -- I probably didn't want to try to do a line-wrap).

2) Shouldn't convert gpx to data use the same code and thus show the same dialog?

I've never used that feature -- my local area has recent imagery (~1 year old at this point). I would expect them to use the same dialog.

That being said, the nodes to remove only appear if the calling function sends the ways that are being modified to the dialog. Otherwise, it cannot determine the number of nodes that will be removed.

I'll be uploading a patch for that here in a minute.

Changed 4 weeks ago by taylor.smock

Attachment: 19199.gpx_to_osm.patch added

Send ways that will be simplified due to converting from GPX to OSM data

comment:6 Changed 4 weeks ago by GerdP

In 16570/josm:

see #19199: There should be some way to determine how many nodes are superflous in a way

  • show number of nodes also when converting gpx to data layer

19199.gpx_to_osm.patch by taylor.smock

comment:7 Changed 4 weeks ago by taylor.smock

It looks like the 19199.1.patch was the patch that was merged. If I (or someone else) ever gets around to allowing the map screen to repaint while a dialog window is up, some of the code used will no longer be dead (it is effectively dead -- it is still called, but doesn't do what it is supposed to do). It was supposed to show how the way changed as the threshold was modified.

See https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java?rev=16566#L499 for the code in question.

Calling code could probably be modified to do something like this:

MainApplication.worker.submit(() -> {
    int ret = SimplifyWayAction.askSimplifyWays(ways, text, auto);
    realizeSimplifyReturn(ret);
});

There are probably some EDT violations in there somewhere, and there might be some other locations where the EDT is blocked by the simplify way dialog.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.