-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload multiple nodes/ways/relations with one connection #101
Comments
Unless I am mistaken, there doesn't seem to support for bulk editing via the API this library depends on. If this feature is important for your use case, you might consider opening an issue on this repository. If a bulk edit endpoint is added to the API, that would open the possibility of supporting the feature here. I will note that this library takes advantage of HTTP connection reuse, which is significantly faster than opening a new connection for each request. A bulk edit endpoint would likely be even faster, but it's not clear how much faster it would be without further investigation. More immediately, you might find some of the links here to be useful if you are hoping to perform large edits via the API. |
It makes sense that the API wouldn't support it, so I would understand if this gets closed. But I did notice the bit in the wiki that states, "You can also use the API to upload a change set in an atomic manner." I was kind of assuming that might be what JOSM does, so I figured if y'all use the same API, that this library could also build an atomic changeset. As it stands, I won't be too sad if this doesn't get implemented. Just throwing it out there in case it was possible and someone wanted to tackle it. |
Every editing application (iD, JOSM,...) uses diff upload these days: https://wiki.openstreetmap.org/wiki/API_v0.6#Diff_upload:_POST_.2Fapi.2F0.6.2Fchangeset.2F.23id.2Fupload which allows uploading multiple changes at once. Rather than doing this in python you could of course use some scripting in JOSM, as an example, and validate the results in an editor before uploading. |
I tried looking at for change in ChangesData:
data += "<" + change["action"] + ">\n"
change["data"]["changeset"] = self._CurrentChangesetId
data += xmlbuilder._XmlBuild(
change["type"], change["data"], False, data=self
).decode("utf-8")
data += "</" + change["action"] + ">\n"
data += "</osmChange>" I will be more than happy to help in this regard. Do let me know if I can submit a pull request |
@susrisha Sure go ahead with a PR, this would be great 😃 |
#155 - There you go :) |
@metaodi any update on the PR ?? |
Not yet, didn't have the time to review it. I'll try to get back to you in a few days. |
Hey @metaodi can you please have a look at the PR? |
#155 is the basis for this change, next up are changes needed in the "API"-methods for nodes/ways/relations to actually benefit from this new capability. |
Wouldn't it be much faster to update several objects with a single call instead of doing NodeUpdate after NodeUpdate after NodeUpdate? Maybe have a NodesUpdate([node1, node2, ...]) call that would bundle that up into a single connection/upload to OSM servers.
The text was updated successfully, but these errors were encountered: