Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Uploading complete "OSM" format files via the API #54

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

Uploading complete "OSM" format files via the API #54

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: nick[at]hogweed.org
[Submitted to the original trac issue database at 5.40pm, Friday, 11th November 2005]

Would be good to be able to upload (via the API) a complete 0.2 OSM format
XML file, with both nodes and segments. e.g.

The only problem with this, of course, would be that the "from" and "to"
values for the segments would be unknown if the nodes are new. Could we
maybe implement a system where if node and segment IDs were negative
numbers, e.g.

and

then OSM would just allocate the next available ID to them?

@openstreetmap-trac
Copy link
Author

Author: immanuel.scholz[at]gmx.de
[Added to the original trac issue at 9.38am, Tuesday, 6th December 2005]

I dislike the idea of reinterpreting the meaning of "id" as "id, but if it is negative, it is an id with the boolean flag that the object is new".

I think this is hacky. Better express it as it should be expressed: one attribute for the id another for the fact that the object is new.

As example:

Here, the id is self generated from the application. The application must not assume that this id is still valid after sending the data, since it will be changed by the server as soon as the data arrived. The server response to the request by transferring back all sent objects with correct id's replaced.

The id specified together with action="new" must be unique among the file transfered but may be doubled to any object not transfered in this session. If action="new" is ommited, the uid attribute must be unique among the whole database (this means: must be obtained from the server in an earlier request).

This way, we can also sent deleting requests in the same scheme: action="delete"

Summary: My suggestion is to add an attribute "action" to each object sent by this (and only this) summary request.

action defaults to "change", so if it is ommited, the object is changed to the given value.
If action is "new", the object is created as new in the database (if not any merging rule like "equal lon/lat" applies, in which case the action is interpreted as "changing the merged object").
If action is "delete", the object is deleted (if it was in database. If not, nothing happens).

@openstreetmap-trac
Copy link
Author

Author: immanuel.scholz[at]gmx.de
[Added to the original trac issue at 1.00pm, Tuesday, 14th February 2006]

Ok. I no longer have a problem with negative ids. ;-)
My sugestion is flawed, please do not implement this!

In fact, JOSM already implemented this system for it save files. Negative ids are "new and thus unknown" :-)

Imi.

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 11.54am, Sunday, 3rd May 2009]

Implemented (effectively) in the 0.6 API via the changeset upload mechanism.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant