Create way
- One of the main OpenStreetMap API usabilities
Creates a new way element. In response you will receive way ID.
To create new way you must operate inside an open changeset
Insert the ongoing changeset ID changeset
to the request body. After completing various operations on the element, you should close a changset (or it will close automatically). You can also do multiple operations on many elements (create, update, delete) in one ongoing changeset.
In request body the node's IDs nd ref
and tags tag
are also required (check the example).
Request
<osm>
<way changeset="412389">
<nd ref="4359470504"/>
<nd ref="4359471036"/>
<tag k="highway" v="footway"/>
<tag k="JayStecki" v="Boundary for a plot in the ROD-Association garden"/>
</way>
</osm>
Response
wayID_example.xml | |
---|---|
Error codes
When there are errors parsing the XML (a text message explaining the error is returned). When a changeset ID is missing, when there are too many nodes for a way.
If the request is not a (HTTP) POST request.
If the changeset in question has already been closed either by the user or as a result of the auto-closing feature (example: The changeset 412384 was closed at 2025-04-23 11:51:26 UTC). Also, if the user trying to update the changeset is not the same as the one that created it.
When a way has nodes that do not exist, were deleted or aren't visible.
When the request has been blocked due to rate limiting.