[OSM-dev] API id placeholders

Lars Aronsson lars at aronsson.se
Sun May 6 11:25:26 BST 2007


SteveC wrote:

> It's not id='create', it's the URL for node creation is 
> /api/0.4/node/create rather than /api/0.4/node/0. It's a nicer 
> URL.

Is it only the URL, or also the message "payload" body?  The wiki 
page [[OSM Protocol Version 0.4]] is not yet clear about this.  I 
assumed it was s/0/create/ in both places.

> Is it beyond you to fix it also?

I actually think I could fix this, maybe not in five minutes but 
eventually.  What I'm asking is simply if there is any policy or 
religion that would stop this from being acceptable.  The change 
from 0 to create seems totally pointless to me, and that this 
change is being introduced appears to indicate puritanism and/or 
religion rather than rational thinking.

Of course I understand that there are issues with error handling, 
as Frederik points out. However, this doesn't have to be much 
harder than doing the same thing that is now being done in JOSM, 
only moving the loop to the server side.

Current behaviour:

User: presses "upload"
JOSM: starts a loop, sending each update to the server
Server: executes each update as it arrives
JOSM: receives each response,
  updates its internal data structures,
  decides whether to continue after an error
User: has to accept whatever JOSM decided about errors

New behaviour:

User: presses "upload"
JOSM: sends a single bundle of requests to the server
Server: starts a loop, executing each update in sequence,
  decides whether to continue after an error
JOSM: receives a single bundle of responses,
  starts a loop to update its internal data structures,
  has to accept whatever the server decided about errors

Since the introduction of a "bundle" call doesn't change anything 
in existing protocol calls, the change would be fully backwards 
compatible.  It follows that it is quite acceptable if the new 
call has some restrictions, e.g. if it handles at most 50 objects, 
or if it only handles creation, or only handles updates, or only 
handles objects of one kind (e.g. node creation).  All it really 
needs to do is provide some kind of performance speedup for the 
most commonly occuring case.  If one bundle call can create 50 
nodes, another bundle call can create 49 line segments, and a 
third (non-bundle) call is required to create a way, this is 3 
calls instead of today's API requiring 100 calls.  If the ping 
roundtrip time is 140 ms, the time gained in roundtrip alone (HTTP 
and API setup overhead ignored) would be 13.5 seconds.

Please correct me if I have misunderstood something.



-- 
  Lars Aronsson (lars at aronsson.se)
  Aronsson Datateknik - http://aronsson.se




More information about the dev mailing list