#18248 closed defect (fixed)
[Patch] raise maximum simplify-way.max-error
Reported by: | Klumbumbus | Owned by: | Don-vip |
---|---|---|---|
Priority: | normal | Milestone: | 19.10 |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description (last modified by )
r15419 added a maximum value for simplify-way.max-error
which is 100.
I suggest to raise it to 10000, because e.g. to simplify the shapes for wiki:/Maps/Croatia?action=diff&version=15 (where one had 3338! nodes) I needed a simplify-way.max-error
of 2000. I did it this way:
-
SimplifyWayAction.java
133 133 JPanel q = new JPanel(new GridBagLayout()); 134 134 q.add(new JLabel(tr("Maximum error (meters): "))); 135 135 JSpinner n = new JSpinner(new SpinnerNumberModel( 136 s.getDouble(keyError, 3.0), 0.01, 100 , 0.5));136 s.getDouble(keyError, 3.0), 0.01, 10000, 0.5)); 137 137 q.add(n); 138 138 q.setBorder(BorderFactory.createEmptyBorder(14, 0, 10, 0)); 139 139 p.add(q, GBC.eol());
and noticed no problems. Was there a reason for the 100 limit?
One open point with this change is when you type values >10000 it corrects them to 100 instead to 10000, I don't know where to fix that.
Another thing is if you add a larger simplify-way.max-error
value directly in the preferences you get an exception. Not sure if that should be catched.
Attachments (0)
Change History (7)
comment:1 by , 5 years ago
Cc: | removed |
---|---|
Description: | modified (diff) |
Milestone: | → 19.10 |
Owner: | changed from | to
Type: | enhancement → defect |
comment:2 by , 5 years ago
I'll have a look, I don't remember why I did that half a year ago. But agreed it makes no sense at all.
comment:3 by , 5 years ago
-
src/org/openstreetmap/josm/actions/SimplifyWayAction.java
133 133 JPanel q = new JPanel(new GridBagLayout()); 134 134 q.add(new JLabel(tr("Maximum error (meters): "))); 135 135 JSpinner n = new JSpinner(new SpinnerNumberModel( 136 s.getDouble(keyError, 3.0), 0.01, 100, 0.5)); 136 s.getDouble(keyError, 3.0), 0.01, null, 0.5)); 137 ((JSpinner.DefaultEditor) n.getEditor()).getTextField().setColumns(4); 137 138 q.add(n); 138 139 q.setBorder(BorderFactory.createEmptyBorder(14, 0, 10, 0)); 139 140 p.add(q, GBC.eol());
Let's just give the user the freedom he deserves ;)
I believe the reason it jumped back to 100 for you was that it just goes back to the last valid value entered.
comment:4 by , 5 years ago
Owner: | removed |
---|---|
Summary: | raise maximum simplify-way.max-error → [Patch] raise maximum simplify-way.max-error |
Version: | → latest |
So yeah the reason I did that was probably because the width of the JSpinner is usually determined by its max value, so I just put 100, wanted to change it later and forgot about it.
comment:5 by , 5 years ago
Updated the "patch" above, because I just noticed that SpinnerNumberModel
takes null
as an argument, so no need at all for Integer.MAX_VALUE
.
@Bjoeni can you please provide a patch for the different issues described here?