Closed alpertungakin closed 3 years ago
@alpertungakin sorry for not responding sooner, I'm finally looking at you issue.
There seems to be a misunderstanding regarding the ChangesetUpload
method. You could either create a new way using WayCreate
as sou did, but then ChangesetUpload
is not needed.
If you want to use ChangesetUpload
then see this snippet:
import osmapi
api = osmapi.OsmApi(api = "https://api06.dev.openstreetmap.org", username = "metaodi", password="mypassword")
cs = api.ChangesetCreate()
start = api.NodeCreate({"lon":39.77188512682915,"lat":40.99645466061746,"visible":True})
stop = api.NodeCreate({"lon":39.77237597107887,"lat":40.99594855924428,"visible":True})
wayPoints = [start["id"], stop["id"]]
way = {"id": -1, "nd":wayPoints ,"tag":{'highway': 'secondary'}}
api.ChangesetUpload([{"type":"way","action":"create","data":way}])
api.ChangesetClose()
Using this snippet, I created the following test changeset: https://api06.dev.openstreetmap.org/changeset/226137#map=19/40.99620/39.77213
I've just started to explore this API and tried to upload a "way" into OSM.
"way" is the my way object. After the execution, "Request failed: 404 - Not Found - b" this error occured. Am I doing something wrong or uncomplete?