[PATCH] server capabilities check before upload
Several times I tried to upload ways longer than 2000 nodes. Josm takes a long time to finally notify me about too long a way. It would be nice to have a check _before_ actually upload starts if any of the ways do not obey the maximum values as listed in http://www.openstreetmap.org/api/capabilities.
Change History
(8)
Owner: |
changed from team to anonymous
|
Status: |
new → assigned
|
Owner: |
changed from anonymous to dmuecke
|
Status: |
assigned → new
|
Summary: |
server capabilities check before upload → [PATCH] server capabilities check before upload
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
I see that you are checking ways in the collection
add
. I'd say, updated primitives should be checked too, possibly even deleted ones, because the API expects a valid primitive in the body of a delete request. Shouldn't you have another loop over primitives inupdate
anddelete
?Here
JOptionPane.showMessageDialog(Main.parent,tr("One way exceeds maximum way nodes ({0}).", maxNodes));
you could include the way id. And initialize JOSMs selection with the way before you return. The user then immediatelly sees which way causes problems.
Also, I suggest to move the code in its own class, i.e.
ApiPreconditionChecker
. It should also include