Edit OpenStreetMap Offline

I need help in how to add a new location using API’s on my own OSM server which is hosted on my local server by docker container?

Is that Edit osm offline - #2 by Negreheb you as well? Or is this some kind of exercise?

Offline-Editing should work with JOSM as far as i know.

I have run the OpenStreetMap on my own local server with the help of Docker. I need help how i can edit the map(e.g. add new location, new node) offline on own server.

Is that Edit OpenStreetMap Offline you as well? Or is this some kind of exercise?

Offline-Editing should work with JOSM as far as i know.

Would strongly recommend with offline editing such as with JOSM and reusing downloaded datasets (finish today or last week, new edits tomorrow), to run a “update data” or equivalent, before continuing the next day as other mappers could have changed something you downloaded the day/week before. If you don’t, you could end up with a ‘conflict’ situation when uploading your new edits, where your edit(s) differs from what was downloaded before from the server. Than you have to determine whether what’s on the server prevails or your new change does which then results in effectively dismissing the edits of same objects of the previous mapper. Not nice at all.

image

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace MapApi.Controllers
{
public class OSmController : ApiController
{
[HttpPost]
public async Task CreateNode()
{
string url = “http://192.168.43.177:8080/api/0.6/node/create”;

        // Construct the XML payload
        string xmlData = $@"
            <osm>
                <node lat=""33.642782"" lon=""73.077733"" version=""1"" changeset=""1"">
                    <tag k=""key1"" v=""value1""/>
                    <tag k=""key2"" v=""value2""/>
                </node>
            </osm>";

        using (HttpClient client = new HttpClient())
        {
            // Create the HTTP content with XML payload
            HttpContent content = new StringContent(xmlData, Encoding.UTF8, "application/xml");

            // Make the POST request
            HttpResponseMessage response = await client.PostAsync(url, content);

            // Check if the request was successful
            if (response.IsSuccessStatusCode)
            {
                return Ok("Node created successfully!");
            }
            else
            {
                return BadRequest("Failed to create node. Status code: " + response.StatusCode);
            }
        }
    }
}

}
i’m using this code to create a node on Osm server locally but getting this error
StatusCode: 404, ReasonPhrase: ‘Not Found’, Version: 1.1, Content: System.Net.Http.StreamContent,