Modify

Opened 15 years ago

Closed 15 years ago

#2703 closed defect (fixed)

[PATCH] server capabilities check before upload

Reported by: katpatuka Owned by: dmuecke
Priority: minor Milestone:
Component: Core Version:
Keywords: validate maximum way node count Cc: Gubaer

Description

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.

Attachments (1)

capabilities.txt (4.0 KB ) - added by dmuecke 15 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by anonymous, 15 years ago

Owner: changed from team to anonymous
Status: newassigned

comment:2 by dmuecke, 15 years ago

Owner: changed from anonymous to dmuecke
Status: assignednew

comment:3 by dmuecke, 15 years ago

Status: newassigned

comment:4 by dmuecke, 15 years ago

Summary: server capabilities check before upload[PATCH] server capabilities check before upload

comment:5 by Gubaer, 15 years ago

Cc: Gubaer added

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 in update and delete?

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

  • checks for tags with length(value) > 255. They cause a 412 Precondition violation on the server
  • the max. size of a changeset

by dmuecke, 15 years ago

Attachment: capabilities.txt added

comment:6 by dmuecke, 15 years ago

I've made all changes as suggested and uploaded new patch file.

comment:7 by Gubaer, 15 years ago

Resolution: fixed
Status: assignedclosed

slightly extended and applied in r1691.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain dmuecke.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.