This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Reloading JOSM after modifying content of local .osm XML file

0

Hi OpenStreetMap community,

I've been working with OpenStreetMap and JOSM recently, alongside with Pyosmium and other Python libraries, and using a local copy extracted from the OpenStreetMap webpage.

My goal is to get my actual position (I already have my coordinates lon and lat), and create a new node in that position. I have achieved this step using Pyosmium and modifying the .osm XML file.

The problem is that I want to keep repeating this step (getting new position and modifying the node previously created with the new coordinates), and I would like to have the possibility to see it in an editor such as JOSM, but it does not updates or reloads the file once I have changed it using a Python script. Do you know if there is any other editor/display that allows me to do that, or if there is any option I can manage to do so with JOSM? Right now, the only solution I have achieved is to open the file again inside JOSM to reload the content of my .osm file.

Just to clarify, I dont have any intention to update the OpenStreetMap database, I'm just working locally with the .osm file.

Thank you so much for your help!

asked 24 Apr '18, 15:13

escrei1584's gravatar image

escrei1584
16113
accept rate: 0%


One Answer:

1

You could look and see if any of the remote control commands work for what you want to do:

https://josm.openstreetmap.de/wiki/Help/RemoteControlCommands

I don't see a way to delete a point, but maybe just creating a new node at each update works for your purpose?

Otherwise I expect you'd have to make a JOSM plugin. Your usecase at least sounds similar to https://wiki.openstreetmap.org/wiki/JOSM/Plugins/LiveGPS

answered 24 Apr '18, 20:22

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Thank you so much! I managed to get it working using the remote control commands and adding the node each time to JOSM.

(25 Apr '18, 09:48) escrei1584

Source code available on GitHub .